Discussion:
[Boost-users] [Boost.Filesystem] crashes in static destruction of global string object
Nguyen Huu Hai
2016-10-07 14:45:32 UTC
Permalink
Hello,

libs/filesytem/src/portability.cpp defines valid_posix as a
std::string object instead of a const char * pointer. May I know if
there are reasons for that?

I'm using Boost.Filesystem as a shared library and my processes crash
on exit with stack traces pointing to the static destruction of
valid_posix. Making it const char* fixes the crashes.

Regards,
Hai
Gavin Lambert
2016-10-09 23:49:46 UTC
Permalink
Post by Nguyen Huu Hai
libs/filesytem/src/portability.cpp defines valid_posix as a
std::string object instead of a const char * pointer. May I know if
there are reasons for that?
I'm using Boost.Filesystem as a shared library and my processes crash
on exit with stack traces pointing to the static destruction of
valid_posix. Making it const char* fixes the crashes.
Are you using the libc as a static or shared library? It needs to be
used as a shared library when using other shared libraries.
Nguyen Huu Hai
2016-10-10 13:27:35 UTC
Permalink
Post by Nguyen Huu Hai
libs/filesytem/src/portability.cpp defines valid_posix as a
std::string object instead of a const char * pointer. May I know if
there are reasons for that?
I'm using Boost.Filesystem as a shared library and my processes crash
on exit with stack traces pointing to the static destruction of
valid_posix. Making it const char* fixes the crashes.
Are you using the libc as a static or shared library? It needs to be used
as a shared library when using other shared libraries.
My apologies. It turned out to be a bug in my code. One of the
processes under valgrind generated a good trace pointing me to the
source of the bug.

Thank you.

Hai

Loading...