Blog for hema

program's behaviour changing when attached to debugger or when using monitoring tools

Last week I managed to replicate a problem reported by one of our customers in Japan. It was about Policy agent 2.2 for Apache 2.2 crashing on 32 bit Red Hat Enterprise Linux ES release 4 (Nahant Update 4).

I downloaded the apache code from http://httpd.apache.org/download.cgi and built it on the system that I was trying to replicate this problem on.

I downloaded the policy agent from http://www.sun.com/download/products.xml?id=471909fcand before I installed the agent, I verified that I could start and stop the apache server correctly.

I followed the install steps outlined the install document and installation was successful. http://docs.sun.com/app/docs/doc/820-3288.

I now tried to start the apache server after installing the policy agent and it crashed with segmentation fault. Hiya, I could reproduce the problem !

Now that I could replicate the problem consistently on my lab system, I thought, I'll do some live debugging with gdb for that extra bit of fun.

I ran the program in gdb setting breakpoint in spin() and to my surprise, the process did not crash. The program exited normally. I thought, this might be due to the breakpoint that I
set. I re-ran the program without the breakpoint and the program ran
normally again in gdb .