This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcc 2.96, libstdc++ v3 and efence


Hello.

This simple code segfaults if compiled with CVS GCC 2.96 using libstdc++
v3 and linked to efence:

#include <stdlib.h>

int
main(void)
{

  char *p = (char *)malloc(100);
  free(p);

  return 0;
}

This is the stack trace:

Program received signal SIGSEGV, Segmentation fault.
std::ios_base::~ios_base (this=0x400e9184, __in_chrg=0)
    at ../../../../gcc/libstdc++-v3/bits/localefwd.h:344
344           if (_M_num_references-- == 0)  // XXX MT
(gdb) bt
#0  std::ios_base::~ios_base (this=0x400e9184, __in_chrg=0)
    at ../../../../gcc/libstdc++-v3/bits/localefwd.h:344
#1  0x400782d7 in __static_initialization_and_destruction_0
(__initialize_p=0, 
    __priority=65535) at
../../../../gcc/libstdc++-v3/bits/basic_ios.h:148
#2  0x400785c2 in global destructors keyed to std::__cfileinit ()
    at ../../../../gcc/libstdc++-v3/bits/std_fstream.h:96
#3  0x40066d2d in __do_global_dtors_aux () from
/usr/local2/lib/libstdc++.so.3
#4  0x400ce5e9 in ?? () from /usr/local2/lib/libstdc++.so.3
#5  0x4000aef6 in _dl_fini () at dl-fini.c:40
#6  0x4012825a in exit (status=0) at exit.c:57
#7  0x4011f9d1 in __libc_start_main () at
../sysdeps/generic/libc-start.c:92

As far as I can understand this is a standard library problem (I posted
to gcc-help too just because I'm using the stdc++ library from the GCC
CVS).
The same code runs fine with the stock RH Linux 6.2 GCC.
(I checked out GCC last week. Now I'm updating my sources and compiling
it again)
Is it a bug?

Thanks,
Maurizio Umberto Puxeddu

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]