stack smashing fun

One of the big risks with programming is buffer overruns. Since it becomes such a security issue, there are protections in place, which seem to have caught me doing something I didn't think out very well. I allocated a safe buffer, but forgot to make a secondary copy buffer safe as I had created it earlier. I think this is a warning that I should do a strlen() comparison before I concatenate something that is variable. It is just too late at night to be programming. I thought I would trap SIGKILL, (another misguided thought) and realized that if you could trap SIGKILL, with a program that needs to be deceased, it would be even a worse threat. You learn something new every day.

The kill method leaves enough information behind to see where the program was smashed, even absolute code locations and stack trace. I think I will avoid doing this to myself in the future since it can create all kinds of unexpected LOCK and other havoc. It did give me an opportunity to study stack smashing and the various algorithms.

*** stack smashing detected ***: ./AI_Ants2011 terminated ======= Backtrace: ========= /lib/tls/i686/cmov/[0x3d15390] /lib/tls/i686/cmov/[0x3d1533a]


Automated Intelligence

Automated Intelligence
Auftrag der unendlichen LOL katzen