segfault. which module to blame? (entire traceback)

Tim Peters tim.one at home.com
Fri Feb 16 14:31:27 EST 2001


[Dan Parisien]
> I write normal python dictionaries and strings to a shelve db. I also use
> locks (threading.Lock) to implement row-level locking in shelve. I've had
> segfaults before while coding normal python scripts.

That's a bug, then.  Did you report it?  I don't see segfaults while coding
normal Python scripts, so don't expect it to get fixed by magic.  There
don't appear to be any relevant bug reports from others open on SourceForge
either.

> I think it was the dictionaries because that's pretty much all I used.
> Could it be bad reference counting in those? I would have to read the
> code, but could there be a problem if two keys hashed to the same value
> in the dictionary and that one is deleted before the other or something
> similar?

While it's not impossible that dicts are screwing up, it's extremely
unlikely, because the dict code is very heavily used (don't forget that
Python uses dicts under the covers to manage your namespaces and sys.modules
and ... there is no Python program-- not even the one-liner "pass" --that
doesn't use dicts!).  So if dicts had refcount problems, it's almost certain
we'd be deluged with bug reports.  Because of the Birthday Paradox,
collisions aren't rare, so that code is heavily used too.

Try to come up with a minimal failing case, then open a bug on SourceForge.





More information about the Python-list mailing list