New submission from STINNER Victor <[EMAIL PROTECTED]>:

"pyo" macro from gdbinit (see #3631) uses _PyObject_Dump() to display 
an object. This function calls (indirectly) string_print() to display 
one line of text. But if the GIL is released (I guess it's the GIL or 
is it called the "thread state"?), gdb crashs Python:

   object  : Fatal Python error: PyEval_SaveThread: NULL tstate
   Program received signal SIGABRT, Aborted.
   0xffffe410 in __kernel_vsyscall ()

Workaround: ensure GIL before Py_BEGIN_ALLOW_THREADS... That sounds 
ugly but it works :-) So I propose to enable it in debug mode (#ifdef 
Py_DEBUG) with a patch.

I guess that the issue is very specific to (gdb) debugging and should 
not affect normal usage of Python. That's why I choosed to enable it 
only in debug mode.

----------
components: Library (Lib)
files: string_print.patch
keywords: patch
messages: 71628
nosy: haypo
severity: normal
status: open
title: use string_print() in gdb
type: performance
versions: Python 2.6
Added file: http://bugs.python.org/file11192/string_print.patch

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3632>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to