4 ms·
I would compile it with adress sanitizer. Its very easy and already included into gcc. You basically only need to add -fsanitize=address to compiler and linker
by randomNumber7 5y ago
I would compile it with adress sanitizer. Its very easy and already included into gcc. You basically only need to add -fsanitize=address to compiler and linker flags and -static-libasan.
Then you run it and when it dies address sanitizer tells you where the memory corruption occured. If the issue is pointer casting you 100% find it.
Then you can try to fix it. Most likely its s.th. like this:
Say you have a "long*" and the code assumes "ok a long has 4 bytes". Then casts the long* to a char* and does some fancy low level algorithm c programmers love.
But now you compile on debian 11 and suddenly a long is 8 bytes. And then ... it dies a horrible death.