Subject: [Boost-bugs] [Boost C++ Libraries] #11861: Using boost thread crash winrt store app on start on Windows 10 Phone devices
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-12-22 15:54:18
#11861: Using boost thread crash winrt store app on start on Windows 10 Phone
devices
-----------------------------------+-------------------------
Reporter: Mathieu <mvillegas@â¦> | Owner: anthonyw
Type: Bugs | Status: new
Milestone: To Be Determined | Component: thread
Version: Boost 1.60.0 | Severity: Showstopper
Keywords: |
-----------------------------------+-------------------------
When using boost thread in a Windows 10 (UAP) store app on a phone device,
the app can't be started (it works well on desktop computers).
How to reproduce the issue:
- Build boost thread and date_time (date_time seems required to link) from
the command line with: b2 --with-thread --with-date_time toolset=msvc-14.0
variant=debug link=static architecture=x86 windows-api=store
cxxflags="/AIC:/winrt"
Note that "C:/winrt" is a junction to "C:\Program Files (x86)\Microsoft
Visual Studio 14.0\VC\lib\store\references" where platform.winmd is (since
it seems required to build)
- Create a Blank C++ Windows 10 Universal app using Visual studio 2015.
- Edit Mainpage.xaml.cpp and add a call to boost::thread like:
boost::thread workerThread(workerFunc); where "workerFunc" is whatever
function you want. Add the required include file ( #include
<boost/thread/thread.hpp> ). In the link option, add boost thread lib.
- Now run the app in a phone emulator.
- Result: the app will crash at load time.
This happens on real phones with arm CPU too (with boost built with option
"architecture=arm").
This issue can't be reproduced on desktop computers using the same app
built for the emulator. Just run the app on your locale machine and it
will work.
Strange behavior we have found on Windows 10 phone emulator which may or
may not help you in your investigation:
- clean build the projet created above.
- run it on the emulator => the app crashes at load time
- comment the line with "boost::thread workerThread(workerFunc);"
- run the app => the app doesn't crash and works as expected
- uncomment the line, and run the app again (without rebuilding, just
click on the "run" button) => the app starts, and the thread works. You
are able to set a breakpoint and step into boost::thread constructor.
- rebuild the project (clean build) and run the app: => the app crashes at
load time.
I can't reproduce this strange behavior on real phones with arm CPU.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11861> 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:19 UTC