Package: gdb
Version: 7.7.1+dfsg-5
Severity: important

Dear Maintainer,

after upgrading to Debian/Stable, serious problems with GDB:
Unable to start with most of the C++11 programs I am working on,
since the debugger crashes right at start.

Could confirm this problem is present on a pristine install of
Debian 8.1, both 64bit and 32bit

I was able to narrow down the problem in one case to a situation,
where a std::function is bound to a lambda, which uses the template
parameter of the enclosing function as argument type. (function / lambda
without this specific twist cause no problems)

See the following demonstration:


----crash_gdb_jessie-2015-08.sh-------------
#/!bin/sh
#
# crash_gdb -- demostrate a Segfault when invoking the debugger
#              observed 8/2015 on Debian/Jessie on X86_64
#              <d...@ichthyostega.de>

CODE=`mktemp`

cat << __END__ | g++ -x c++ - -o$CODE -std=gnu++11  && echo "compiled
successfully to $CODE"

#include <functional>
#include <iostream>
#include <string>

using std::string;
using std::cout;
using std::endl;


template<class ELM>
inline string
activate (ELM& something)
  {
    std::function<string(ELM const&)> lambda = [] (ELM const& val)
                                                  {
                                                    return string(val);
                                                  };
    return lambda(something);
  }


int
main (int, char**)
  {
    cout << activate ("Data") << endl;
    return 0;
  }

__END__


$CODE && echo "executed successfully without debugger"

echo -e "now try to crash the debugger...\n\n"

gdb $CODE -ex run -ex quit

if (($?))
        then echo -e "\n\n\n\n *** Debugger crashed"
        else echo -e "\n\n\n\n +++ Debugger worked, no crash"
fi



-- System Information:
Debian Release: 8.1
  APT prefers stable
  APT policy: (900, 'stable'), (650, 'stable'), (500, 'stable-updates'), (95, 
'testing'), (80, 'unstable'), (50, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages gdb depends on:
ii  libc6         2.19-18
ii  libexpat1     2.1.0-6+deb8u1
ii  liblzma5      5.1.1alpha+20120614-2+b3
ii  libncurses5   5.9+20140913-1+b1
ii  libpython2.7  2.7.9-2
ii  libreadline6  6.3-8+b3
ii  libtinfo5     5.9+20140913-1+b1
ii  zlib1g        1:1.2.8.dfsg-2+b1

Versions of packages gdb recommends:
pn  gdbserver  <none>
pn  libc-dbg   <none>

Versions of packages gdb suggests:
ii  gdb-doc  7.7.1+dfsg-2

-- no debconf information

Reply via email to