Hi,
I'm having some trouble with my personal project I develop using mingw-w64.
I tried different compiler versions (sezero's 4.4 and 4.5, and the november
mingw autobuild). All segfault, at the same spot in libstdc++-v3 (gdb info
from sezero's 4.4 build seemed to provide the most information):
Program received signal SIGSEGV, Segmentation fault.
> std::basic_string<char, std::char_traits<char>, std::allocator<char>
> >::basic_string (this=0x22f8d0, __str=...) at
> /W64_4.4_164871-src/build-gcc/x86_64-w64-mingw32/libstdc++-v3/include/bits/basic_string.tcc:174
> 174
> /W64_4.4_164871-src/build-gcc/x86_64-w64-mingw32/libstdc++-v3/include/bits/basic_string.tcc:
> No such file or directory.
> in
> /W64_4.4_164871-src/build-gcc/x86_64-w64-mingw32/libstdc++-v3/include/bits/basic_string.tcc
>
With following backtrace:
> #0 std::basic_string<char, std::char_traits<char>, std::allocator<char>
> >::basic_string (this=0x22f8d0, __str=...) at
> /W64_4.4_164871-src/build-gcc/x86_64-w64-mingw32/libstdc++-v3/include/bits/basic_string.tcc:174
> #1 0x00000000004287bf in Config::Config (this=0x22f880) at
> ../../Source/Ambrosia/Include/Ambrosia/Config.h:38
> #2 0x0000000000419d9f in Target::Target (this=0x22f810, targetName=...,
> config=...) at ..\..\Source\Ambrosia\Source\Target.cpp:59
> #3 0x00000000004119e0 in Architect::Architect (this=0x396180, parent=0x0)
> at ..\..\Source\Ambrosia\Source\Architect.cpp:49
> #4 0x00000000004034a3 in __static_initialization_and_destruction_0
> (__initialize_p=1, __priority=65535) at
> ..\..\Source\Ambrosia\Source\Parser\ParserState.cpp:49
> #5 0x0000000000403705 in global constructors keyed to
> _ZN11ParserState11p_architectE() () at
> ..\..\Source\Ambrosia\Source\Parser\ParserState.cpp:189
> #6 0x00000000004238f5 in __do_global_ctors () at
> ../mingw-w64-crt/crt/gccmain.c:70
> #7 0x00000000004017e9 in main (argc=2, argv=0x392240) at
> ..\..\Source\Ambrosia\Source\Main.cpp:53
The code is available through git here:
> git clone git://git.code.sf.net/p/ambrosia/git.git ambrosia
>
Short story even shorter: Config is a class that (among a lot of other
things) holds a std::string as a data member. A static instance is present
(which causes the problem I think) as member of my State class. Removing
this (and the single reference thereof) gets rid of the crash. On the other
hand, getting rid of the string (m_crossPrefix) also "solves" the problem.
So:
1. an instance of Config with member std::string m_crossPrefix initialized
statically somewhere in my code causes a runtime crash in libstdc++
2. Deleting either the static instance or the std::string gets rid of the
problem.
3. Other classes (like a map<string,string> or set<string> or
vector<string>) are not the cause of the problem: only the std::string I
mention in point 1 causes the crash.
4. Initializing a set<string> using CRT functions like getenv() does not
cause a crash. But a string initialized with a constant value does.
What gives? I'm completely stumped!
Thanks for any help!
Ruben
PS: I cannot presently test MSVC on this, because my code still uses C++0x
uniform initialization lists and MSVC does not support them :(
------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world?
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public