Re: [Cython] Cython code producing different, incorrect results under Python 2.7 (not 3.x) under Cython 0.19

2013-04-25 Thread Stefan Behnel
Nikita Nemkin, 24.04.2013 09:48:
> _mcp.pyx declares #cython: wraparound=False, any negative index is expected
> to fail.
> It worked previously because Cython was using PySequence_GetSlice
> which of course is not sensitive to Cython directives.
> 
> The only "fix" would be to produce a warning for constant negative indexes in
> wraparound=False mode.

Good call. I added a warning:

https://github.com/cython/cython/commit/f72eb8966ac1816279c81c01d721f0d4d795509b

Let's see what that gives us. It most likely needs a bit more tuning to
avoid false positives in known-to-be-safe cases, but since it's not clear
to me what those are, it's just always emitting the warning for now.

Stefan

___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


[Cython] regarding ticket #810 (segfault in Sage)

2013-04-25 Thread Stefan Behnel
Hi,

looking at this ticket:

http://trac.cython.org/cython_trac/ticket/810

and at the underlying Sage ticket:

http://trac.sagemath.org/sage_trac/ticket/14452

ISTM that this crash is not actually related to cdef kwargs but simply to
the fact that the C code is now calling directly through the C layer and no
longer through Python. The major difference being that Python puts
arguments into a tuple that is kept alive for the whole timespan of the
call, whereas C just passes in the reference and forgets about it.

Since the method in question replaces references internally, it's quite
possible that it somehow deletes the last reference to the object that was
passed in. I wouldn't really know why, as we specifically guard against
these things since somewhere around 0.17 (and comment #7 in the Sage ticket
shows an example of that), but maybe this is just a corner case that we
failed to handle so far, or maybe the Sage code is doing something
'unexpected' here.

Stefan
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] regarding ticket #810 (segfault in Sage)

2013-04-25 Thread Stefan Behnel
Stefan Behnel, 26.04.2013 07:07:
> looking at this ticket:
> 
> http://trac.cython.org/cython_trac/ticket/810
> 
> and at the underlying Sage ticket:
> 
> http://trac.sagemath.org/sage_trac/ticket/14452
> 
> ISTM that this crash is not actually related to cdef kwargs but simply to
> the fact that the C code is now calling directly through the C layer and no
> longer through Python. The major difference being that Python puts
> arguments into a tuple that is kept alive for the whole timespan of the
> call, whereas C just passes in the reference and forgets about it.
> 
> Since the method in question replaces references internally, it's quite
> possible that it somehow deletes the last reference to the object that was
> passed in. I wouldn't really know why, as we specifically guard against
> these things since somewhere around 0.17 (and comment #7 in the Sage ticket
> shows an example of that), but maybe this is just a corner case that we
> failed to handle so far, or maybe the Sage code is doing something
> 'unexpected' here.

To debug this further, I suggest stepping through the _get_object() method
with a watchpoint set on the reference count of the "owner" object (or
maybe others) to observe when it changes and if it drops down to zero at
some point during that call.

Stefan

___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


[Cython] Version of Cython packages in Ubuntu PPA

2013-04-25 Thread Stefan Behnel
Hi,

the packages in the Ubuntu PPA still have 0.18.0 in their name, although
they actually build the current master, which is at 0.19.

Is there a way to adapt that automatically?

Stefan
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel