DW_TAG unspecified type on nullptr?

260 Views Asked by At

We have an application that is compiled with a recent version of gcc (g++-7.2) Unfortunately, the production server is quite old and has a really old version of gdb (6.5.25-el5rh)

It is difficult to debug the software on site, because gdb does not show the backtrace with core file. Opening a core file with gdb leads to this message :

GNU gdb Red Hat Linux (6.5-25.el5rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".


warning: Can't read pathname for load map: Erreur d'entrée/sortie.
[...]
Reading symbols from /lib/libcrypt.so.1...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
Core was generated by `[binary_filename]'.
Program terminated with signal 11, Segmentation fault.
Die: DW_TAG_unspecified_type (abbrev = 218, offset = 2719370)
        has children: FALSE
        attributes:
                DW_AT_name (DW_FORM_strp) string: "decltype(nullptr)"
Dwarf Error: Cannot find type of die [in module [path_to_binary]]

I found on http://wiki.dwarfstd.org/index.php?title=C%2B%2B0x:_Null_pointer that nullptr can be translated to DW_TAG_unspecified_type.

Is nullptr the problem with this old version of gdb ? Is it possible to ask gcc to avoid generating dwarf information for nullptr ?

Precisions:

  • We cannot realistically update the gdb version neither deploy our own version of gdb
  • We are dependant on having a recent version of gcc (>= C++11), so downgrade of gcc is not desirable

[local_installation]/generated/bin/g++ -v :

    COLLECT_GCC=./g++
    COLLECT_LTO_WRAPPER=[local_installation]/generated/libexec/gcc/i686-pc-linux-gnu/7.2.0/lto-wrapper
    Cible : i686-pc-linux-gnu
    Configuré avec: [local_installation]/gcc-7.2.0/configure --prefix=[local_installation]/generated --disable-multilib --disable-libstdcxx-dual-abi --with-dwarf2 --enable-cxx-flags=-gdwarf-2
    Modèle de thread: posix
    gcc version 7.2.0 (GCC)

CXXFLAGS:

-pipe -fpermissive -Wshadow -Wextra -Wundef -Wno-deprecated-declarations -std=gnu++17 -D_GLIBCXX_USE_CXX11_ABI=0 -gdwarf-2 -gstrict-dwarf $(INCLUDES) -O2 -Wall -W -D_REENTRANT $(DEFINES)

Regards

0

There are 0 best solutions below