Disable usage of AddressSanitizer pending a per-allocator review

It has been discovered that AddressSanitizer does not keep a 1:1 mapping
of which bytes are poisoned and which are not. This can cause issues for
allocations less than 8 bytes and where addresses straddle 8-byte
boundaries.

See the following link for more information:

https://github.com/google/sanitizers/wiki/AddressSanitizerAlgorithm#mapping
This commit is contained in:
Feoramund
2025-06-15 14:29:58 -04:00
parent 0b2cf9a4ca
commit efba9a1fb7
6 changed files with 108 additions and 92 deletions
+4 -4
View File
@@ -1,7 +1,7 @@
package mem
import "base:runtime"
import "base:sanitizer"
// import "base:sanitizer"
/*
Rollback stack default block size.
@@ -134,7 +134,7 @@ rb_free_all :: proc(stack: ^Rollback_Stack) {
stack.head.next_block = nil
stack.head.last_alloc = nil
stack.head.offset = 0
sanitizer.address_poison(stack.head.buffer)
// sanitizer.address_poison(stack.head.buffer)
}
/*
@@ -241,7 +241,7 @@ rb_alloc_bytes_non_zeroed :: proc(
block.offset = cast(uintptr)len(block.buffer)
}
res := ptr[:size]
sanitizer.address_unpoison(res)
// sanitizer.address_unpoison(res)
return res, nil
}
return nil, .Out_Of_Memory
@@ -338,7 +338,7 @@ rb_resize_bytes_non_zeroed :: proc(
block.offset += cast(uintptr)size - cast(uintptr)old_size
}
res := (ptr)[:size]
sanitizer.address_unpoison(res)
// sanitizer.address_unpoison(res)
#no_bounds_check return res, nil
}
}