gdb complains about missing Python module libstdcxx.v6.printers

Bug #1473599 reported by Jon Bailey
42
This bug affects 9 people
Affects Status Importance Assigned to Milestone
gcc-4.8 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

This appears to be a regression of Debian Bug 726094
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=726094

Invoking GDB on any C++ program generates the message:

Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'

My system info:
$ lsb_release -rd
Description: Ubuntu 14.04.2 LTS
Release: 14.04
$ apt-cache policy libstdc++6-4.8-dbg
libstdc++6-4.8-dbg:
  Installed: 4.8.4-2ubuntu1~14.04
  Candidate: 4.8.4-2ubuntu1~14.04
  Version table:
 *** 4.8.4-2ubuntu1~14.04 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     4.8.2-19ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

Expected to happen:
  No Python tracebacks in GDB
What happened instead:
  ImportError: No module named 'libstdcxx'

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: libstdc++6-4.8-dbg 4.8.4-2ubuntu1~14.04
ProcVersionSignature: Ubuntu 3.13.0-57.95-generic 3.13.11-ckt21
Uname: Linux 3.13.0-57-generic x86_64
NonfreeKernelModules: nvidia zfs zunicode zavl zcommon znvpair
ApportVersion: 2.14.1-0ubuntu3.11
Architecture: amd64
Date: Fri Jul 10 18:03:53 2015
ProcEnviron:
 TERM=screen
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gcc-4.8
UpgradeStatus: Upgraded to trusty on 2014-04-28 (438 days ago)

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

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

Changed in gcc-4.8 (Ubuntu):
status: New → Confirmed
Revision history for this message
Ionut (albertino) wrote :

If anyone is still having this problem (as I just had), I have found that the solution explained here: https://bugs.launchpad.net/ubuntu/+source/gcc-4.8/+bug/1446828 solves it.

Basically, you have to comment lines 51 and 52, the ones dealing with multiarch, in /usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py

After doing that, pretty printers should work.

Revision history for this message
Ionut (albertino) wrote :

In case it's ever needed, for the future, the relevant lines that should be commented are:

    if not os.path.basename(os.path.dirname(__file__)).startswith('lib'):
        backdirs += 1 # multiarch subdir

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.