#2205 closed defect (fixed)
imageObj.getBytes() is severely broken
Reported by: | hobu | Owned by: | sdlime |
---|---|---|---|
Priority: | normal | Milestone: | 5.0 release |
Component: | MapServer C Library | Version: | svn-trunk (development) |
Severity: | normal | Keywords: | |
Cc: |
Description
Attempting to do imageObj.getBytes() results in a segfault. imageObj.save() works fine and as expected.
Here's some gdb output:
#0 0x0054a4b8 in gdImageInterlace (im=0x0, interlaceArg=1) at gd.c:3199 #1 0x010ca4e1 in msSaveImageBufferGD (img=0x0, size_ptr=0xbffff320, format=0x311b60) at mapgd.c:3663 #2 0x0101c972 in _wrap_imageObj_getBytes (self=0x0, args=0x4cabf0) at mapscript_wrap.c:4608 #3 0x97eb67fe in PyObject_Call () #4 0x97f07450 in _PyEval_SliceIndex () #5 0x97f08a98 in PyEval_EvalCodeEx () #6 0x97f06f6d in _PyEval_SliceIndex () #7 0x97f06eac in _PyEval_SliceIndex () #8 0x97f08a98 in PyEval_EvalCodeEx () #9 0x97f08bbb in PyEval_EvalCode () #10 0x97f21dc5 in PyErr_Display () #11 0x97f2395a in PyRun_SimpleFileExFlags () #12 0x97f2b42b in Py_Main () #13 0x00001f8e in start () (gdb) f 1 #1 0x010ca4e1 in msSaveImageBufferGD (img=0x0, size_ptr=0xbffff320, format=0x311b60) at mapgd.c:3663 3663 gdImageInterlace(img, 1); (gdb) p img $1 = (gdImagePtr) 0x0 (gdb) f 2 #2 0x0101c972 in _wrap_imageObj_getBytes (self=0x0, args=0x4cabf0) at mapscript_wrap.c:4608 4608 buffer.data = msSaveImageBufferGD(self->img.gd, &buffer.size, (gdb) arg1 Undefined command: "arg1". Try "help". (gdb) p arg1 $2 = (imageObj *) 0x337570 (gdb) p arg1->format $3 = (outputFormatObj *) 0x311b60 (gdb) p *(arg1->format) $4 = { name = 0x312240 "png", mimetype = 0x3122b0 "image/png", driver = 0x311b90 "GD/PNG", extension = 0x311b40 "png", renderer = 1, imagemode = 0, transparent = 0, bands = 1, numformatoptions = 0, formatoptions = 0x0, refcount = 3, inmapfile = 1 } (gdb) p *(arg1->img) Attempt to take contents of a non-pointer value. (gdb) p *(arg1->) A parse error in expression, near `)'. (gdb) p *(arg1) $5 = { width = 400, height = 400, imagepath = 0x337540 "", imageurl = 0x337550 "", format = 0x311b60, renderer = 0, size = 0, img = { gd = 0x0, svg = 0x0, imagemap = 0x0, raw_16bit = 0x0, raw_float = 0x0, raw_byte = 0x0 } }
As you can see the img->img and img->img.gd seem to be getting zero'd out somehow. Any ideas? This worked fine in 4.10. I am using swig 1.3.31, and I tried rolling back to swig 1.3.29, but the same problem happened in the same way.
Change History (6)
comment:1 by , 17 years ago
comment:3 by , 17 years ago
comment:5 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
r6463 is related, and makes getBytes use msSaveImageBufferAGG for AGG-formated stuff
comment:6 by , 17 years ago
r6468 makes imageextra field non condition to avoid this problem occuring in other contexts where the USE_AGG might not be properly available.
Note:
See TracTickets
for help on using tickets.
I rolled back to r5714 and things work. The graticule data is in #2202