Boost logo

Boost Users :

Subject: Re: [Boost-users] filesystem directory_iterator run-time error during construction after upgrading to OSX Lion
From: Alper Aydemir (alperaydemir_at_[hidden])
Date: 2012-05-20 08:13:09


I can confirm that this also happens on Mac OS 10.6.8

minimal code sample:

const char * path_str = "/data/jpegs_highmotion";
path pdir =path_str;

for(directory_iterator dit = directory_iterator(pdir); dit!=end;
++dit, ++frameNo ){
...

}

It crashes on the for loop line with:

#3 0x00007fff854c0124 in std::string::assign ()
#4 0x000000010086d8cb in
boost::filesystem3::detail::directory_iterator_construct ()
#5 0x00000001000038e0 in directory_iterator (this=0x7fff5fbff3f0,
p=@0x7fff5fbff410) at filesystem/v3/operations.hpp:606

demo(7898) malloc: *** error for object 0x10094b540: pointer being
freed was not allocated

Would be good to fix this as it's a quite frequently used part of the code.

--
Alper Aydemir
On Thu, Apr 5, 2012 at 3:25 AM, Martin Searancke
<martin_at_[hidden]> wrote:
> I have just upgraded my Mac to Lion and code that worked fine under
> snow leopard is giving me a run-time exception when constructing a
> directory_iterator.
>
> The error I am getting is "malloc: pointer being freed was not allocated"
>
> The line in question that raises this error is:
>        for ( directory_iterator itr( my_path ); itr != end_itr; ++itr )
> taken directly from the example and working fine under windows.
>
> This is version 1.49 installed with MacPorts.
>
> Is this a known problem? I found some vague references to a similar
> problem in an earlier version of boost but no solution.
>
> I have confirmed that I only have 1 copy of the headers and libs on
> the system and in the correct path. The date stamp on the files
> matches the last time I did a macports update so this should be the
> matching library for the header.
> Please note that I am a real novice to Mac development and have only
> just started porting code from windows for less than a month.
>
> Thanks in advance,
> Martin
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net