This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
- From: "johnw at gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Oct 2009 05:40:15 -0000
- Subject: [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
- References: <bug-24196-7246@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #21 from johnw at gnu dot org 2009-10-25 05:40 -------
I'm actually getting this same error on Snow Leopard (Mac OS X 10.6.0). It's
pretty easy to reproduce with Boost (1.40):
#include <string>
#include <sstream>
#include <boost/variant.hpp>
int main()
{
std::ostringstream buf;
boost::variant<bool, std::string> data;
data = buf.str();
data = false;
return 0;
}
$ g++ -I/opt/local/include -o bug bug.cc
What happens here is that ostringstream, which is in libstdc++.dylib, returns
an empty string which does not match the notion of empty string compiled into
my executable; thus when Boost tries to deconstruct the string it stored in
order to store the boolean, it crashes trying to deallocate a foreign lib's
empty string.
This doesn't happen with the same Boost using the stock compiler (g++ 4.2).
John
--
johnw at gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |johnw at gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196