gdb sandbox can cause issues with gdb and glibc

Bug #1760207 reported by Brian Murray
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Apport
Fix Released
Medium
Unassigned

Bug Description

Now that bug 1517257 is resolved and apport uses a sandbox with the release's latest version of gdb to retrace a crash we encountered a case where the retracers were hanging attempt to retrace a crash.

Come to find out this is because gdb depends on libc6 and the version of glibc installed in the sandbox was the latest one (because of the dependency) yet the crash report was using the older version of libc6 and gdb hung when loading the core file.

While we worked around this by deleting all the core files with an old version of libc6 it'd be better if gdb did not hang or apport gave up after a while.

bdmurray@clean-xenial-amd64:~$ LD_LIBRARY_PATH=/tmp/apport_sandbox_gepsxaz0/lib:/tmp/apport_sandbox_gepsxaz0/lib/x86_64-linux-gnu:/tmp/apport_sandbox_gepsxaz0/usr/lib/x86_64-linux-gnu:/tmp/apport_sandbox_gepsxaz0/usr/lib PYTHONHOME=/tmp/apport_sandbox_gepsxaz0/usr GCONV_PATH=/tmp/apport_sandbox_gepsxaz0/usr/lib/x86_64-linux-gnu/gconv /tmp/apport_sandbox_gepsxaz0/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /tmp/apport_sandbox_gepsxaz0/usr/bin/gdb --ex "set debug-file-directory /tmp/apport_sandbox_gepsxaz0/usr/lib/debug" --ex "set solib-absolute-prefix /tmp/apport_sandbox_gepsxaz0" --ex "add-auto-load-safe-path /tmp/apport_sandbox_gepsxaz0" --ex "set solib-search-path /tmp/apport_sandbox_gepsxaz0/lib/x86_64-linux-gnu" --ex "set data-directory /tmp/apport_sandbox_gepsxaz0/usr/share/gdb" --ex "file /tmp/apport_sandbox_gepsxaz0//usr/bin/xeyes"
GNU gdb (Ubuntu 8.1-0ubuntu1) 8.1
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 "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/apport_sandbox_gepsxaz0//usr/bin/xeyes...Reading symbols from /tmp/apport_sandbox_gepsxaz0/usr/lib/debug/.build-id/2d/f8e1beb1c82d40e421cdfc96ac0b0ac992ed44.debug...done.
done.
(gdb) core-file /home/bdmurray/tmpD3ptDx-swift.5c645044-2799-11e8-9dd4-fa163e5006ec.oopsid.core
[New LWP 7620]
warning: .dynamic section for "/tmp/apport_sandbox_gepsxaz0/lib/x86_64-linux-gnu/libm.so.6" is not at the expected address (wrong library or version mismatch?)
warning: .dynamic section for "/tmp/apport_sandbox_gepsxaz0/lib/x86_64-linux-gnu/libdl.so.2" is not at the expected address (wrong library or version mismatch?)
warning: .dynamic section for "/tmp/apport_sandbox_gepsxaz0/lib/x86_64-linux-gnu/ld-2.27.so" is not at the expected address (wrong library or version mismatch?)
warning: .dynamic section for "/tmp/apport_sandbox_gepsxaz0/lib/x86_64-linux-gnu/librt.so.1" is not at the expected address (wrong library or version mismatch?)
warning: .dynamic section for "/tmp/apport_sandbox_gepsxaz0/lib/x86_64-linux-gnu/libpthread.so.0" is not at the expected address (wrong library or version mismatch?)

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

A timeout was added for the call to gdb in the following apport change.

revno: 3191
committer: Brian Murray <email address hidden>
branch nick: trunk
timestamp: Mon 2018-03-12 09:55:08 -0700
message:
  apport/report.py: Use timeout parameter in subprocess to limit how long we'll wait for gdb to return information as gdb can hang with some core files.

description: updated
Changed in apport:
importance: Undecided → Medium
tags: added: id-5abe9d56762ce62603abadfa
Changed in apport:
status: New → Fix Released
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.