Compilation problems - bizzare

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Compilation problems - bizzare

Thomas Hrabe-2
Compilation problems - bizzare

Hi all,

currently, I am writing a box of modular functions for exchanging python & matlab objects (nd arrays in particular).
I am facing an odd problem which I can not explain to myself:

I use
PyArg_ParseTuple(args, "O!s",&PyArray_Type, &array,&na)
for parsing the array and a string.
This function call works perfectly well when called from a static function used for extending python.
However, using the call above in another function encapsulating the call above yields a segmentation fault -> python crash -> anger , irritation ... : )
Same with
PyArray_FromDimsAndData(dimensions,size,(const char)p.first,(char*)value)

Did somebody ever encounter this?

By the way, I get a compilation warning
/home/global/python32/lib/python2.4/site-packages/numpy/core/include/numpy/__multiarray_api.h:944: warning: 'int _import_array()' defined but not used

Thank you in advance for your help,
Thomas


_______________________________________________
Numpy-discussion mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Compilation problems - bizzare

Robert Kern-2
On Mon, May 5, 2008 at 6:33 PM, Thomas Hrabe <[hidden email]> wrote:

>
> Hi all,
>
>  currently, I am writing a box of modular functions for exchanging python &
> matlab objects (nd arrays in particular).
>  I am facing an odd problem which I can not explain to myself:
>
>  I use
>  PyArg_ParseTuple(args, "O!s",&PyArray_Type, &array,&na)
>  for parsing the array and a string.
>  This function call works perfectly well when called from a static function
> used for extending python.
>  However, using the call above in another function encapsulating the call
> above yields a segmentation fault -> python crash -> anger , irritation ...
> : )
>  Same with
>  PyArray_FromDimsAndData(dimensions,size,(const char)p.first,(char*)value)
>
>  Did somebody ever encounter this?

I haven't. Can you run this under a debugger to give us a backtrace at
the site of the crash?

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco
_______________________________________________
Numpy-discussion mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Reply | Threaded
Open this post in threaded view
|

Re: Compilation problems - bizzare

Charles R Harris
In reply to this post by Thomas Hrabe-2


On Mon, May 5, 2008 at 5:33 PM, Thomas Hrabe <[hidden email]> wrote:

Hi all,

currently, I am writing a box of modular functions for exchanging python & matlab objects (nd arrays in particular).
I am facing an odd problem which I can not explain to myself:

I use
PyArg_ParseTuple(args, "O!s",&PyArray_Type, &array,&na)
for parsing the array and a string.
This function call works perfectly well when called from a static function used for extending python.
However, using the call above in another function encapsulating the call above yields a segmentation fault -> python crash -> anger , irritation ... : )
Same with
PyArray_FromDimsAndData(dimensions,size,(const char)p.first,(char*)value)

Did somebody ever encounter this?

By the way, I get a compilation warning
/home/global/python32/lib/python2.4/site-packages/numpy/core/include/numpy/__multiarray_api.h:944: warning: 'int _import_array()' defined but not used

Thank you in advance for your help,
Thomas


Could you attach a code snippet that reproduces the problem? What version of numpy are you using?

Chuck


_______________________________________________
Numpy-discussion mailing list
[hidden email]
http://projects.scipy.org/mailman/listinfo/numpy-discussion