Hacker News new | ask | show | jobs
by timtosi 3119 days ago
As C language teacher assistants in Uni, we used LD_PRELOAD during project defences to replace the lib standard malloc by one of our own in order to be sure that students allocated & freed memory correclty. Never saw so much Segmentation faults in such a short time window.
3 comments

If you can afford rebuilding from source, using AddressSanitizer (perhaps also UndefinedBehaviorSanitizer) should be better at uncovering memory safety bugs than any LD_PRELOAD trick.
Electric Fence is one such library. [1]

[1] https://elinux.org/Electric_Fence