Problem with (KeyboardInterrupt and wdb

Patrick Dussud (dussud%aspen@lucid.com)
Wed, 8 Apr 92 08:55:35 PDT

Here is a problem that I found:
python dumps core if I use wdb and type ^C:

aspen% python
Python 0.9.6 (>= 1 Jan 1992).
Copyright 1990, 1991, 1992 Stichting Mathematisch Centrum, Amsterdam
>>> import sys
>>> sys.path.append ('../demo/scripts')
>>> import wdb
>>> wdb.run ('import pi')
31415926535897932384626433832Segmentation fault (core dumped)

^C right here

Below is what I found out under gdb:

Program received signal 11, Segmentation fault
Reading symbols from ceval.c...done.
eval_code (co=(codeobject *) 0xa61f0, globals=(struct _object *) 0xa3df0, locals=(struct _object *) 0xe3aa0, arg=(struct _object *) 0xe3a60) (ceval.c:778)
(gdb) p w
$1 = (struct _object *) 0x0
(gdb) info loc
ticker = 94
next_instr = (unsigned char *) 0xa5cab "Z\002"
opcode = 92
oparg = 1
stack_pointer = (struct _object **) 0xe4884
why = WHY_NOT
err = 0
x = (struct _object *) 0x7f528
v = (struct _object *) 0xe3d80
w = (struct _object *) 0x0
u = (struct _object *) 0x0
t = (struct _object *) 0x7f528
f = (struct _frame *) 0xe4820
trace = (struct _object *) 0x0
retval = (struct _object *) 0xa3248
name = (char *) 0xc28cc "stopframe"
fp = (struct _iobuf *) 0x1a
(gdb) bt
#0 eval_code (co=(codeobject *) 0xa61f0, globals=(struct _object *) 0xa3df0, locals=(struct _object *) 0xe3aa0, arg=(struct _object *) 0xe3a60) (ceval.c:778)
#1 call_function (func=(struct _object *) 0xcd4e0, arg=(struct _object *) 0xe3a60) (ceval.c:1689)
#2 call_object (func=(struct _object *) 0xe3980, arg=(struct _object *) 0xe3a20) (ceval.c:1589)
#3 eval_code (co=(codeobject *) 0xc2680, globals=(struct _object *) 0xc1060, locals=(struct _object *) 0xe43e0, arg=(struct _object *) 0xe43a0) (ceval.c:385)
#4 call_function (func=(struct _object *) 0xc9e40, arg=(struct _object *) 0xe43a0) (ceval.c:1689)
#5 call_object (func=(struct _object *) 0xe3be0, arg=(struct _object *) 0xe3ec0) (ceval.c:1589)
#6 eval_code (co=(codeobject *) 0xbca60, globals=(struct _object *) 0xc1060, locals=(struct _object *) 0xe3e80, arg=(struct _object *) 0xe3e40) (ceval.c:385)
#7 call_function (func=(struct _object *) 0xc9e20, arg=(struct _object *) 0xe3e40) (ceval.c:1689)
#8 call_object (func=(struct _object *) 0xe3f60, arg=(struct _object *) 0xe3dc0) (ceval.c:1589)
#9 call_trace (p_trace=(struct _object **) 0xf7fff024, p_newtrace=(struct _object **) 0xf7fff024, f=(struct _frame *) 0xd6260, msg=(char *) 0x7acb4 "exception", arg=(struct _object *) 0xe3d80) (ceval.c:1247)
#10 call_exc_trace (p_trace=(struct _object **) 0xf7fff024, p_newtrace=(struct _object **) 0xf7fff024, f=(struct _frame *) 0xd6260) (ceval.c:1199)
#11 eval_code (co=(codeobject *) 0xd4ac0, globals=(struct _object *) 0x9a770, locals=(struct _object *) 0x9a770, arg=(struct _object *) 0x0) (ceval.c:1066)
#12 eval_node ()
#13 run_err_node ()
#14 run_string ()
#15 exec_eval ()
#16 builtin_exec ()
#17 call_builtin (func=(struct _object *) 0x98ff0, arg=(struct _object *) 0xd45c0) (ceval.c:1609)
#18 call_object (func=(struct _object *) 0x98ff0, arg=(struct _object *) 0xd45c0) (ceval.c:1591)
#19 eval_code (co=(codeobject *) 0xc7560, globals=(struct _object *) 0xc1060, locals=(struct _object *) 0xd5720, arg=(struct _object *) 0xd56e0) (ceval.c:385)
#20 call_function (func=(struct _object *) 0xca020, arg=(struct _object *) 0xd56e0) (ceval.c:1689)
#21 call_object (func=(struct _object *) 0xd5540, arg=(struct _object *) 0xd5640) (ceval.c:1589)
#22 eval_code (co=(codeobject *) 0xc7040, globals=(struct _object *) 0xc1060, locals=(struct _object *) 0xd5600, arg=(struct _object *) 0xd55c0) (ceval.c:385)
#23 call_function (func=(struct _object *) 0xca000, arg=(struct _object *) 0xd55c0) (ceval.c:1689)
#24 call_object (func=(struct _object *) 0xd4e40, arg=(struct _object *) 0xd4e60) (ceval.c:1589)
#25 eval_code (co=(codeobject *) 0xac050, globals=(struct _object *) 0xa3df0, locals=(struct _object *) 0xd5260, arg=(struct _object *) 0xd5220) (ceval.c:385)
#26 call_function (func=(struct _object *) 0xcaa80, arg=(struct _object *) 0xd5220) (ceval.c:1689)
#27 call_object (func=(struct _object *) 0xcaa80, arg=(struct _object *) 0xd5220) (ceval.c:1589)
#28 eval_code (co=(codeobject *) 0xd4800, globals=(struct _object *) 0x9a770, locals=(struct _object *) 0x9a770, arg=(struct _object *) 0x0) (ceval.c:385)
#29 eval_node ()
#30 run_tty_1 ()
#31 run_tty_loop ()
#32 main ()
(gdb) p *(tupleobject*)v
$6 = {ob_refcnt = 10, ob_type = 0x804f8, ob_size = 3, ob_item = {0x99430}}

(gdb) p ((tupleobject*)v)->ob_item[0]
$8 = (struct _object *) 0x99430
(gdb) p ((tupleobject*)v)->ob_item[1]
$9 = (struct _object *) 0x0

ob_item [1] is 0 so w becomes 0

(gdb) p ((tupleobject*)v)->ob_item[2]
$10 = (struct _object *) 0xe3d40