[Pyrex] Tricky bug while unloading modules
Robert Bradshaw
robertwb at math.washington.edu
Fri Nov 16 22:15:13 CET 2007
Probably the easiest fix is to make the cleanup level (in Options.py)
equal to 0. The cleanup function is still slightly experimental, and
is primarily useful for improving the signal/noise ratio when using
tools like valgrind to find memory leaks.
As all memory is returned when the process exits, so the cleanup code
is not strictly necessary.
- Robert
On Nov 16, 2007, at 1:05 PM, Gustavo Sverzut Barbieri wrote:
> Hi,
>
> I'm mailing both Cython and Pyrex as we use Cython, but 99% sure that
> this problem also happens on Pyrex.
>
> In Python-EFL we have two modules that are related: evas and
> ecore.evas. The former is a canvas and its objects, the latter is the
> window that contains the canvas and its objects.
> The window (ecore.evas) have a reference to the canvas (evas) that
> have reference to it's children. The C module will do the cascade
> delete when the root is deleted, with proper callbacks to inform
> object death.
>
> The problem happens when the window is not explicitly deleted by user
> and the program ends: the module will be unloaded before the objects
> are collected, but we have a call in the object dealloc that will use
> a method (from another object), that requires a module python-string
> to resolve the method. This string is NULL by that time, since
> cleanup() was run on module unloading, making our software exit with
> SEGV.
>
> To avoid the problem, we're forcing object's death with "del window",
> but it would be nice to have this object delete+unload done right,
> maybe force collection of module objects before unloading or something
> in these lines. I'm not sure what's the proper way to fix this.
>
> --
> Gustavo Sverzut Barbieri
> --------------------------------------
> Jabber: barbieri at gmail.com
> MSN: barbieri at gmail.com
> ICQ#: 17249123
> Skype: gsbarbieri
> Mobile: +55 (81) 9927 0010
>
> _______________________________________________
> Pyrex mailing list
> Pyrex at lists.copyleft.no
> http://lists.copyleft.no/mailman/listinfo/pyrex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.copyleft.no/pipermail/pyrex/attachments/20071116/9ef7b59f/attachment-0001.bin
More information about the Pyrex
mailing list