Bug 13110

Summary: Async / Finish internal error
Product: gdb Reporter: Kevin Pouget <kevin.pouget>
Component: cliAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: kevin.pouget, pedro
Priority: P2    
Version: HEAD   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Kevin Pouget 2011-08-19 10:00:49 UTC
$ sleep 20 &
[1] 6159

gdb-master -nx
GNU gdb (GDB) 7.3.50.20110817-cvs
(gdb) set target-async on
(gdb) attach 6159
Attaching to process 6159

(gdb) up
#1  0x0000000000403c58 in ?? ()
(gdb) finish&
Run till exit from #1  0x0000000000403c58 in ?? ()

(gdb) add-inferior 
Added inferior 2
(gdb) inferior 2
[Switching to inferior 2 [process 0] (<noexec>)]

(gdb) /gdb/thread.c:663: internal-error: is_executing: Assertion `tp' failed.

----------

and the corresponding backtrace:

(gdb) where
...
#10 0x00000000005623b3 in is_executing (ptid=...) at /gdb/thread.c:663
#11 0x0000000000559c95 in fetch_inferior_event (client_data=<optimized out>) at /gdb/infrun.c:2750
#12 0x000000000056c539 in fetch_inferior_event_wrapper (client_data=<optimized out>)
    at /gdb/inf-loop.c:150
#13 0x00000000005650db in catch_errors (func=0x56c530 <fetch_inferior_event_wrapper>, func_args=0x0, errstring=0x7002e9 "", 
    mask=6) at /gdb/exceptions.c:517
#14 0x000000000056c5a4 in inferior_event_handler (event_type=<optimized out>, client_data=<optimized out>)
    at /gdb/inf-loop.c:53
#15 0x000000000056a2c8 in process_event () at /gdb/event-loop.c:402
#16 process_event () at /gdb/event-loop.c:352
#17 0x000000000056a9c4 in gdb_do_one_event () at /gdb/event-loop.c:454
...
Comment 1 Sourceware Commits 2011-09-05 15:46:39 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	palves@sourceware.org	2011-09-05 15:46:35

Modified files:
	gdb            : ChangeLog infrun.c 

Log message:
	2011-09-05  Pedro Alves  <pedro@codesourcery.com>
	
	PR cli/13110
	
	* infrun.c (fetch_inferior_event): Check if there's a selected
	thread before checking if the selected thread is executing.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.13302&r2=1.13303
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/infrun.c.diff?cvsroot=src&r1=1.502&r2=1.503
Comment 2 Pedro Alves 2011-09-05 15:58:10 UTC
Fixed.