[issue11321] 9th import of module _pickle always crashes

2011-07-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: Should be fixed now, thank you! -- resolution: -> fixed stage: -> committed/rejected status: open -> closed versions: -Python 3.1 ___ Python tracker ___

[issue11321] 9th import of module _pickle always crashes

2011-07-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1ae0b7b8de0b by Antoine Pitrou in branch '3.2': Issue #11321: Fix a crash with multiple imports of the _pickle module when http://hg.python.org/cpython/rev/1ae0b7b8de0b New changeset 6674272754da by Antoine Pitrou in branch 'default': Issue #11321:

[issue11321] 9th import of module _pickle always crashes

2011-03-24 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue11321] 9th import of module _pickle always crashes

2011-02-27 Thread Nick Coghlan
Nick Coghlan added the comment: Looking at the example of _struct.c, I'll withdraw my objection to the patch. The segfault is due to the attempt to destroy a statically allocated type object, and the only viable solution to that is to ensure the reference count never drops to 0, even during P

[issue11321] 9th import of module _pickle always crashes

2011-02-27 Thread Andreas Stührk
Andreas Stührk added the comment: That initial increase you can see happens because the module's dict is copied in `_PyImport_FixupExtensionUnicode()`. -- ___ Python tracker __

[issue11321] 9th import of module _pickle always crashes

2011-02-27 Thread Nick Coghlan
Nick Coghlan added the comment: While Andreas's patch does indeed prevent the crash, there is something more going on here. I modified his patch to print out the reference counts immediately after the new INCREF commands. With the INCREF commands commented out, it looks like this: ~/devel/p

[issue11321] 9th import of module _pickle always crashes

2011-02-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The patch looks good. It may also fix issue9197, which fails in a similar fashion -- nosy: +amaury.forgeotdarc ___ Python tracker ___ __

[issue11321] 9th import of module _pickle always crashes

2011-02-27 Thread Andreas Stührk
Andreas Stührk added the comment: It's because the _pickle module doesn't incref Pickler_Type and Unpickler_Type before calling `PyModule_AddObject()` (which steals a reference). The attached patch fixes the issue. -- keywords: +patch nosy: +Trundle Added file: http://bugs.python.org/

[issue11321] 9th import of module _pickle always crashes

2011-02-27 Thread Nick Coghlan
Nick Coghlan added the comment: Here's a sample stack trace of it blowing up: Program received signal SIGSEGV, Segmentation fault. 0x00479404 in type_dealloc (type=0x76a82f20) at Objects/typeobject.c:2523 2523_PyObject_GC_UNTRACK(type); (gdb) bt #0 0x00479404 in t

[issue11321] 9th import of module _pickle always crashes

2011-02-27 Thread Nick Coghlan
Nick Coghlan added the comment: I haven't worked out where the error is happening yet, but the 13 allocated static variables and the complete lack of a module cleanup function aren't going to be helping matters. -- ___ Python tracker

[issue11321] 9th import of module _pickle always crashes

2011-02-27 Thread Nick Coghlan
Nick Coghlan added the comment: I can definitely confirm that one: ~/devel/py3k$ gcc -I/usr/local/include/python3.3m -o issue11321 issue11321.c -L/usr/local/lib/python3.3 -lpython3.3m -lm -lpthread -ldl -lutil -rdynamic ~/devel/py3k$ ./issue11321 START Try import #0 ...SUCCESS Try import #1 ..

[issue11321] 9th import of module _pickle always crashes

2011-02-26 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +alexandre.vassalotti, brett.cannon, ncoghlan, pitrou ___ Python tracker ___ ___ Python-bugs-list ma

[issue11321] 9th import of module _pickle always crashes

2011-02-25 Thread Palm Kevin
Changes by Palm Kevin : -- versions: +Python 3.1 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue11321] 9th import of module _pickle always crashes

2011-02-25 Thread Palm Kevin
New submission from Palm Kevin : Please have a look to the following app: #include "Python.h" main(int argc, char **argv) { int i; printf("START\n"); for(i = 0; i < 20; i++){ Py_Initialize(); printf("Try import #%i ...", i); PyRun_SimpleString("import _pickle\n"); printf