Boost C++ Libraries: Ticket #3592: under_debugger() goes into infinite loop https://svn.boost.org/trac10/ticket/3592 <p> In the under_debugger() function in debug.ipp there is the following loop: </p> <hr /> <blockquote> <p> pid_t pid = ::getpid(); </p> </blockquote> <blockquote> <p> while( pid != 0 ) { </p> <blockquote> <p> process_info pi( pid ); </p> </blockquote> </blockquote> <blockquote> <blockquote> <p> <em> !! ?? should we use tokenizer here instead? if( dbg_list.find( pi.binary_name() ) != const_string::npos ) </em></p> <blockquote> <p> return true; </p> </blockquote> </blockquote> </blockquote> <blockquote> <blockquote> <p> pid = pi.parent_pid(); </p> </blockquote> <p> } </p> </blockquote> <hr /> <p> 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. </p> <p> $ ps -ef | grep zsched </p> <blockquote> <p> root 2487 2487 0 Oct 13 ? 0:00 zsched </p> </blockquote> <p> Output from running the Test executable under truss shows how it keeps looping round on pid 2487. </p> <p> If I run the Test executable from within gdb, then it runs okay and under_debugger() doesn't go into an infinite loop. </p> <p> Output from truss is attached. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3592 Trac 1.4.3 a.sanders@… Thu, 05 Nov 2009 14:50:18 GMT attachment set https://svn.boost.org/trac10/ticket/3592 https://svn.boost.org/trac10/ticket/3592 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test-truss.txt</span> </li> </ul> <p> output from running Test executable under truss </p> Ticket Gennadiy Rozental Sun, 22 Nov 2009 21:57:06 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3592#comment:1 https://svn.boost.org/trac10/ticket/3592#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/57850" title="Handles the case where parent pid == process pid and != 0. Fixes ...">[57850]</a>) Handles the case where parent pid == process pid and != 0. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3495" title="#3495: Bugs: Boost::Test enters endless loop when running in vserver environment (closed: fixed)">#3495</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3481" title="#3481: Bugs: Boost Testing doesn't work under Sun Solaris Containers (closed: fixed)">#3481</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3592" title="#3592: Bugs: under_debugger() goes into infinite loop (closed: fixed)">#3592</a> </p> Ticket Raffi Enficiaud Tue, 07 Jul 2015 08:04:35 GMT milestone changed https://svn.boost.org/trac10/ticket/3592#comment:2 https://svn.boost.org/trac10/ticket/3592#comment:2 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.41.0</span> → <span class="trac-field-new">Boost 1.59.0</span> </li> </ul> Ticket