corefiles not created in armhf chroot on arm64 porter

Bug #1645501 reported by Brian Murray
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gdb (Ubuntu)
Fix Released
High
Brian Murray
Precise
Invalid
Medium
Unassigned
Trusty
Triaged
Medium
Brian Murray
Xenial
Triaged
Medium
Brian Murray
Yakkety
Fix Released
Medium
Brian Murray

Bug Description

Impact
------
Its not possible to create a corefile in an armhf chroot on an arm64 system.

Test Case
---------
On an arm64 system enter an armhf chroot, then
1) execute "gdb --args cat"
2) in gdb type run
3) press Ctrl-Z
4) generate-core-file /tmp/my.core

With the current version of gdb you'll see "Unable to fetch floating point registers.", with the version in -proposed you'll see "Saved corefile".

Regression Potential
--------------------
The corefiles aren't created at all in this scenario so things should improve.

I'm filing this about gdb per Steve's suggestion, although this could be an issue somewhere else.

I recently discovered that the apport-test-crash (https://code.launchpad.net/~daisy-pluckers/error-tracker-deployment/test-crashes) crash files produced for armhf are crash files without CoreDumps. This happened sometime between 20160531 and 20161025. I've recreated this on the porter-arm64 box with the following minimal test case (generate-sigsegv-crash.py is from apport-test-crashes):

schroot -c yakkety-armhf
python generate-sigsegv-crash.py cat

Running this on both armhf and arm64 we can see the following different output.

armhf chroot on porter-armhf:

  47 Program received signal SIGSEGV, Segmentation fault.
  48 0xb6f599e4 in read () at ../sysdeps/unix/syscall-template.S:84
  49 84 ../sysdeps/unix/syscall-template.S: No such file or directory.
  50 (gdb) Saved corefile /tmp/tmp840s08i1/my.core

armhf chroot on porter-arm64:

  47 Program received signal SIGSEGV, Segmentation fault.
  48 0xf772f9e4 in read () at ../sysdeps/unix/syscall-template.S:84
  49 84 ../sysdeps/unix/syscall-template.S: No such file or directory.
  50 (gdb) Unable to fetch the floating point registers.: Invalid argument.

Notice how there is no core file save on porter-arm64.

Revision history for this message
Brian Murray (brian-murray) wrote :

I was using the following version of gdb in both chroots:

GNU gdb (Ubuntu 7.11.90.20161005-0ubuntu1) 7.11.90.20161005-git

Revision history for this message
Brian Murray (brian-murray) wrote :

Manually running cat in gdb and executing the same commands as found in generate-sigsegv-crash.py had the following results:

(yakkety-armhf)brian@rugby:~$ gdb --args cat
GNU gdb (Ubuntu 7.11.90.20161005-0ubuntu1) 7.11.90.20161005-git
Copyright (C) 2016 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 "arm-linux-gnueabihf".
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 cat...(no debugging symbols found)...done.
(gdb) run
Starting program: /bin/cat
Cannot parse expression `.L954 4@r4'.
warning: Probes-based dynamic linker interface failed.
Reverting to original interface.

Program received signal SIGSEGV, Segmentation fault.
0xf772f9e4 in read () at ../sysdeps/unix/syscall-template.S:84
84 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) generate-core-file /tmp/my.core
Unable to fetch the floating point registers.: Invalid argument.

Revision history for this message
Brian Murray (brian-murray) wrote :

I thought this might be https://bugzilla.redhat.com/show_bug.cgi?id=1196181 but we seem to have the related patches in yakkety.

Revision history for this message
Brian Murray (brian-murray) wrote :

The issue also occurs in a zesty chroot:

brian@rugby:~$ schroot -c zesty-armhf
(zesty-armhf)brian@rugby:~$ sudo apt-get install screen
sudo: main: unable to allocate memory
(zesty-armhf)brian@rugby:~$ gdb
GNU gdb (Ubuntu 7.12-0ubuntu2) 7.12
Copyright (C) 2016 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 "arm-linux-gnueabihf".
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".
(gdb) quit
(zesty-armhf)brian@rugby:~$ gdb --args cat
GNU gdb (Ubuntu 7.12-0ubuntu2) 7.12
Copyright (C) 2016 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 "arm-linux-gnueabihf".
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 cat...(no debugging symbols found)...done.
(gdb) run
Starting program: /bin/cat
Cannot parse expression `.L954 4@r4'.
warning: Probes-based dynamic linker interface failed.
Reverting to original interface.

^Z
Program received signal SIGTSTP, Stopped (user).
0xf7763b74 in read () at ../sysdeps/unix/syscall-template.S:84
84 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) generate-core-file /tmp/my.core
Unable to fetch the floating point registers.: Invalid argument.

Revision history for this message
Kees Cook (kees) wrote :

