> It happens like that : > 1. import kaa > 2. in kaa/__init__.py line 39 "from async import ..." > 3. in kaa/async.py line 977 "import main" > 4. in kaa/main.py line 30 "from process import supervisor" > 5. in kaa/process.py line 182 "supervisor = _Supervisor" > 6. in kaa/process.py line 64 in constructor of _Supervisor : > "signal.signal(signal.SIGCHLD, self._sigchld_handler)"
>From tonight's investigations, I could get the following backtrace which is where the timer is started and thus the notifier is said to be already started. -- import kaa File "/usr/lib/python2.5/site-packages/kaa/__init__.py", line 39, in <module> from async import TimeoutException, InProgress, InProgressCallback, \ File "/usr/lib/python2.5/site-packages/kaa/async.py", line 977, in <module> import main File "/usr/lib/python2.5/site-packages/kaa/main.py", line 50, in <module> from process import supervisor File "/usr/lib/python2.5/site-packages/kaa/process.py", line 182, in <module> supervisor = _Supervisor() File "/usr/lib/python2.5/site-packages/kaa/process.py", line 79, in __init__ libc=ctypes.util.find_library('c') File "/usr/lib/python2.5/ctypes/util.py", line 164, in find_library return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name)) File "/usr/lib/python2.5/ctypes/util.py", line 158, in _findSoname_ldconfig os.popen('LANG=C /sbin/ldconfig -p 2>/dev/null').read()) File "/usr/lib/python2.5/site-packages/kaa/timer.py", line 96, in newfunc t.start(interval) -- Now, this is in the @timed decorator from kaa.timer and using a dirty print statement, I could get the only decorated function name which is _sigchld_handler . This signal is triggered, because the ldconfig child process terminates. Knowing this, a working fix, as said, is as simple as delaying the signal setting, as shown by the attached patch, which works. Cheers, Alex
diff -Nru kaa-base-0.6.0/src/process.py kaa-base-0.6.0.new//src/process.py --- kaa-base-0.6.0/src/process.py 2010-03-25 23:04:04.000000000 +0100 +++ kaa-base-0.6.0.new//src/process.py 2010-03-25 23:15:37.000000000 +0100 @@ -61,7 +61,6 @@ def __init__(self): self.processes = {} - signal.signal(signal.SIGCHLD, self._sigchld_handler) # Set SA_RESTART bit for the signal, which restarts any interrupted # system calls -- however, select (at least on Linux) is NOT restarted # for reasons described at: @@ -72,11 +71,15 @@ v = sys.version_info if v[0] >= 3 or (v[0] == 2 and v[1] >= 6): # Python 2.6+ + signal.signal(signal.SIGCHLD, self._sigchld_handler) signal.siginterrupt(signal.SIGCHLD, False) elif v[0] == 2 and v[1] == 5: # Python 2.5 import ctypes, ctypes.util libc=ctypes.util.find_library('c') + # ctypes.util.find_library() involves a child process, so the + # hanler should be set after the call. + signal.signal(signal.SIGCHLD, self._sigchld_handler) ctypes.CDLL(libc).siginterrupt(signal.SIGCHLD, 0) else: # Python 2.4- is not supported.