[Patch] crashes on amd64

Bug #624365 reported by Steven Robertson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fractal Fr0st
Fix Released
Undecided
Unassigned

Bug Description

RenderStats wasn't filled in, but ctypes didn't complain. On AMD64 architectures, the alignment is such that the pointer returned by ctypes plus the offset to the 'render_seconds' field sat on top of some other Python object on the heap. When the render time exceeded 0 seconds, a positive value would be written to the field, sending the GC into a tailspin.

Neat.

=== modified file 'fr0stlib/pyflam3/_flam3.py'
--- fr0stlib/pyflam3/_flam3.py 2010-04-24 04:07:42 +0000
+++ fr0stlib/pyflam3/_flam3.py 2010-08-26 00:44:34 +0000
@@ -51,7 +51,11 @@

 class BaseImageComments(Structure): pass

-class RenderStats(Structure): pass
+class RenderStats(Structure):
+ _fields_ = [ ('badvals', c_double)
+ , ('num_iters', c_long)
+ , ('render_seconds', c_int)
+ ]

 class ImageStore(Structure): pass

Changed in fr0st:
status: New → Fix Released
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.