rjmcguire / python-on-a-chip

Automatically exported from code.google.com/p/python-on-a-chip
Other
0 stars 0 forks source link

Fix uninitialized pointer that causes segfault #186

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Oscar submitted a use-case on 2011/02/12 that shall remain private, but it 
exposes a segfault.

Original issue reported on code.google.com by dwhall...@gmail.com on 13 Feb 2011 at 2:36

GoogleCodeExporter commented 9 years ago
Cause: in class_method() a chunk is allocated for the method, some fields are 
set, but not m_attrs.  Then another chunk is allocated for the attributes dict. 
 If this allocation triggers a GC, then when the GC marks the method, it 
follows an invalid pointer in m_attrs.

Fix: after the first allocation, set m_attrs to C_NULL.

Original comment by dwhall...@gmail.com on 13 Feb 2011 at 2:39

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 8a04ec2d37.

Original comment by dwhall...@gmail.com on 13 Feb 2011 at 2:44

GoogleCodeExporter commented 9 years ago
This issue was too tricky to recreate for a unit test.

Original comment by dwhall...@gmail.com on 13 Feb 2011 at 2:46

GoogleCodeExporter commented 9 years ago
There are other instance similar to this defect.  Found and fixed them.

Original comment by dwhall...@gmail.com on 13 Feb 2011 at 3:51

GoogleCodeExporter commented 9 years ago
see rd0b02cbdd4

Original comment by dwhall...@gmail.com on 13 Feb 2011 at 3:53