Jøhnny Fävòrítê (it means "halo, then resonate")
2004-08-28 14:05:13 UTC
could somebody help me verify something?
it appears that having any static std::string variables causes random
heap corruption. i've been vaguely suspicious of something like this
for a long time, because i've had unexplained occasional crashes in the
global destructors for months now. just today i've finally narrowed
down a test case that always crashes for me.
create a new BeIDE project that uses the BeSTL stationery. it only
needs one source file, like this:
#include <string>
std::string iAmStatic;
int main(int argc, const char** argv)
{
return 0;
}
from the edit menu, pick "Project Settings," then "x86 Code Generation."
click the check boxes for "Generate profiling code" and "Generate
Debugging Information." build the app, and run it from the command
line. on my box, it usually prints:
What the hell! User addr doesn't start at 0x80000000
and then it *always* crashes in the global destructors that get run
after main(). if i comment out the std::string declaration and rebuild,
everything works fine. i'm running plain old stock beos 5.0.3 on x86.
could somebody please try this test and report what happens? there's
nothing i'd love to hear more than it works for other people, which
might mean that my libstdc++.r4.so lib is corrupt or something.
it appears that having any static std::string variables causes random
heap corruption. i've been vaguely suspicious of something like this
for a long time, because i've had unexplained occasional crashes in the
global destructors for months now. just today i've finally narrowed
down a test case that always crashes for me.
create a new BeIDE project that uses the BeSTL stationery. it only
needs one source file, like this:
#include <string>
std::string iAmStatic;
int main(int argc, const char** argv)
{
return 0;
}
from the edit menu, pick "Project Settings," then "x86 Code Generation."
click the check boxes for "Generate profiling code" and "Generate
Debugging Information." build the app, and run it from the command
line. on my box, it usually prints:
What the hell! User addr doesn't start at 0x80000000
and then it *always* crashes in the global destructors that get run
after main(). if i comment out the std::string declaration and rebuild,
everything works fine. i'm running plain old stock beos 5.0.3 on x86.
could somebody please try this test and report what happens? there's
nothing i'd love to hear more than it works for other people, which
might mean that my libstdc++.r4.so lib is corrupt or something.