[Pyrex] [Cython-dev] Segmentation Fault with -O0

Samuele Kaplun Samuele.Kaplun at cern.ch
Thu Aug 9 18:58:39 CEST 2007


In data giovedì 09 agosto 2007, Stefan Behnel scribacchiaste dette parole:
> Samuele Kaplun wrote:
> >> When I compile everything without optimization (-O0) it always crashes
> >> after exiting from __new__.
> >> I tried to selectively commenting-out the code and I found that the
> >> incriminated row is:
> >> 		PyObject_AsReadBuffer(tmp, &buf, &size)
> >> But I really don't know why.
> >> The most interesting thing, is that it never segfaults when compiled
> >> with -02 or -03.
> >> If checked this with latest Cython & Pyrex and I obtain the same
> >> behaviour.
> >
> > Some additional information: I run the tests with gcc-3.4.6, 4.1.2 and
> > 4.2.0, with the same behaviour (crash with -O0, -O, no crash with -O2,
> > -O3), on an amd64 machine and Python 2.5. It never crash on gcc-3.x on
> > 32bits.
>
> How did you declare the function? Did you use Py_ssize_t for the size
> parameter?
>
> Stefan

Dear Stefan
I used "int" taking it from the Python doc on 
http://docs.python.org/api/abstract-buffer.html
I will test with Py_ssize_t.
Best regards,
	Samuele

-- 
.O.
..O
OOO



More information about the Pyrex mailing list