[Bug 1472558] [NEW] GDB Crash during debugging session due to libstdcxx.v6.printers import register_libstdcxx_printers

Jeffrey Walton noloader at gmail.com
Wed Jul 8 10:20:59 UTC 2015


Public bug reported:

While attempting to debug a simple C++, program, GDB crashes. The
program is below:

$ gdb
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
...
(gdb) file ./cryptopp-test.exe 
Reading symbols from ./cryptopp-test.exe...done.
(gdb) r
Starting program: /home/user/cryptopp-test.exe 
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'

Program received signal SIGSEGV, Segmentation fault.
Segmentation fault

**********

This appears to be a Debian bug from February, 2013:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=701935.

**********

I'm on Ubuntu 14.04, x86_64 fully patched. I'm using Gnome-Fallback
desktop (it seems many think everything is a tablet now. I'd like to get
a hold of the drugs the folks at Microsoft, Fedora, Ubuntu (etc) are
using for recreational purposes, too).

$ uname -a
Linux ubuntu 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release 
No LSB modules are available.

**********

The program below is going to provide (or not provide) heuristic
evidence of a bias in the Random Number Generator. The crash occurs with
different symbol levels (-g) and optimizations (-O).

// g++ -DDEBUG=1 -g3 -Og -Wall -Wextra -Wno-unused-parameter \
//    -I/usr/local/include/cryptopp cryptopp-test.cpp \
//    /usr/local/lib/libcryptopp.a -o cryptopp-test.exe

static const word32 MIN_VAL = 0, MAX_VAL = 2;
static const word32 RANGE = MAX_VAL - MIN_VAL + 1;
static const unsigned int ITERATIONS = 100000;

int main(int argc, char* argv[])
{
    try {

        RandomNumberGenerator rng;
        vector<unsigned int>buckets;
        buckets.resize(RANGE);

        for(unsigned int i = 0; i < ITERATIONS; i++)
            buckets[rng.GenerateWord32(MIN_VAL, MAX_VAL)]++;

        for(unsigned int j = 0; j < RANGE; j++)
            cout << j << ": " << buckets[j] << endl;
    }
    catch(CryptoPP::Exception& ex)
    {
        cerr << ex.what() << endl;
    }

    return 0;
}

** Affects: gdb (Ubuntu)
     Importance: Undecided
         Status: New

-- 
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/1472558

Title:
  GDB Crash during debugging session due to libstdcxx.v6.printers import
  register_libstdcxx_printers

Status in gdb package in Ubuntu:
  New

Bug description:
  While attempting to debug a simple C++, program, GDB crashes. The
  program is below:

  $ gdb
  GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
  ...
  (gdb) file ./cryptopp-test.exe 
  Reading symbols from ./cryptopp-test.exe...done.
  (gdb) r
  Starting program: /home/user/cryptopp-test.exe 
  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'

  Program received signal SIGSEGV, Segmentation fault.
  Segmentation fault

  **********

  This appears to be a Debian bug from February, 2013:
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=701935.

  **********

  I'm on Ubuntu 14.04, x86_64 fully patched. I'm using Gnome-Fallback
  desktop (it seems many think everything is a tablet now. I'd like to
  get a hold of the drugs the folks at Microsoft, Fedora, Ubuntu (etc)
  are using for recreational purposes, too).

  $ uname -a
  Linux ubuntu 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

  $ lsb_release 
  No LSB modules are available.

  **********

  The program below is going to provide (or not provide) heuristic
  evidence of a bias in the Random Number Generator. The crash occurs
  with different symbol levels (-g) and optimizations (-O).

  // g++ -DDEBUG=1 -g3 -Og -Wall -Wextra -Wno-unused-parameter \
  //    -I/usr/local/include/cryptopp cryptopp-test.cpp \
  //    /usr/local/lib/libcryptopp.a -o cryptopp-test.exe

  static const word32 MIN_VAL = 0, MAX_VAL = 2;
  static const word32 RANGE = MAX_VAL - MIN_VAL + 1;
  static const unsigned int ITERATIONS = 100000;

  int main(int argc, char* argv[])
  {
      try {

          RandomNumberGenerator rng;
          vector<unsigned int>buckets;
          buckets.resize(RANGE);

          for(unsigned int i = 0; i < ITERATIONS; i++)
              buckets[rng.GenerateWord32(MIN_VAL, MAX_VAL)]++;

          for(unsigned int j = 0; j < RANGE; j++)
              cout << j << ": " << buckets[j] << endl;
      }
      catch(CryptoPP::Exception& ex)
      {
          cerr << ex.what() << endl;
      }

      return 0;
  }

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1472558/+subscriptions



More information about the foundations-bugs mailing list