Bug 14635 - crash in python gdb during quit #2
Summary: crash in python gdb during quit #2
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: python (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 7.6
Assignee: Tom Tromey
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-27 17:31 UTC by Jan Kratochvil
Modified: 2012-10-15 15:37 UTC (History)
1 user (show)

See Also:
Host: i386-unknown-linux-gnu
Target: i386-unknown-linux-gnu
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kratochvil 2012-09-27 17:31:37 UTC
(gdb) bt
#0  0x082a78fd in salpy_dealloc (self=<gdb.Symtab_and_line at remote 0xf722f698>) at ./python/py-symtab.c:302
#1  0xf7522a69 in insertdict (mp=mp@entry=0xf72b035c, key=key@entry='sal', hash=-535590009, value=None) at /usr/src/debug/Python-2.7.3/Objects/dictobject.c:539
#2  0xf75250e9 in PyDict_SetItem (op=op@entry={'static_block': None, 'new_pc': None, 'static_symbols': None, 'sal': None, '__builtins__': <module at remote 0xf728011c>, 'symtab': <gdb.Symtab at remote 0xf722f6e0>, 'frame': <gdb.Frame at remote 0xf7227a10>, 'GdbRemoveReadlineFinder': <classobj at remote 0xf72111ac>, 'sym': <gdb.Symbol at remote 0xf722f788>, '__package__': None, 'sys': <module at remote 0xf72802e4>, 'global_symbols': ['func', 'main', 'qq'], 'gdb': <module at remote 0xf7212aac>, '__name__': '__main__', '__doc__': None, 'global_block': <gdb.Block at remote 0xf722f758>}, key='sal', value=None) at /usr/src/debug/Python-2.7.3/Objects/dictobject.c:784
#3  0xf7528f51 in _PyModule_Clear (m=<module at remote 0xf7280494>) at /usr/src/debug/Python-2.7.3/Objects/moduleobject.c:138
#4  0xf759762a in PyImport_Cleanup () at /usr/src/debug/Python-2.7.3/Python/import.c:445
#5  0xf75a3975 in Py_Finalize () at /usr/src/debug/Python-2.7.3/Python/pythonrun.c:454
#6  Py_Finalize () at /usr/src/debug/Python-2.7.3/Python/pythonrun.c:400
#7  0x08299ae3 in finalize_python (ignore=0x0) at ./python/python.c:1286
#8  0x082fa816 in do_my_cleanups (pmy_chain=0x93ba8cc <final_cleanup_chain>, old_chain=0x8b5cdd4 <sentinel_cleanup>) at cleanups.c:155
#9  0x082fa88c in do_final_cleanups (old_chain=0x8b5cdd4 <sentinel_cleanup>) at cleanups.c:186
#10 0x0844b352 in quit_target (arg=0xffc27318) at top.c:1304
#11 0x083648fb in catch_errors (func=0x844b2fb <quit_target>, func_args=0xffc27318, errstring=0x8ba93c0 "Quitting: ", mask=6) at exceptions.c:546
#12 0x0844b3ca in quit_force (args=0x0, from_tty=1) at top.c:1332
#13 0x0827a557 in quit_command (args=0x0, from_tty=1) at ./cli/cli-cmds.c:330
#14 0x08274c22 in do_cfunc (c=0x9cf7658, args=0x0, from_tty=1) at ./cli/cli-decode.c:114
#15 0x08277515 in cmd_func (cmd=0x9cf7658, args=0x0, from_tty=1) at ./cli/cli-decode.c:1846
#16 0x0844a1cb in execute_command (p=0x8b78ccc "", from_tty=1) at top.c:486
#17 0x0836dda2 in command_handler (command=0x0) at event-top.c:424
#18 0x0836df25 in command_line_handler (rl=0x0) at event-top.c:501
#19 0x08497e53 in rl_callback_read_char () at callback.c:220
#20 0x0836d983 in rl_callback_read_char_wrapper (client_data=0x0) at event-top.c:163
#21 0x0836dcfd in stdin_event_handler (error=0, client_data=0x0) at event-top.c:369
#22 0x0836cd55 in handle_file_event (data=...) at event-loop.c:827
#23 0x0836c34f in process_event () at event-loop.c:401
#24 0x0836c41e in gdb_do_one_event () at event-loop.c:465
#25 0x0836c470 in start_event_loop () at event-loop.c:490
#26 0x0836d9ac in cli_command_loop () at event-top.c:176
#27 0x08365a33 in current_interp_command_loop () at interps.c:332
#28 0x08366247 in captured_command_loop (data=0x0) at main.c:226
#29 0x083648fb in catch_errors (func=0x8366232 <captured_command_loop>, func_args=0x0, errstring=0x8b768af "", mask=6) at exceptions.c:546
#30 0x08367512 in captured_main (data=0xffc27790) at main.c:999
#31 0x083648fb in catch_errors (func=0x8366497 <captured_main>, func_args=0xffc27790, errstring=0x8b768af "", mask=6) at exceptions.c:546
#32 0x0836755e in gdb_main (args=0xffc27790) at main.c:1008
#33 0x080be13f in main (argc=5, argv=0xffc27844) at gdb.c:34
(gdb) frame
#0  0x082a78fd in salpy_dealloc (self=<gdb.Symtab_and_line at remote 0xf722f698>) at ./python/py-symtab.c:302
302	    set_objfile_data (self_sal->symtab->symtab->objfile,
(gdb) l
297	  sal_object *self_sal = (sal_object *) self;
298	
299	  if (self_sal->prev)
300	    self_sal->prev->next = self_sal->next;
301	  else if (self_sal->symtab != (symtab_object * ) Py_None)
302	    set_objfile_data (self_sal->symtab->symtab->objfile,
303			      salpy_objfile_data_key, self_sal->next);
304	
305	  if (self_sal->next)
306	    self_sal->next->prev = self_sal->prev;
(gdb) p self_sal->symtab
$2 = (symtab_object *) 0x0

/home/jkratoch/hammock/20120927Build-gdbcvs-gdbserver-f18/fedora-18-i386/build/src/gdb/testsuite.unix.-m32/core.26928
Comment 1 Tom Tromey 2012-09-27 19:57:11 UTC
Testing a fix.
Comment 2 Sourceware Commits 2012-10-15 15:23:52 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	tromey@sourceware.org	2012-10-15 15:23:47

Modified files:
	gdb            : ChangeLog 
	gdb/python     : py-symtab.c 
	gdb/testsuite  : ChangeLog 
	gdb/testsuite/gdb.python: py-symtab.exp 

Log message:
	PR python/14635:
	* python/py-symtab.c (del_objfile_sal): Set 'symtab' field
	to Py_None.
	testsuite
	* gdb.python/py-symtab.exp: Test sal and symtab destructors.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.14733&r2=1.14734
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/python/py-symtab.c.diff?cvsroot=src&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3411&r2=1.3412
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.python/py-symtab.exp.diff?cvsroot=src&r1=1.11&r2=1.12
Comment 3 Tom Tromey 2012-10-15 15:37:24 UTC
Fixed.