Opened 13 years ago

Closed 13 years ago

Last modified 7 years ago

#3592 closed Bugs (fixed)

under_debugger() goes into infinite loop

Reported by: a.sanders@… Owned by: Gennadiy Rozental
Milestone: Boost 1.59.0 Component: test
Version: Boost 1.40.0 Severity: Problem
Keywords: Cc:

Description

In the under_debugger() function in debug.ipp there is the following loop:


pid_t pid = ::getpid();

while( pid != 0 ) {

process_info pi( pid );

!! ?? should we use tokenizer here instead? if( dbg_list.find( pi.binary_name() ) != const_string::npos )

return true;

pid = pi.parent_pid();

}


The loop assumes it will eventually find a process who's parent process id is zero. On our Solaris 10 systems (which is under Cluster control) it eventually ends up at the zsched process who's parent pid is the same as it's own pid. And so the loop never terminates.

$ ps -ef | grep zsched

root 2487 2487 0 Oct 13 ? 0:00 zsched

Output from running the Test executable under truss shows how it keeps looping round on pid 2487.

If I run the Test executable from within gdb, then it runs okay and under_debugger() doesn't go into an infinite loop.

Output from truss is attached.

Attachments (1)

test-truss.txt (3.6 KB ) - added by a.sanders@… 13 years ago.
output from running Test executable under truss

Download all attachments as: .zip

Change History (3)

by a.sanders@…, 13 years ago

Attachment: test-truss.txt added

output from running Test executable under truss

comment:1 by Gennadiy Rozental, 13 years ago

Resolution: fixed
Status: newclosed

(In [57850]) Handles the case where parent pid == process pid and != 0. Fixes #3495. Fixes #3481. Fixes #3592

comment:2 by Raffi Enficiaud, 7 years ago

Milestone: Boost 1.41.0Boost 1.59.0
Note: See TracTickets for help on using tickets.