From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) Description of problem: We attach gdb to a program, then we use another program to try and determine when/if the debugger is attached by reading the /proc/pid/status for the value of TracerPid and /proc/pid/stat for the value of "traced" in the flags. Neither one seems to be set, whereas it seems like it should be set if the program is being debugged. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1.run a program that lasts long enough for you to... 2.attach gdb to the program 3. cat /proc/pid/status and /proc/pid/stat to evaluate the TracerPid and "traced" bits for the program (I think TracerPid is the 'new' mechanism for this, but we're checking both so we can span versions.) Note: we were using a threaded program, but I checked all processes and all values for these bits were zero. I haven't tried with a non-threaded program. Actual Results: TracerPid bit is 0 and so is the traced bit, so our tool assumes the debugger is not attached, when in fact it is attached. Expected Results: Recognition that the debugger was attached to the program. Additional info: We are running the beta1 which is 2.4.9-14a, but we have looked at sources for 2.4.17. And basically it seems like /proc/pid/stat was not changed so that it would OR in the ptrace flag when it reports the process flags. I'll put in more details about that as an attachment...
Created attachment 44178 [details] Comments after looking at some source code
This behavior also happens on 7.2 x86.
Not related to RHL/RHEL. This is an old gdb bug from GES.