[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/12730] [regression] crash when allocating in a static constructo
From: |
address@hidden |
Subject: |
[Bug ld/12730] [regression] crash when allocating in a static constructor |
Date: |
Fri, 13 May 2011 21:21:58 +0000 |
http://sourceware.org/bugzilla/show_bug.cgi?id=12730
Eugen Dedu <address@hidden> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |address@hidden
| |e.fr
--- Comment #5 from Eugen Dedu <address@hidden> 2011-05-13 21:21:38 UTC ---
It turns out that the fix was only partial. With the fix, I have finally been
able to reproduce the crash with two files.
$ cat >a.cxx
#include <iostream>
class Hello
{
public:
Hello () {}
~Hello () {}
void act (void);
};
void Hello::act (void)
{
std::cout << "Hello, world!" << std::endl;
}
$ cat >aa.cxx
#include <ext/bitmap_allocator.h>
class Hello
{
public:
Hello ();
~Hello ();
void act (void);
};
static void __attribute__ (( constructor )) PWLIB_StaticLoader() {
__gnu_cxx::bitmap_allocator<Hello> allocator;
Hello* salut = allocator._M_allocate_single_object ();
salut->act ();
}
int main (void)
{
return 0;
}
$ g++ aa.cxx a.cxx
$ ./a.out
Segmentation fault
By chance, I discovered that the order of compilation is important:
$ g++ a.cxx aa.cxx
$ ./a.out
Hello, world!
Cheers,
Eugen
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
- [Bug ld/12730] New: crash when allocating in a static constructor, doko at debian dot org, 2011/05/04
- [Bug ld/12730] [regression] crash when allocating in a static constructor, doko at debian dot org, 2011/05/04
- [Bug ld/12730] [regression] crash when allocating in a static constructor, doko at debian dot org, 2011/05/04
- [Bug ld/12730] [regression] crash when allocating in a static constructor, hjl.tools at gmail dot com, 2011/05/04
- [Bug ld/12730] [regression] crash when allocating in a static constructor, hjl.tools at gmail dot com, 2011/05/04
- [Bug ld/12730] [regression] crash when allocating in a static constructor, hjl.tools at gmail dot com, 2011/05/05
- [Bug ld/12730] [regression] crash when allocating in a static constructor, cvs-commit at gcc dot gnu.org, 2011/05/07
- [Bug ld/12730] [regression] crash when allocating in a static constructor,
address@hidden <=
- [Bug ld/12730] [regression] crash when allocating in a static constructor, hjl.tools at gmail dot com, 2011/05/13
- [Bug ld/12730] [regression] crash when allocating in a static constructor, craigs at postincrement dot com, 2011/05/16
- [Bug ld/12730] [regression] crash when allocating in a static constructor, craigs at postincrement dot com, 2011/05/16
- [Bug ld/12730] [regression] crash when allocating in a static constructor, hjl.tools at gmail dot com, 2011/05/16
- [Bug ld/12730] [regression] crash when allocating in a static constructor, address@hidden, 2011/05/19