[oe-commits] org.oe.dreambox python-2.4.4: hack - add patch to display debug on gc fatal error

tmbinc commit openembedded-commits at lists.openembedded.org
Mon Dec 11 01:58:03 UTC 2006


python-2.4.4: hack - add patch to display debug on gc fatal error

Author: tmbinc at openembedded.org
Branch: org.openembedded.dreambox
Revision: 58fdda5da17a98945e7295b5485febb3a18a9d4a
ViewMTN: http://monotone.openembedded.org/revision.psp?id=58fdda5da17a98945e7295b5485febb3a18a9d4a
Files:
1
packages/python/python-2.4.4/gc_object_already_tracked_debug.patch
packages/python/python_2.4.4.bb
Diffs:

#
# mt diff -r485070092cf8b99d07a55fd1d7fc1afbe26ab1bb -r58fdda5da17a98945e7295b5485febb3a18a9d4a
#
# 
# 
# add_file "packages/python/python-2.4.4/gc_object_already_tracked_debug.patch"
#  content [3da7578e155b95ff0f4ed5dff0c3c74ce98f6054]
# 
# patch "packages/python/python_2.4.4.bb"
#  from [5b12a81568e51ef75c15e434947ac902e95bc0e8]
#    to [68f5b28a5b1e2a5d88472f59aaa46b527b63c404]
# 
============================================================
--- packages/python/python-2.4.4/gc_object_already_tracked_debug.patch	3da7578e155b95ff0f4ed5dff0c3c74ce98f6054
+++ packages/python/python-2.4.4/gc_object_already_tracked_debug.patch	3da7578e155b95ff0f4ed5dff0c3c74ce98f6054
@@ -0,0 +1,19 @@
+diff -Naur Python-2.4.4/Include/objimpl.h Python-2.4.4/Include/objimpl.h
+--- Python-2.4.4/Include/objimpl.h	2006-01-26 19:49:57.000000000 +0100
++++ Python-2.4.4/Include/objimpl.h	2006-12-11 00:41:31.000000000 +0100
+@@ -267,8 +267,13 @@
+  * collector it must be safe to call the ob_traverse method. */
+ #define _PyObject_GC_TRACK(o) do { \
+ 	PyGC_Head *g = _Py_AS_GC(o); \
+-	if (g->gc.gc_refs != _PyGC_REFS_UNTRACKED) \
+-		Py_FatalError("GC object already tracked"); \
++	if (g->gc.gc_refs != _PyGC_REFS_UNTRACKED) { \
++		PyObject *obj = (PyObject*)o; \
++		char bla[512]; \
++		snprintf(bla, 512, "GC object already tracked(gc_cnt %d, ob_refcnt %d, ob_type_ptr %p, ob_type '%s')", \
++			g->gc.gc_refs, obj->ob_refcnt, obj->ob_type, (obj->ob_type && obj->ob_type->tp_name) ? obj->ob_type->tp_name : "typeobject not valid"); \
++		Py_FatalError(bla); \
++	} \
+ 	g->gc.gc_refs = _PyGC_REFS_REACHABLE; \
+ 	g->gc.gc_next = _PyGC_generation0; \
+ 	g->gc.gc_prev = _PyGC_generation0->gc.gc_prev; \
============================================================
--- packages/python/python_2.4.4.bb	5b12a81568e51ef75c15e434947ac902e95bc0e8
+++ packages/python/python_2.4.4.bb	68f5b28a5b1e2a5d88472f59aaa46b527b63c404
@@ -12,7 +12,9 @@ SRC_URI = "http://www.python.org/ftp/pyt
 SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
            file://bindir-libdir.patch;patch=1 \
            file://crosscompile.patch;patch=1 \
-           file://fix-tkinter-detection.patch;patch=1"
+           file://fix-tkinter-detection.patch;patch=1 \
+           file://gc_object_already_tracked_debug.patch;patch=1"
+
 S = "${WORKDIR}/Python-${PV}"
 
 inherit autotools






More information about the Openembedded-commits mailing list