On Dec 4, 2008, at 11:52 AM, Stefan Behnel wrote:

> Hi,
>
> the problem really was a ref-counting bug and it was in  
> BoolBinopNode. This
> Cython code
>
>     a or b
>
> generated the following C code:
>
> /*
> *     a or b             # <<<<<<<<<<<<<<
> */
>   /* __pyx_t_1 allocated */
>   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_a); if (unlikely 
> (__pyx_t_1 <
> 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno =
> __LINE__; goto __pyx_L1_error;}
>   if (!__pyx_t_1) {
>     /* __pyx_t_1 released */
>     /* __pyx_t_2 allocated */
>     __pyx_t_2 = __pyx_v_b;
>   } else {
>     __pyx_t_2 = __pyx_v_a;
>   }
>   Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
>   /* __pyx_t_2 released */
>
> So there's a deadly DECREF at the end. The fix is that __pyx_t_2 must
> receive an owned reference in both cases. Fixed now, and lxml  
> builds and
> runs like a charm. :)

Excellent news! What about the other direction, do you see any leaks?

- Robert

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to