ptrace(PTRACE_GETREGSET, 27642, NT_FPREGSET, 0xffcc67f0) = -1 EINVAL (Invalid argument)

NT_FPREGSET is "2", which the kernel calls NT_PRFPREG.

arm64 kernels don't implement this for compat processes, they only support NT_ARM_VFP. If I understand correctly, VFP is hard float, so it seems like this is a bug in gdb: it should only ask for NT_ARM_VFP, not NT_PRFPREG.

If I'm mistaken, then the kernel is missing support for compat tasks to issue NT_PRFPREG requests...

Revision history for this message
Brian Murray (brian-murray) wrote :

Kees provided me the following debdiffs for testing on zesty and yakkety armhf chroots.

Revision history for this message
Brian Murray (brian-murray) wrote :
Revision history for this message
Brian Murray (brian-murray) wrote :

I couldn't build the zesty debdiff on the arm64 porter box due to not being able to install the dependencies to build it. I did get the yakkety one to build and then extracted the package contents and used gdb from there. I was then able to create core files with this new gdb.

GNU gdb (Ubuntu 7.11.90.20161005-0ubuntu1.1) 7.11.90.20161005-git
Copyright (C) 2016 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 "arm-linux-gnueabihf".
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 cat...(no debugging symbols found)...done.
(gdb) Starting program: /bin/cat
Cannot parse expression `.L954 4@r4'.
warning: Probes-based dynamic linker interface failed.
Reverting to original interface.

Program received signal SIGSEGV, Segmentation fault.
0xf772f9e4 in read () at ../sysdeps/unix/syscall-template.S:84
84 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) Saved corefile /tmp/tmp8x5x1scn/my.core

I went so far as to run the generate-crashes script and it created core files for multiple applications.

Changed in gdb (Ubuntu):
importance: Undecided → High
status: New → Triaged
tags: added: patch
Changed in gdb (Ubuntu):
assignee: nobody → Brian Murray (brian-murray)
Changed in gdb (Ubuntu Precise):
status: New → Triaged
Changed in gdb (Ubuntu Trusty):
status: New → Triaged
Changed in gdb (Ubuntu Xenial):
status: New → Triaged
Changed in gdb (Ubuntu Yakkety):
status: New → Triaged
description: updated
Changed in gdb (Ubuntu Yakkety):
assignee: nobody → Brian Murray (brian-murray)
importance: Undecided → Medium
Changed in gdb (Ubuntu Xenial):
importance: Undecided → Medium
Changed in gdb (Ubuntu Trusty):
importance: Undecided → Medium
Changed in gdb (Ubuntu Precise):
importance: Undecided → Medium
Changed in gdb (Ubuntu Precise):
status: Triaged → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdb - 7.12-0ubuntu3

---------------
gdb (7.12-0ubuntu3) zesty; urgency=medium

  * Add debian/patches/armhf-fpregset.patch. LP: #1645501.

 -- Kees Cook <email address hidden> Tue, 29 Nov 2016 15:30:20 -0800

Changed in gdb (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

There is some discussion going on upstream regarding how to solve this, after that's sorted I'll redo the zesty patch and upload SRUs for this.

Changed in gdb (Ubuntu Trusty):
assignee: nobody → Brian Murray (brian-murray)
Changed in gdb (Ubuntu Xenial):
assignee: nobody → Brian Murray (brian-murray)
Revision history for this message
Brian Murray (brian-murray) wrote :
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Brian, or anyone else affected,

Accepted gdb into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gdb/7.11.90.20161005-0ubuntu2 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 to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. 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 Yakkety):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote :

Setting up gdb (7.11.90.20161005-0ubuntu2) ...
(yakkety-armhf)brian@rugby:~$ gdb --args cat
GNU gdb (Ubuntu 7.11.90.20161005-0ubuntu2) 7.11.90.20161005-git
Copyright (C) 2016 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 "arm-linux-gnueabihf".
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 cat...(no debugging symbols found)...done.
(gdb) run
Starting program: /bin/cat
Cannot parse expression `.L954 4@r4'.
warning: Probes-based dynamic linker interface failed.
Reverting to original interface.

^Z
Program received signal SIGTSTP, Stopped (user).
0xf772f9e4 in read () at ../sysdeps/unix/syscall-template.S:84
84 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) generate-core-file /tmp/my.core
Saved corefile /tmp/my.core

Setting to verification-done.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdb - 7.11.90.20161005-0ubuntu2

---------------
gdb (7.11.90.20161005-0ubuntu2) yakkety; urgency=medium

  * Add debian/patches/armhf-fpregset.patch. LP: #1645501.

 -- Brian Murray <email address hidden> Wed, 18 Jan 2017 12:41:08 -0800

Changed in gdb (Ubuntu Yakkety):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for gdb has completed successfully and the package has now been 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.

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.