3 ms·
> A segfault is not guaranteed, it’s just one of the more likely possibilities. Is it? It will depend on the code, but my gut feeling is that you typically wou
by Someone 1y ago
> A segfault is not guaranteed, it’s just one of the more likely possibilities.
Is it? It will depend on the code, but my gut feeling is that you typically would get a few (if not lot of) unnoticed non-segfaulting issues before you get the segfaulting one that tells you straight in your face that you have a problem.
- foldr 1y agoIt probably depends on how exactly the corruption happens. If you overwrite a pointer with an integer value, then the integer is statistically unlikely to correspond to a valid memory address. On the other hand, if you overwrite a pointer with a pointer, or an integer with an integer, all bets are off.
- Someone 1y ago> If you overwrite a pointer with an integer value, then the integer is statistically unlikely to correspond to a valid memory address On 64-bit systems, and even then, it depends on the system’s memory layout (I think most integer values in programs are < 2³²)
- foldr 1y agoRight. It’s unlikely both because the 64-bit value space is huge and because on most systems pointers have some of the high bytes set whereas typical integer values don’t. IIRC this combination of factors is what makes conservative GCs like BoehmGC quite effective on 64-bit architectures.