gdb not stopping on breakpoint in a 32-bit program

Bug #1848200 reported by Miroslav Matějů
40
This bug affects 8 people
Affects Status Importance Assigned to Milestone
gdb (Ubuntu)
Fix Released
High
Unassigned
Bionic
Fix Released
High
dann frazier

Bug Description

[Impact]
After upgrading gdb from 8.1-0ubuntu3 to 8.1-0ubuntu3.1, gdb does not stop
on breakpoint when running a 32-bit application (on 64-bit Ubuntu).

[Test Case]
This can be reproduced with a simple “hello world” program:

$ cat hello.c
#include <stdio.h>
int main()
{
   // printf() displays the string inside quotation
   printf("Hello, World!");
   return 0;
}
$ gcc -ggdb -m32 hello.c
$ gdb a.out
(gdb) b hello.c:5
Breakpoint 1 at 0x536: file hello.c, line 5.
(gdb) run
Starting program: /home/user/sandbox/a.out
warning: Breakpoint address adjusted from 0xf7fd9be0 to 0xfffffffff7fd9be0.
warning: Breakpoint address adjusted from 0xf7fda195 to 0xfffffffff7fda195.
warning: Breakpoint address adjusted from 0xf7fdbd1c to 0xfffffffff7fdbd1c.
warning: Breakpoint address adjusted from 0xf7fdb924 to 0xfffffffff7fdb924.
warning: Breakpoint address adjusted from 0xf7fe99b3 to 0xfffffffff7fe99b3.
warning: Breakpoint address adjusted from 0xf7fea401 to 0xfffffffff7fea401.
warning: Breakpoint address adjusted from 0xf7fea706 to 0xfffffffff7fea706.

--- (and not stopping nor outputting the text…) ---

[Regression Risk]
Test case ran on arm64 and regression tested using the above test case on amd64, i386 and s390x.

This regression was fixed on the upstream gdb-8.1 branch within a few weeks of the breakage back in May 2018. Since then there have been no other fixes in this area on that branch, implying this fixed the issue and there were no further regressions discovered.

Revision history for this message
Miroslav Matějů (melebius) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gdb (Ubuntu):
status: New → Confirmed
Revision history for this message
Chistian Gagneraud (chgans) wrote :

We have this problem, here at work. This affect all developpers that keep their system up do date (18.04). We currently hold to the previous version.

Revision history for this message
Manoj Iyer (manjo) wrote :

This works in Eoan.

$ gdb /tmp/x
GNU gdb (Ubuntu 8.3-0ubuntu1) 8.3
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /tmp/x...
(gdb) b x.c:5
Breakpoint 1 at 0x11ea: file /tmp/x.c, line 5.
(gdb) run
Starting program: /tmp/x

Breakpoint 1, main () at /tmp/x.c:5
5 printf("Hello, World!");
(gdb) q
A debugging session is active.

 Inferior 1 [process 10723] will be killed.

Quit anyway? (y or n) y

dann frazier (dannf)
Changed in gdb (Ubuntu Focal):
status: Confirmed → Fix Released
Changed in gdb (Ubuntu Eoan):
status: New → Fix Released
Changed in gdb (Ubuntu Focal):
status: Fix Released → Invalid
Changed in gdb (Ubuntu Eoan):
status: Fix Released → Invalid
Revision history for this message
dann frazier (dannf) wrote :

I have a test fix building here, could one of you verify it?
https://launchpad.net/~dannf/+archive/ubuntu/lp1848200

Changed in gdb (Ubuntu Bionic):
status: New → In Progress
assignee: nobody → dann frazier (dannf)
Revision history for this message
Miroslav Matějů (melebius) wrote :

@dannf Thanks, it works for me from both command line and Qt Creator.

dann frazier (dannf)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gdb (Ubuntu Disco):
status: New → Confirmed
Revision history for this message
Frank Heimes (fheimes) wrote :

Tested gdb 8.1-0ubuntu3.2~ppa.1 from ppa:dannf/lp1848200 on s390x and it works fine.

ubuntu@hwe0002:~$ uname -a
Linux hwe0002 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:22:41 UTC 2019 s390x s390x s390x GNU/Linux
ubuntu@hwe0002:~$ gdb hello
GNU gdb (Ubuntu 8.1-0ubuntu3.2~ppa.1) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "s390x-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from hello...done.
(gdb) b hello.c:5
Breakpoint 1 at 0x740: file hello.c, line 5.
(gdb) run
Starting program: /home/ubuntu/hello

