[Boost-bugs] [Boost C++ Libraries] #9912: shared_ptr SEGV in Android debug builds

Subject: [Boost-bugs] [Boost C++ Libraries] #9912: shared_ptr SEGV in Android debug builds
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-04-15 18:26:50


#9912: shared_ptr SEGV in Android debug builds
------------------------------+-----------------------
 Reporter: ian@… | Owner: pdimov
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: smart_ptr
  Version: Boost 1.55.0 | Severity: Problem
 Keywords: |
------------------------------+-----------------------
 Hi,

 I get a SEGV in the shared_ptr ref counting code on Android debug builds.
 Release builds do not have this problem.

 Instructions:
 1. Install ndk (I used r9d 64-bit mac)
 1. Ensure ndk-build is on your path
 1. Download the attached sample program
 1. Run build.sh
 1. Install the executable on an Android device (I used a Nexus 7).


 As provided, you should get a SEGV in the sp_counted_base code.

 There are two ways to fix this:
 1. Remove APP_OPTIM=debug from build.sh
 1. Enable # LOCAL_CPPFLAGS := -DBOOST_SP_USE_PTHREADS in Android.mk

 Notes:

 Android debug builds disable the -mthumb option and instead use -marm.
 Ultimately this affects spinlock.hpp
 {{{
 #elif defined(__GNUC__) && defined( __arm__ ) && !defined( __thumb__ )
 # include <boost/smart_ptr/detail/spinlock_gcc_arm.hpp>

 //code omitted

 #elif defined(BOOST_HAS_PTHREADS)
 # include <boost/smart_ptr/detail/spinlock_pt.hpp>
 }}}
 So release builds use spinlock_pt.hpp and debug builds use
 spinlock_gcc_arm.hpp

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9912>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC