pnmimage crashes if x/y coodinate outside image

Bug #372254 reported by Hypnos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Panda3D
New
Undecided
Unassigned

Bug Description

crashes on: panda3d 1.6.1 on jaunty:

example code:
from pandac.PandaModules import *
i = PNMImage(256,256)
for x in xrange(1024):
  for y in xrange(1024):
    i.setXel(x,y,1)

can eighter segfault or "*** glibc detected *** python: malloc(): memory corruption: 0x0956cd70 ***", depending which values are written, in which order.

for some values it crashes for others it doesnt. it's really not predictable.

Revision history for this message
Treeform (starplant) wrote : Re: [Bug 372254] Re: pnmimage crashes if x/y coodinate outside image

I wonder what it should return instead? Should it wrap the image or
raise exception?

On Tue, Jun 2, 2009 at 12:06 AM, pro-rsoft <email address hidden> wrote:
> *** This bug is a duplicate of bug 372253 ***
>    https://bugs.launchpad.net/bugs/372253
>
> ** This bug has been marked a duplicate of bug 372253
>   pnmimage crashes if x/y coodinate outside image
>
> --
> pnmimage crashes if x/y coodinate outside image
> https://bugs.launchpad.net/bugs/372254
> You received this bug notification because you are subscribed to
> Panda3D.
>

Revision history for this message
Hypnos (rspoerri) wrote :

I'd make it raise a exception. It's bad that it sometimes goes
undetected and other times completely segfaults python.

on the other hand i've talked with pro-rsoft, he said pnmimage is
implemented to be as fast as possible. While adding a checking mechanism
in c/c++ would slow down the implementation where it needs to be fast,
it definately should be checked when accessing from python (if that's
possible).

Treeform wrote:
> *** This bug is a duplicate of bug 372253 ***
> https://bugs.launchpad.net/bugs/372253
>
> I wonder what it should return instead? Should it wrap the image or
> raise exception?
>
> On Tue, Jun 2, 2009 at 12:06 AM, pro-rsoft <email address hidden> wrote:
>
>> *** This bug is a duplicate of bug 372253 ***
>> https://bugs.launchpad.net/bugs/372253
>>
>> ** This bug has been marked a duplicate of bug 372253
>> pnmimage crashes if x/y coodinate outside image
>>
>> --
>> pnmimage crashes if x/y coodinate outside image
>> https://bugs.launchpad.net/bugs/372254
>> You received this bug notification because you are subscribed to
>> Panda3D.
>>
>>
>
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.