Skip to content

EXC BAD ACCESS Error on startup on device but not on simulator #36

@KenziTrader

Description

@KenziTrader

I include ofxiOSBoost in my Xcode project. I also include QuantLib 1.6 from http://iphonesdkdev.blogspot.nl/2015/06/quantlib-16-framework-for-ios-and-mac.html. The project uses c++11 with libc++.

On the simulator the app runs without problems. On a real device it crashes with a EXC_BAD_ACCESS on startup. The stack trace is

#0  0x00000001000f7d88 in long double boost::math::detail::erf_imp<long double, boost::math::policies::policy<boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> >(long double, bool, boost::math::policies::policy<boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> const&, mpl_::int_<53> const&) at /Users/.../Frameworks/boost.framework/Headers/math/special_functions/erf.hpp:221
#1  0x00000001000f7b50 in boost::math::tools::promote_args<long double, float, float, float, float, float>::type boost::math::erf<long double, boost::math::policies::policy<boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> >(long double, boost::math::policies::policy<boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> const&) at /Users/.../Frameworks/boost.framework/Headers/math/special_functions/erf.hpp:1081
#2  0x00000001000f7ac0 in boost::math::detail::erf_initializer<long double, boost::math::policies::policy<boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>, mpl_::int_<53> >::init::do_init(mpl_::int_<53> const&) at /Users/.../Frameworks/boost.framework/Headers/math/special_functions/erf.hpp:1000
#3  0x00000001000f7a78 in boost::math::detail::erf_initializer<long double, boost::math::policies::policy<boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>, mpl_::int_<53> >::init::init() at /Users/.../Frameworks/boost.framework/Headers/math/special_functions/erf.hpp:994
#4  0x00000001000cd4e8 in boost::math::detail::erf_initializer<long double, boost::math::policies::policy<boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>, mpl_::int_<53> >::init::init() at /Users/.../Frameworks/boost.framework/Headers/math/special_functions/erf.hpp:993
#5  0x00000001000cba6c in __cxx_global_var_init.77 at /Users/.../Frameworks/boost.framework/Headers/math/special_functions/erf.hpp:1038
#6  0x00000001200508d8 in ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) ()
#7  0x0000000120050a78 in ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) ()
#8  0x000000012004c0dc in ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) ()
#9  0x000000012004b280 in ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) ()
#10 0x000000012004b334 in ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) ()
#11 0x000000012003e088 in dyld::initializeMainExecutable() ()
#12 0x0000000120042130 in dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) ()
#13 0x000000012003d044 in _dyld_start ()

It fails when initializing the static vars in the erf.hpp file.

Has anybody any idea how to solve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions