[capnproto] GDB Segfault

Morten Hustveit morten.hustveit@gmail.com
Fri Sep 19 20:58:00 GMT 2014


-cc+bcc:capnproto, +cc:gdb

Moving discussion about _Z8functionIiE5ClassIDTcvT_Li0EEEv, which
crashes both GDB and c++filt, to the GDB mailing list, where it's more
likely that we can get some help.

On Friday, September 19, 2014 1:50:21 PM UTC-3, Morten Hustveit wrote:
>> I've created a reduced test case here:
>>
>> template <typename T>
>> struct Class { };
>>
>> template <typename T0>
>> Class<decltype(T0(0))> function() {
>>  return Class<decltype(T0(0))>();
>> }
>>
>> int main() { function<int>(); }
>>
>> GCC and LLVM both produce the following symbol for this function:
>> _Z8functionIiE5ClassIDTcvT_Li0EEEv
>>
>> Even c++filt crashes on this symbol:
>>
>> $ echo _Z8functionIiE5ClassIDTcvT_Li0EEEv | c++filt
>> Segmentation fault

On Fri, Sep 19, 2014 at 1:14 PM,  <emile.cormier.jr@gmail.com> wrote:
> Would
> upgrading to a more recent version prevent this problem from occurring? Or
> is the problem entirely within GDB? I'm already running the latest weekly
> snapshot of GDB.

The bug is in libiberty, including the version currently at
git://sourceware.org/git/binutils-gdb.git.  It ends up recursing
infinitely at these lines:

#1  d_print_cast at ./cp-demangle.c:5754
#2  d_print_comp_inner at ./cp-demangle.c:5046
#3  d_print_comp at ./cp-demangle.c:5368
#4  d_print_comp_inner at ./cp-demangle.c:5276
#5  d_print_comp at ./cp-demangle.c:5368
#6  d_print_comp_inner at ./cp-demangle.c:4537
#7  d_print_comp at ./cp-demangle.c:5368



More information about the Gdb mailing list