upstart should not trace fork branches with execve

Bug #799884 reported by Коренберг Марк
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
upstart
New
Undecided
Unassigned

Bug Description

1. Why this bug appear:
I decide to write a daemon in python. It uses ctypes. ctypes uses fork()+execve("ldconfig") to determine library paths at start of the program. So when I use "expect fork" or "expect daemon", upstart erroneously tries to follow this branch. Yes, it's a bug in python, but also misfeature of upstart. This also prevents from using daemons written in BASH.

2. How to prevent:
when "expect fork" or "expect daemon" is used, upstart should trace not only one branch, but all branches of all processes, spawned once job is started and until expected sequence of fork()s is complete. When any branch executes execve() in unexpected place, that branch should be ignored (and diagnostic message is printed (logged)).

3. Bad sides:
There are unclear situations (and races), like this:
-------------
if (fork())
{
   if (fork())
     exit(0)
   sleep(100)
}
else
{
   if (fork())
     exit(0)
   sleep(100)
}
--------------
These situations always exists in upstart, but ones should be detected and logged at least.

Revision history for this message
Michael Gliwinski (tzeentch-gm) wrote :
Revision history for this message
Коренберг Марк (socketpair) wrote :

No, it's not duplicate of that bug

Revision history for this message
Eugene Pankov (john-pankov) wrote :

Solved this in my app by lazy-loading the module (uuid)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.