Re: [Cython] Bad interaction between cimported types and module cleanup

2012-08-04 Thread Stefan Behnel
Lisandro Dalcin, 04.08.2012 23:33: > To properly test this we would need to namespace the __cleanup > functions registered with atexit, I mean to name them > 'cleanup' Sure, why not. > that way we could loop over registered > functions to and call them "by hand". I'm not sure if that'll wor

Re: [Cython] Bad interaction between cimported types and module cleanup

2012-08-04 Thread Lisandro Dalcin
On 4 August 2012 17:50, Stefan Behnel wrote: > Stefan Behnel, 04.08.2012 14:59: >> Lisandro Dalcin, 03.08.2012 18:51: >>> diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py >>> index 2472de3..255b047 100644 >>> --- a/Cython/Compiler/ModuleNode.py >>> +++ b/Cython/Compiler/M

Re: [Cython] Bad interaction between cimported types and module cleanup

2012-08-04 Thread Stefan Behnel
Stefan Behnel, 04.08.2012 14:59: > Lisandro Dalcin, 03.08.2012 18:51: >> diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py >> index 2472de3..255b047 100644 >> --- a/Cython/Compiler/ModuleNode.py >> +++ b/Cython/Compiler/ModuleNode.py >> @@ -,7 +,11 @@ class ModuleNo

Re: [Cython] Bad interaction between cimported types and module cleanup

2012-08-04 Thread Stefan Behnel
Lisandro Dalcin, 03.08.2012 18:51: > diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py > index 2472de3..255b047 100644 > --- a/Cython/Compiler/ModuleNode.py > +++ b/Cython/Compiler/ModuleNode.py > @@ -,7 +,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): >

Re: [Cython] Bad interaction between cimported types and module cleanup

2012-08-03 Thread Stefan Behnel
Lisandro Dalcin, 03.08.2012 18:51: >> Stefan Behnel, 03.08.2012 06:04: >>> Lisandro, could you open a pull request with only the single line change >>> and a comment that properly explains why we are doing this? > > Is the comment blow clear enough for you? Thanks. I fixed it up a little. :) >

Re: [Cython] Bad interaction between cimported types and module cleanup

2012-08-03 Thread Lisandro Dalcin
On 3 August 2012 01:07, Stefan Behnel wrote: > Stefan Behnel, 03.08.2012 06:04: >> Lisandro, could you open a pull request with only the single line change >> and a comment that properly explains why we are doing this? > > A code comment, just to be clear. > Is the comment blow clear enough for y

Re: [Cython] Bad interaction between cimported types and module cleanup

2012-08-02 Thread Stefan Behnel
Stefan Behnel, 03.08.2012 06:04: > Lisandro, could you open a pull request with only the single line change > and a comment that properly explains why we are doing this? A code comment, just to be clear. Stefan ___ cython-devel mailing list cython-deve

Re: [Cython] Bad interaction between cimported types and module cleanup

2012-08-02 Thread Stefan Behnel
Lisandro Dalcin, 03.08.2012 00:36: > Basically, the module cleanup function nullifies the type ptr of > cimported parent types, but tp_dealloc slots of children types access > these null pointers, then you get a segfault. Looking at Py_Finalize() > , atexit functions are run BEFORE a gargabe collec

[Cython] Bad interaction between cimported types and module cleanup

2012-08-02 Thread Lisandro Dalcin
Basically, the module cleanup function nullifies the type ptr of cimported parent types, but tp_dealloc slots of children types access these null pointers, then you get a segfault. Looking at Py_Finalize() , atexit functions are run BEFORE a gargabe collection step and the destroy of all modules.