Opened 13 years ago

Closed 13 years ago

Last modified 7 years ago

#3495 closed Bugs (fixed)

Boost::Test enters endless loop when running in vserver environment

Reported by: Eduard Hein <eduard_hein@…> Owned by: Gennadiy Rozental
Milestone: Boost 1.59.0 Component: test
Version: Boost 1.40.0 Severity: Problem
Keywords: Cc: eduard_hein@…

Description

Boost::Test tries to find out if a debugger is attached by iterating through the process tree until ppid 0 is reached. Some vserver kernel emulate the init process in a way that ppid of process 1 is 1. This lets the debugger search function go into an endless loop.

Since pid 1 is unlikely to be a debugger, we can safely ignore pid 1 and just quit searching when we reach pid 1 instead of 0. The attached patch implements this.

We observed this bug with standard Debian Lenny vserver host (linux-image-2.6.26-2-vserver-amd64, version 2.6.26-19) running Debian Lenny guest and Centos 5 guest.

Attachments (1)

boost-1.35.0-ppid-endless-loop.patch (758 bytes ) - added by Eduard Hein <eduard_hein@…> 13 years ago.

Download all attachments as: .zip

Change History (5)

by Eduard Hein <eduard_hein@…>, 13 years ago

comment:1 by Eduard Hein <eduard_hein@…>, 13 years ago

Cc: eduard_hein@… added

comment:2 by root@…, 13 years ago

Just ignoring 1 won't be enough since on Solaris-Containers pid of init can be any number. See Bug #3481 You have to check for pid == ppid and then abort.

Cheers Ranko Veselinovic

comment:3 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:4 by Raffi Enficiaud, 7 years ago

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