Closed NattyNarwhal closed 6 years ago
Null dereferences may be happening because AIX/i have page 0 mapped in anyways?
IIRC, the way Mono handles NREs is catching SIGSEGVs in managed code. If it's accessing "valid" memory....
If that's the case, then there's two options:
make 0x0 invalid for us, allowing for it to SIGSEGV (say, mprotect it)
somehow set that optimization to be mandatory for AIX/i
Option 1 is invalid; mmap/mprotect will throw ENOMEM if we try to map 0x0.
mono/mono#7300 filed.
Resolved upstream.
That being said, there are some cases when it can jump to 0x0 it seems? Roslyn might be triggering such a case.
The runtime seems to allow null dereferences to happen. Can be mitigated with
MONO_DEBUG="explicit-null-checks"
.Results, no
explicit-null-check
:Results, with
Another good example would be to access the "Keys" members of a Dictionary - this can expose issues with gshared, which can be disabled with
--optimize=-gshared
.