[Pkg-freevo-maint] Bug#575293: Bug#575293: python-kaa-base: integration with twisted does not work anymore

Mickael Royer mickael.royer at gmail.com
Thu Mar 25 22:06:23 UTC 2010


Hi,

> do you mean that the call os.popen in
> line 55 in /usr/lib/python2.5/ctypes/util.py
> triggers an initialization of kaa notifier ?
>
> how does this happen?

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)"
So kaa check SIGHDL (signal sent to a process when a child process
terminates). Just after that (in the same function, line 79) we call
ctypes.util.find_library which call popen. When popen finished, SIGHDL
is raised, so self._sigchld_handler is called and the notifier is
initialized.

> can it be avoided?

The solution I see is to load libc library with ctypes just before
start to handle SIGHDL signal. I try quickly and it seems to work
well.

Cheers
Mickaël

On Thu, Mar 25, 2010 at 9:44 AM, A Mennucc <debdev at tonelli.sns.it> wrote:
> hi,
>
> thanks a lot for the detailed analysis
>
> On Wed, Mar 24, 2010 at 09:14:20PM +0100, Mickael Royer wrote:
>> More information :
>>
>> The problem does not appear in version 0.6.0-2 and is due to this diff :
>> diff -ru kaa/process.py kaa--new/process.py
> [...]
>
> yes, this was added in the hope of supporting architectures with
> different libc
>
>> When we import kaa, this code is called and ctypes.util.find_library
>> call popen function which force kaa notifier init.
>
> do you mean that the call os.popen in
> line 55 in /usr/lib/python2.5/ctypes/util.py
> triggers an initialization of kaa notifier ?
>
> how does this happen?
>
> can it be avoided?
>
> a.
>





More information about the Pkg-freevo-maint mailing list