Breakpoint 1, main () at hello.c:5
5 printf("Hello, World!");
(gdb) quit

dann frazier (dannf)
description: updated
Changed in gdb (Ubuntu Disco):
status: Confirmed → New
Revision history for this message
dann frazier (dannf) wrote :

Unreproducible w/ >= disco versions, so marking them Invalid.

Changed in gdb (Ubuntu Disco):
status: New → Invalid
Revision history for this message
Kevin Puetz (puetzk) wrote :

@dannf Thanks, it works for on my x86 winelib program too (amd64 installation).

Robie Basak (racb)
tags: added: regression-update
Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Miroslav, or anyone else affected,

Accepted gdb into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gdb/8.1-0ubuntu3.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in gdb (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (gdb/8.1-0ubuntu3.2)

All autopkgtests for the newly accepted gdb (8.1-0ubuntu3.2) for bionic have finished running.
The following regressions have been reported in tests triggered by the package:

apport/2.20.9-0ubuntu7.8 (i386, amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/bionic/update_excuses.html#gdb

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Mathew Hodson (mhodson) wrote :
no longer affects: gdb (Ubuntu Disco)
no longer affects: gdb (Ubuntu Eoan)
no longer affects: gdb (Ubuntu Focal)
Changed in gdb (Ubuntu):
status: Invalid → Fix Released
Mathew Hodson (mhodson)
Changed in gdb (Ubuntu):
importance: Undecided → High
Changed in gdb (Ubuntu Bionic):
importance: Undecided → High
Revision history for this message
Miroslav Matějů (melebius) wrote :

I’ve tested version 8.1-0ubuntu3.2 from ubuntu-proposed on my Xubuntu 18.04.3 x86_64 from both the command line and Qt Creator and the problem has not appeared.

I am also setting verification-done because no other supported releases seem affected.

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
dann frazier (dannf) wrote : autopkgtest failure investigation

Stable Release Team,

I investigated the autopkgtest regression in Comment #12, and believe
it to not be a regression introduced by this gdb upload. apport has
been updated a couple of times via security since tests passed - and at
least one of those updates had known regressions. There is also a
false positive result due to an aspell SRU (see bug
1851542
). Apparently autopkgtests don't run on security uploads by
default, so autopkgtest.ubuntu.com doesn't have apples/apples test
results to compare (prev-gdb/prev-apport vs. prev-gdb/new-apport). I
therefore ran some tests manually.

In the attached logs you'll see that:
 - I am able to reproduce the same failures as the official
   autopkgtests for apport
 - The failures are the same with both the current gdb and the
   bionic-proposed gdb

Therefore, please allow gdb to promulgate to -updates.

 -dann

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdb - 8.1-0ubuntu3.2

---------------
gdb (8.1-0ubuntu3.2) bionic; urgency=medium

  * Fix 32-bit ARM tagged pointer support. Addresses a regression
    introduced in the previous version which broke breakpoint
    support in 32-bit programs. LP: #1848200.

 -- dann frazier <email address hidden> Wed, 30 Oct 2019 10:20:07 -0600

Changed in gdb (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for gdb has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Vladislav K. Valtchev (vvaltchev) wrote :

Thanks Miroslav for opening this bug, two weeks after me opening bug #1846557.
Unfortunately, it took proving that gdb couldn't debug properly _any_ 32-bit program, not just kernels running on QEMU, in order to get some attention. Honestly, I didn't even thought the bug could be _that_ bad and I didn't test that simple scenario. I just assumed it worked.

But, certainly, just a simple question from any maintainer about this use-case could have helped solving this bug much earlier and saving time to all the people it affected. I mean, it's not disappointing that it took one month to get a fix. If the bug affected only my scenario that would had been fine. It's disappointing that even if there was a single _small_ 100% guilty patch, in one month, bug #1846557 did not get a _single_ technical comment/question. We could have discovered this broader-scope bug much earlier. It's not about fixing any bug "right now" (bugs have priority). It's about at least talking with the reporter and don't underestimate the scope of the bug, even if it appears to be narrow. It might not be.

Revision history for this message
James Foster (ubuntu-a6a) wrote :

Will this have been fixed in "GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2"? I'm having similar problems and came across this report claiming that it is fixed in "8.1-0ubuntu3.2". I don't understand how the numbers work but assume that 9.2 has fixes that were in 8.1. If not, then that would explain my problem.

Revision history for this message
dann frazier (dannf) wrote :

@James: In theory it should be, but that code is from 2 different branches - and you may well be seeing a different issue. Please report a new bug.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.