Conversation
Notices
-
Embed this notice
@theorytoe Since undefined behavior may not usually lead to a crash during certain complications, but not others.
One example would be forgetting a null terminator - sometimes gcc will add some null padding after arrays for alignment, resulting in the software working just fine (over-reading 1 null byte is very unlikely to lead to a segfault), but if the memory layout changes in the slightest, padding for alignment may no longer be required, meaning the reader blows past the end of the array and into "protected" memory and therefore causes a segfault.
I suggest compiling with -march=native -O3 as that tends to reveal the undefined behavior right when you make it.
-
Embed this notice
why am I so reatarded I throw all the functionality in one func and it works fine
but the MOMENT i split it out it fucking segfaults