Ouch! The way that pointer is obtained is really weird (though I
believe it is a common idiom in Tcl extensions):
PyAggImagePhoto(ClientData clientdata, Tcl_Interp* interp,
int argc, char **argv) {
...
bboxo = (PyObject*)atol(argv[4]);
if (bboxo != Py_None) {
bbox = (Bbox*)bboxo;
That means the pointer comes to us encoded as a string of digits, which
gets converted to an integer, cast to a (PyObject*), and then cast to a
(Bbox*) (which is a subclass of PyObject, in the C-object-oriented
sense). That's just one of those things you'd rather not be doing ;)
Are you running the 64-bit version of OpenSUSE by any chance? That
might explain this if the atol call is overflowing. That's only
theoretical, as I think it *should* work. atol is supposed to return a
"long", which is supposed to be 64-bit on a 64-bit Linux machine. Could
you try replacing "atol" with "atoll", recompile and see what happens?
Do you get any warnings during compilation of _tkagg.cpp?
Failing that, it would be useful, I suppose, to print out "argv[4]" from
the debugger.
Thanks for helping with this. Hopefully we're honing in on something.
Mike
Malte Marquarding wrote:
> Hi,
>
> The segv also occurs in matplotlib-0.90.1. A clean build doesn't help.
>
> Here is the gdb output, looks like something is pointing into nirvana..
>
> (gdb) p bboxo
> $1 = <value optimized out>
> (gdb) p bbox
> $2 = (Bbox *) 0x7ffffffb
> (gdb) p bbox->_ll
> Cannot access memory at address 0x7ffffffb
>
> Cheers,
> Malte
>
> On 13/05/2008, at 10:19 PM, Michael Droettboom wrote:
>
>> p bboxo
>> p bbox
>> p bbox->_ll
>
>
>
>
>
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users