gdb pretty printers do not auto-load on Trusty

Bug #1446828 reported by Simon Marchi on 2015-04-21
40
This bug affects 13 people
Affects Status Importance Assigned to Milestone
gcc-4.8 (Ubuntu)
Medium
Unassigned
Trusty
Medium
Unassigned

Bug Description

On Ubuntu 14.04.2 (Trusty), the file in libstdc++6-4.8-dbg to auto-load the pretty printers doesn't resolve the right path to the printers. To reproduce, on a fresh install:

$ cat test.cpp
#include <vector>
int main() {
  std::vector<int> v;
  v.push_back(1);
  return 0;
}
$ g++ test.cpp -g
$ gdb a.out -ex start
Reading symbols from a.out...done.
Temporary breakpoint 1 at 0x400956: file test.cpp, line 3.
Starting program: /home/emaisin/a.out
Traceback (most recent call last):
  File "/usr/lib/debug/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'

Temporary breakpoint 1, main () at test.cpp:3
3 std::vector<int> v;
(gdb)

It seems like the fixup for multiarch actually adds an extra "..":

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

Removing these two lines almost makes it work:

$ gdb a.out -ex start
Reading symbols from a.out...done.
Temporary breakpoint 1 at 0x400956: file test.cpp, line 3.
Starting program: /home/emaisin/a.out
Traceback (most recent call last):
  File "/usr/lib/debug/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
  File "/usr/lib/x86_64-linux-gnu/../../share/gcc-4.8/python/libstdcxx/v6/printers.py", line 54
    raise ValueError, "Cannot find type %s::%s" % (str(orig), name)
                    ^
SyntaxError: invalid syntax

Temporary breakpoint 1, main () at test.cpp:3
3 std::vector<int> v;

That last problem is tracked in bug #1256419, which is still a pending issue in Trusty.

Martin Pecka (peci1) wrote :

I confirm this on current 14.04 LTS release.

However, I no longer have problems regarding bug #1256419, so it seems the printers.py file syntax has already been updated in upstream.

So just commenting out the two lines Simon Suggests solves the issue for me (however, I'm not doing any multiarch releases, so I don't know what is broken by this fix).

Changed in gcc-4.8 (Ubuntu):
status: New → Confirmed
Joe (vectorvortec) wrote :

I also confirm this on 14.04 LTS. I deleted the two lines as suggested, and the error disappeared. I'm not sure whether I'm participating in the multiarch releases.

Launchpad Janitor (janitor) wrote :

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

Changed in gcc-4.8 (Ubuntu Trusty):
status: New → Confirmed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-4.8 - 4.8.5-2ubuntu1

---------------
gcc-4.8 (4.8.5-2ubuntu1) xenial; urgency=medium

  * Merge with Debian; remaining changes:
    - Build from the upstream source.

gcc-4.8 (4.8.5-2) unstable; urgency=medium

  * Update the Linaro support to the 4.8-2015.07 release.
  * Adjust setting DH_COMPAT for dh_movefiles with updated debhelper supporting
    globbing of arguments. Closes: #800248.
  * Fix PR libstdc++/56158, taken from the trunk.
    Addresses: #804521. LP: #1514309.
  * Backport fixes to allow building with cloog-0.18.4 and isl-0.15.
  * Backport PR target/67281 from the trunk (HTM fixes). LP: #1517093.
  * Fix auto-loading of gdb pretty printers. LP: #1446828.

 -- Matthias Klose <email address hidden> Wed, 18 Nov 2015 19:57:42 +0100

Changed in gcc-4.8 (Ubuntu):
status: Confirmed → Fix Released
Simon Marchi (simon-marchi) wrote :

Thanks Matthias!

Will this package be uploaded to Trusty's repo, or it will stick with the current version (4.8.2-19ubuntu1)?

Griggs (izod) wrote :

I'm having this same issue.

Is the corrected version gong to be uploaded to Trusty PPA?

Philipp Kern (pkern) wrote :

doko, could this be SRUed to trusty? (Maybe you already have other fixes lined up?)

Hello Simon, or anyone else affected,

Accepted gcc-4.8 into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gcc-4.8/4.8.4-2ubuntu1~14.04.1 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 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 gcc-4.8 (Ubuntu Trusty):
status: Confirmed → Fix Committed
tags: added: verification-needed
Simon Marchi (simon-marchi) wrote :

Hi Steve,

I tested package 4.8.4-2ubuntu1~14.04.1, pretty printers work fine, so the fix looks good to me.

tags: added: verification-done
removed: verification-needed
Changed in gcc-4.8 (Ubuntu):
importance: Undecided → Medium
Changed in gcc-4.8 (Ubuntu Trusty):
importance: Undecided → Medium
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-4.8 - 4.8.4-2ubuntu1~14.04.1

---------------
gcc-4.8 (4.8.4-2ubuntu1~14.04.1) trusty-proposed; urgency=medium

  * SRU:
  * Fix auto-loading of gdb pretty printers. LP: #1446828.
  * Fix PR libstdc++/56158, taken from the trunk.
    Addresses: #804521. LP: #1514309.
  * Backport PR target/64579 and PR target/67281 from the trunk (HTM fixes).
    LP: #1517093.

 -- Matthias Klose <email address hidden> Wed, 18 Nov 2015 17:48:36 +0100

Changed in gcc-4.8 (Ubuntu Trusty):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for gcc-4.8 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  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers