Boost logo

Boost :

Subject: Re: [boost] Fixed bug in filesystem library ?
From: Peter Dimov (pdimov_at_[hidden])
Date: 2009-12-05 09:04:22


Luca Severini wrote:
> Hello everyone,
>
> I'm a newbie to boost libraries but I have some good experience in
> software development on Mac OS.
> Today I use downloaded and used boost for the first time. I use a
> MacBook Pro with Snow Leopard 10.6.2. The IDE is Xcode 3.2.1
> Writing some very basic code to learn how to use the filesystem
> library I got assertions (below) simply iterating recursilvely
> through a local directory to list its content.
>
> /Developer/Test/TestFolder
> Boost_Test(57690) malloc: *** error for object 0xe518: pointer being
> freed was not allocated *** set a breakpoint in malloc_error_break to
> debug

std::string is broken in XCode 3.2.1. According to the collective
intelligence of the web, one reason is that its standard library has been
built with _GLIBCXX_FULLY_DYNAMIC_STRING defined, whereas the IDE by default
doesn't define it, leading to random crashes of the sort you report.

Others claim that there is a mismatch in the definitions of _GLIBCXX_DEBUG=1
_GLIBCXX_DEBUG_PEDANTIC=1 in a debug build; yet others report problems with
"Symbols Hidden by Default", although this may not be the cause of your
problem.

In your case, I'd first try the _GLIBCXX_FULLY_DYNAMIC_STRING define.

BTW, a std::string is never uninitialized. It's initialized to an empty
string by default.

http://stackoverflow.com/questions/1603300/xcode-3-2-1-and-c-string-fails
http://groups.google.com/group/boost-list/browse_thread/thread/1c5a614a9e8c9808


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk