[Python-Dev] Disabling string interning for null and single-char causes segfaults (original) (raw)

Lukas Lueg lukas.lueg at gmail.com
Sat Mar 2 23:49:52 CET 2013


Debugging a refcount bug? Good. Out of the door, line on the left, one cross each.

2013/3/2 Stefan Bucur <stefan.bucur at gmail.com>

On Sat, Mar 2, 2013 at 4:31 PM, Antoine Pitrou <solipsis at pitrou.net> wrote: > On Fri, 1 Mar 2013 16:24:42 +0100 > Stefan Bucur <stefan.bucur at gmail.com> wrote: >> >> However, after applying this modification, when running "make test" I get a >> segfault in the test_all test case._ >> >> Before digging deeper into the issue, I wanted to ask here if there are any >> implicit assumptions about string identity and interning throughout the >> interpreter implementation. For instance, are two single-char strings >> having the same content supposed to be identical objects? > > From a language POV, no, but inside a specific interpreter such as > CPython it may be a reasonable expectation. > >> I'm assuming that it's either this, or some refcount bug in the interpreter >> that manifests only when certain strings are no longer interned and thus >> have a higher chance to get low refcount values. > > Indeed, if it's a real bug it would be nice to get it fixed :-)

By the way, in that case, what would be the best way to debug such type of ref count errors? I recently ran across this document [1], which kind of applies to debugging focused on newly introduced code. But when some changes potentially impact a good fraction of the interpreter, where should I look first? I'm asking since I re-ran the failing test with gdb, and the segfault seems to occur when invoking the kill() syscall, so the error seems to manifest at some later point than when the faulty code is executed. Stefan [1] http://www.python.org/doc/essays/refcnt/


Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/lukas.lueg%40gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20130302/8936720f/attachment.html>



More information about the Python-Dev mailing list