[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#625616: libc6: Reproducible crash when allocating in a static constructor



Package: libc6
Version: 2.13-2
Severity: important

The following program crashes before executing main().  It is 100%
reproducible.

On a debian unstable machine updated one month ago, the crash did not
appear.  The culprit is not gcc, since when compiling right now this
program with gcc 4.5 and 4.4, the crash still appears.  I am not sure
that libc6 is the culprit, or another related library (such as binutils).

$ cat test.cxx
#include <iostream>
#include <ext/bitmap_allocator.h>

class Hello
{
public:
   Hello ()
    {}

  ~Hello ()
    {}

  void act ()
    { std::cout << "Hello, world!" << std::endl; }
};

static void __attribute__ (( constructor )) PWLIB_StaticLoader() { \
  __gnu_cxx::bitmap_allocator<Hello> allocator; \
  Hello* salut = allocator._M_allocate_single_object (); \
  salut->act (); \
}


int
main (int /*argc*/,
      char* /*argv*/[])
{
  return 0;
}

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.37-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libc6 depends on:
ii libc-bin 2.13-2 Embedded GNU C Library: Binaries
ii  libgcc1                       1:4.6.0-6  GCC support library

libc6 recommends no packages.

Versions of packages libc6 suggests:
ii debconf [debconf-2.0] 1.5.39 Debian configuration management sy
pn  glibc-doc                     <none>     (no description available)
ii locales 2.13-2 Embedded GNU C Library: National L

-- debconf information excluded



Reply to: