Bug 1176227 - gdb "run" command hangs
Summary: gdb "run" command hangs
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Kratochvil
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-19 18:28 UTC by Chris Jones
Modified: 2016-07-21 09:10 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-21 09:10:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Sourceware 20392 0 P2 NEW gdb "run" command hangs 2021-01-05 16:48:48 UTC

Description Chris Jones 2014-12-19 18:28:05 UTC
Description of problem:

The gdb "run" command hangs if it's invoked before the user has issued any resume-execution commands ("step", "continue", "stepi", etc.).

Version-Release number of selected component (if applicable):

$ gdb -v
GNU gdb (GDB) Fedora 7.8.1-30.fc21

How reproducible: 100%

Steps to Reproduce:
1. In one shell run |gdbserver --remote-debug :1111 `which ls`|
2. In another run |gdb `which ls`|
3. In the second shell, run |target extended-remote :1111| to connect to the gdbserver in the first shell
4. In the second shell, run |r| to "restart" the inferior

Actual results:

gdb hangs after the following protocol traffic is seen

getpkt ("vCont;c:p2e6.-1");  [no ack sent] 
putpkt ("$T0506:a0e5f*"7f0* ;07:b0e4f*"7f0* ;10:42e9ddf7ff7f0* ;thread:p2e6.2e6;core:3;#f0"); [noack mode]
getpkt ("g");  [no ack sent] 
putpkt ("$20e1fff7ff7f0* 20e1fff7ff7f0* a748dff7ff7f0*(d8020*@a0e5f*"7f0* b0e4f*"7f0* 67040*:b0ddf7ff7f0*!6020*(98d9fff7ff7f0*048e1fff7ff7f0* 48e1fff7ff7f0* 42e9ddf7ff7f0* 46020* 330*"2b0*}0*}0* 7f030*(f* 0*Hff0*2ff0*"242424242424242424242424242424240*"ff0*2f* 0*2ff0**ff0*}0*}0*}0*o801f0* f*,0*}0*}0*}0*}0*}0*7#35"); [noack mode]
getpkt ("G[snip]");  [no ack sent] 
putpkt ("$OK#9a"); [noack mode]
getpkt ("m7ffff7dde941,1");  [no ack sent] 
putpkt ("$90#69"); [noack mode]
getpkt ("m7ffff7dde941,1");  [no ack sent] 
putpkt ("$90#69"); [noack mode]

What this traffic says is that the inferior hits an "internal" gdb breakpoint (one set by gdb itself, not the user), and then gdb queries the memory at that breakpoint address, but then doesn't resume execution of the inferior (for whatever reason).  So the user-visible result is a "hang".

Expected results:

Execution is restarted normally.  A workaround is to follow the steps above, but just before step (4), issue a "stepi" command.  With that extra step, the "run" command works as expected.

Additional info:

I happily concede that this is an edge-case bug for normal gdb users.  However, this bug bites the rr tool[1] quite hard.  Indeed, I found this bug by running the rr regression tests on a fedora 21 installation.  We have a gross workaround[2] in hand, but we would like to disabuse ourselves of it at some point.

[1] http://rr-project.org/
[2] https://github.com/mozilla/rr/pull/1406

Comment 1 Jaroslav Reznik 2015-03-03 16:38:27 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 2 Fedora End Of Life 2016-07-19 12:34:00 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 3 Jan Kratochvil 2016-07-21 09:07:57 UTC
Confirmed:
FAIL: gdb-7.11.1-75.fc24.x86_64
FAIL: GNU gdb (GDB) 7.11.50.20160720-git


Note You need to log in before you can comment on or make changes to this bug.