[Bug 2041396] [NEW] gdb 12.1 generates SIGILL on armhf
Zixing Liu
2041396 at bugs.launchpad.net
Thu Oct 26 18:29:55 UTC 2023
Public bug reported:
GDB 12.1 had a regression where it will break program execution when the
program contains mixed ARM code and THUMB code.
Considering the following C program:
```
__attribute__((target("arm"), noinline))
int thumb_func() {
return 42;
}
__attribute__((target("thumb")))
int main() { return thumb_func(); }
```
If you build it using `gcc repro.c -ggdb3 -Og -o repro` and run the GDB
using the following commands:
```
b 3
r
c
```
(you can save it to a file and run GDB using `gdb -x script ./repro`)
You will notice GDB broke the program and threw SIGILL.
If you run the program without GDB, the program exits normally.
This bug has been fixed in GDB 13, but the fix was never backported to
GDB 12. You can find the upstream bug in the remote bug watch.
** Affects: gdb
Importance: Unknown
Status: Unknown
** Affects: gdb (Ubuntu)
Importance: Undecided
Status: New
** Bug watch added: Sourceware.org Bugzilla #29272
https://sourceware.org/bugzilla/show_bug.cgi?id=29272
** Also affects: gdb (Debian) via
https://sourceware.org/bugzilla/show_bug.cgi?id=29272
Importance: Unknown
Status: Unknown
** Package changed: gdb (Debian) => gdb
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gdb in Ubuntu.
https://bugs.launchpad.net/bugs/2041396
Title:
gdb 12.1 generates SIGILL on armhf
Status in gdb:
Unknown
Status in gdb package in Ubuntu:
New
Bug description:
GDB 12.1 had a regression where it will break program execution when
the program contains mixed ARM code and THUMB code.
Considering the following C program:
```
__attribute__((target("arm"), noinline))
int thumb_func() {
return 42;
}
__attribute__((target("thumb")))
int main() { return thumb_func(); }
```
If you build it using `gcc repro.c -ggdb3 -Og -o repro` and run the
GDB using the following commands:
```
b 3
r
c
```
(you can save it to a file and run GDB using `gdb -x script ./repro`)
You will notice GDB broke the program and threw SIGILL.
If you run the program without GDB, the program exits normally.
This bug has been fixed in GDB 13, but the fix was never backported to
GDB 12. You can find the upstream bug in the remote bug watch.
To manage notifications about this bug go to:
https://bugs.launchpad.net/gdb/+bug/2041396/+subscriptions
More information about the foundations-bugs
mailing list