Issue1512695
Created on 2006-06-26 13:05 by faik, last changed 2006-07-03 23:46 by illume.
| File name |
Uploaded |
Description |
Edit |
Remove |
|
picklefault.py
|
faik,
2006-06-26 13:05
|
pickle.loads() segmentation faults. |
|
|
|
pickle-crash.diff
|
nnorwitz,
2006-06-28 06:09
|
v1 |
|
|
|
msg28920 - (view) |
Author: Faik Uygur (faik) |
Date: 2006-06-26 13:05 |
|
cPickle.loads() gives segmentation fault when
interrupted with keyboard (CTRL+C). Attached python
script tested with python version 2.4.3 and 2.5b1.
|
|
msg28921 - (view) |
Author: Faik Uygur (faik) |
Date: 2006-06-26 14:08 |
|
Logged In: YES
user_id=1541018
I tracked the seg. fault. It seg. faults in method
PyTuple_Pack(). When python receives the keyboard
interrupt:
o = va_arg(vargs, PyObject *);
Py_INCREF(o);
va_arg returns NULL, and Py_INCREF causes the seg.fault.
|
|
msg28922 - (view) |
Author: Faik Uygur (faik) |
Date: 2006-06-27 08:12 |
|
Logged In: YES
user_id=1541018
Back trace:
#0 PyTuple_Pack (n=0x3) at Objects/tupleobject.c:149
#1 0xa7b92024 in Instance_New (cls=0xa7bba064,
args=0xa7c1a43c)
at /var/tmp/pisi/python-2.4.3-14/work/Python-2.4.3/Modules/cPickle.c:3637
#2 0xa7b93798 in load (self=0xa7c0a80c)
at /var/tmp/pisi/python-2.4.3-14/work/Python-2.4.3/Modules/cPickle.c:4389
#3 0xa7b953c8 in cpm_loads (self=0x0, args=0x0)
at /var/tmp/pisi/python-2.4.3-14/work/Python-2.4.3/Modules/cPickle.c:5481
#4 0xa7ec4d97 in PyCFunction_Call (func=0xa7bc9b0c,
arg=0xa7bc9cec, kw=0x0) at Objects/methodobject.c:108
#5 0xa7efe3d8 in PyEval_EvalFrame (f=0x807e4bc) at
Python/ceval.c:3563
#6 0xa7f00bb3 in PyEval_EvalCodeEx (co=0xa7bbda60,
globals=0x0, locals=0x0, args=0xa7bbda60, argcount=0x0,
kws=0x0, kwcount=0x0, defs=0x0, defcount=0x0,
closure=0x0) at Python/ceval.c:2736
#7 0xa7f00e35 in PyEval_EvalCode (co=0x0, globals=0x0,
locals=0x0) at Python/ceval.c:484
#8 0xa7f1ba98 in run_node (n=0xa7bfbe18, filename=0x0,
globals=0x0, locals=0x0, flags=0x0) at
Python/pythonrun.c:1265
#9 0xa7f1ce28 in PyRun_SimpleFileExFlags (fp=0x804a008,
filename=0xaf9ab3b9 "picklefault.py", closeit=0x1,
flags=0xaf9aafe8) at Python/pythonrun.c:860
#10 0xa7f1d9aa in PyRun_AnyFileExFlags (fp=0x804a008,
filename=0xaf9ab3b9 "picklefault.py", closeit=0x1,
flags=0xaf9aafe8) at Python/pythonrun.c:664
#11 0xa7f238d0 in Py_Main (argc=0x1, argv=0xaf9aafe8) at
Modules/main.c:493
#12 0x0804867a in main (argc=0x0, argv=0x0) at
Modules/python.c:23
|
|
msg28923 - (view) |
Author: Neal Norwitz (nnorwitz) |
Date: 2006-06-28 06:09 |
|
Logged In: YES
user_id=33168
Faik, can you see if the attached patch fixes this problem.
I believe it should. I can't reproduce the problem with
the patch.
|
|
msg28924 - (view) |
Author: Neal Norwitz (nnorwitz) |
Date: 2006-06-28 06:39 |
|
Logged In: YES
user_id=33168
I'm impatient and think this fixes the problem. So I'm
closing this report. Please re-open if the patch didn't fix
your problem. (I checked in something slightly different
that the patch attached.)
Committed revision 47139.
Committed revision 47140. (2.4)
|
|
msg28925 - (view) |
Author: Rene Dudfield (illume) |
Date: 2006-06-30 00:59 |
|
Logged In: YES
user_id=2042
Py_INCREF should check for NULL with an assert.
All uses of va_arg should be checked to see if they return
NULL... and handle error codes!
|
|
msg28926 - (view) |
Author: Neal Norwitz (nnorwitz) |
Date: 2006-06-30 01:19 |
|
Logged In: YES
user_id=33168
Rene can you produce a patch to address any places you
believe there are problems? If you can't produce a patch,
at least a bug report with specific areas that are problems
would be helpful. Thanks.
|
|
msg28927 - (view) |
Author: Rene Dudfield (illume) |
Date: 2006-07-03 23:08 |
|
Logged In: YES
user_id=2042
Hello.
Relating to this bug, I think asserting not NULL in
Py_INCREF would have caught it.
Something like this?
// OLD.
#define Py_INCREF(op) ( \
_Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA \
(op)->ob_refcnt++)
// NEW.
#define Py_INCREF(op) ( \
assert((op) != NULL) \
_Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA \
(op)->ob_refcnt++)
Cheers.
|
|
msg28928 - (view) |
Author: Rene Dudfield (illume) |
Date: 2006-07-03 23:46 |
|
Logged In: YES
user_id=2042
Sorry... the last post was wrong.
This is the working one:
#define Py_INCREF(op) ( \
(assert((op) != NULL)) , \
_Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA \
(op)->ob_refcnt++)
|
|
| Date |
User |
Action |
Args |
| 2006-06-26 13:05:04 | faik | create | |
|