filesystem directory_iterator run-time error during construction after upgrading to OSX Lion
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
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
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@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
I just ran into the problem above using boost 1.50 under Mac OS X 10.8.1. Any updates on this? -- View this message in context: http://boost.2283326.n4.nabble.com/filesystem-directory-iterator-run-time-er... Sent from the Boost - Users mailing list archive at Nabble.com.
participants (3)
-
Alper Aydemir
-
laan
-
Martin Searancke