You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Embedded python crashed on 4th run, if "ctypes" is used #51118
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/theller'closed_at=<Date2010-08-08.18:29:31.227>created_at=<Date2009-09-09.08:31:13.900>labels= ['ctypes', 'type-crash']
title='Embedded python crashed on 4th run, if "ctypes" is used'updated_at=<Date2010-09-12.16:20:38.048>user='https://bugs.python.org/warlock'
When embedding python from C, and importing "ctypes" module in embedded
script, it always crashes on Py_Finalize() on 4th cycle.
Tested with both PyRun_SimpleString(...) and PyRun_String(...).
Platform: Windows XP
IDE's: LabWindows/CVI 8.5 and Code::Blocks/gcc
Activity
warlock commentedon Sep 9, 2009
When embedding python from C, and importing "ctypes" module in embedded
script, it always crashes on Py_Finalize() on 4th cycle.
Tested with both PyRun_SimpleString(...) and PyRun_String(...).
Platform: Windows XP
IDE's: LabWindows/CVI 8.5 and Code::Blocks/gcc
Code:
--------------------------
Output:
--------------------------------
--- 0 ---
--- 1 ---
--- 2 ---
--- 3 ---
Process returned -1073741819 (0xC0000005) execution time : 3.109 s
Press any key to continue.
--------------------------------
warlock commentedon Sep 9, 2009
mkp commentedon Sep 12, 2009
on python2.5 / mac os x 10.5.7:
--- 1 ---
--- 2 ---
--- 3 ---
Assertion failed: (type->tp_flags & Py_TPFLAGS_HEAPTYPE), function
type_dealloc, file Objects/typeobject.c, line 2148.
Abort trap
$ uname -mprsv
Darwin 9.7.0 Darwin Kernel Version 9.7.0: Tue Mar 31 22:52:17 PDT 2009;
root:xnu-1228.12.14~1/RELEASE_I386 i386 i386
ocean-city commentedon Sep 20, 2009
I hope attached patch will fix this issue.
niklutzgmailcom commentedon Apr 5, 2010
I can confirm that the patch fix this issue. I adapted the patch (variable names changed):
5523a5524
5529a5531
5535a5538
5541a5545
5547a5552
5553a5559
Platform: Linux (kubuntu 9.10 x64)
Python: 2.6.4-0ubuntu3
theller commentedon Aug 8, 2010
Fixed in rev 83841 (py3k), rev 83842 (release31-maint), and rev 83843 (release27-maint).
Thanks for the patch.
ocean-city commentedon Sep 12, 2010
I found another refcount bug in Python3.x.
Fixed in r84741(py3k), r84742(release31-maint).