Boost logo

Boost Users :

Subject: [Boost-users] Fwd: [boost] [thread] Crash when calling pthread_cond_wait from thread.cpp in iOS simulator
From: Brent Lewis (coder0xff_at_[hidden])
Date: 2012-11-28 19:48:27


I've determined that pthread_cond_wait works fine on an iPhone (hardware)
and works fine when called from my own module on simulator (I use
boost::condition_variable, and since it's header only and calling
pthread_cond_wait, it's my module)

But when I create a new thread, which goes through thread.cpp in the thread
library, call_once in once.hpp has to (sometimes, based on synchronization
randomness) call pthread_cond_wait which results in the message:

Detected an attempt to call a symbol in system libraries that is not
present on the iPhone:
(null) called from function _ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_
in image Blackjack

If I make it continue, I get a problem report from OSX which tells me that
the stack trace is:

0 libsystem_kernel.dylib 0x903a5a6a __pthread_kill + 10
1 libsystem_c.dylib 0x96afbacf pthread_kill + 101
2 libsystem_sim_c.dylib 0x03a0457b abort + 140
3 libSystem.dylib 0x032ad4ad
_interposition_vtable_unimplemented + 200
4 libSystem.dylib 0x032c0938 pthread_cond_wait$UNIX2003 + 60
5 Blackjack 0x00277c8c void boost::call_once<void
(*)()>(boost::once_flag&, void (*)()) + 156 (once.hpp:112)
6 Blackjack 0x0027506b thread_proxy + 139
(thread.cpp:135)
7 libsystem_c.dylib 0x96afa557 _pthread_start + 344
8 libsystem_c.dylib 0x96ae4cee thread_start + 34

 Is it maybe some discrepancy in the settings I'm using to build boost
that's causing to link something wrong... something else? I've attached the
complete crash log.

In case it is build related, this is how I've built boost using a shell
script:
LIBS=" --with-thread --with-serialization --with-date_time"
CPLUS_INCLUDE_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneOS6.0.sdk/usr/include/
PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:$PATH
./b2 toolset=darwin runtime-link=static link=static variant=release
include=$CPLUS_INCLUDE_PATH cxxflags=--visibility=default
cxxflags=-Wno-long-long --build-dir=$HOME/boost/lib/build
--includedir=$HOME/boost/include --libdir=$HOME/boost/lib/build/arm-release
architecture=arm target-os=iphone $LIBS -q install





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