Boost C++ Libraries: Ticket #12948: Unexpected snprintf result is on Android ARM https://svn.boost.org/trac10/ticket/12948 <p> I observe strange results from snprintf function: the function returns "0x34567890E20242C1" instead 0x0BCDEF1234567890. It "shifts" number! </p> <p> notes: </p> <ol><li>it is reproduced on boost_1_63_0 &amp; boost_1_64_0_b2. </li><li>is not reproduced on boost_1_62_0 </li><li>device: Android Marshmallow arm64-v8a </li><li>android-ndk-<a class="changeset" href="https://svn.boost.org/trac10/changeset/14" title="*** empty log message *** ">r14</a>-windows-x86_64 is used (by Android Studio). "windows-x86_64" is architecture an application is build on </li><li>test executable architecture is armeabi-v7a </li></ol><p> Used compiler flags: </p> <pre class="wiki"> -fexceptions -std=c++14 -DBOOST_NO_TYPEID -DBOOST_EXECUTION_CONTEXT=1 -fno-rtti </pre><p> Output: </p> <pre class="wiki">D/boostTest: void showBuildType() 58 debug build D/boostTest: void boostContextTest2() 65 D/boostTest: void boostContextTest2() 67 calling WITHOUT fiber D/boostTest: void callsnprintf() 36 D/boostTest: result 18 0x0BCDEF1234567890 D/boostTest: void callsnprintf() 38 D/boostTest: void boostContextTest2() 71 calling WITH fiber D/boostTest: void FiberProc2(void *) 44 D/boostTest: void callsnprintf() 36 D/boostTest: result 18 0x34567890E202434A D/boostTest: void ensureFailed() 10 ENSURE HAS FAILED </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12948 Trac 1.4.3 Lev Sch <zorechfan@…> Tue, 04 Apr 2017 19:54:34 GMT attachment set https://svn.boost.org/trac10/ticket/12948 https://svn.boost.org/trac10/ticket/12948 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boostTest.cpp</span> </li> </ul> Ticket olli Wed, 05 Apr 2017 04:32:34 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/12948#comment:1 https://svn.boost.org/trac10/ticket/12948#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">duplicate</span> </li> </ul> <p> seams to be a bug in NDK-<a class="changeset" href="https://svn.boost.org/trac10/changeset/14" title="*** empty log message *** ">r14</a> - see Ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/12799" title="#12799: Bugs: Crash occurs inside fiber inside sscanf on Android (closed: worksforme)">#12799</a> </p> Ticket Lev Sch <zorechfan@…> Wed, 05 Apr 2017 09:29:25 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/12948#comment:2 https://svn.boost.org/trac10/ticket/12948#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">duplicate</span> </li> </ul> <p> Ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/12799" title="#12799: Bugs: Crash occurs inside fiber inside sscanf on Android (closed: worksforme)">#12799</a>, comment 14 says: "are not reproduced on android-ndk-<a class="changeset" href="https://svn.boost.org/trac10/changeset/14" title="*** empty log message *** ">r14</a>". So I must reopen this ticket. </p> <p> Feel free to use me as "remote debugger" to catch a bug. </p> Ticket anonymous Wed, 05 Apr 2017 10:35:40 GMT <link>https://svn.boost.org/trac10/ticket/12948#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:3</guid> <description> <p> On ORDOID-X (ARMv7) + Linaro Distr. the code compiles (unit-tests are OK). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 05 Apr 2017 10:37:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:4</guid> <description> <p> cite from Ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/12799" title="#12799: Bugs: Crash occurs inside fiber inside sscanf on Android (closed: worksforme)">#12799</a>: </p> <p> "Both sscanf and cpp_rational cases are reproduced on android-ndk-<a class="changeset" href="https://svn.boost.org/trac10/changeset/14" title="*** empty log message *** ">r14</a> without "-mstackrealign" compiler flag. And both stop reproduce if the flag is added. So, I think this ticket is for Android and not for Boost library." </p> <p> So what is true? </p> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Wed, 05 Apr 2017 10:40:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:5</guid> <description> <p> android-ndk-<a class="changeset" href="https://svn.boost.org/trac10/changeset/14" title="*** empty log message *** ">r14</a> by default (out of box) has "-mstackrealign" flag. My custom build system is not used the flag. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Wed, 05 Apr 2017 11:34:14 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:6</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/12948#comment:5" title="Comment 5">Lev Sch &lt;zorechfan@…&gt;</a>: </p> <blockquote class="citation"> <p> android-ndk-<a class="changeset" href="https://svn.boost.org/trac10/changeset/14" title="*** empty log message *** ">r14</a> by default (out of box) has "-mstackrealign" flag. My custom build system is not used the flag. </p> </blockquote> <p> So the failure from <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/12799" title="#12799: Bugs: Crash occurs inside fiber inside sscanf on Android (closed: worksforme)">#12799</a> can not be reproduced with "-mstackrealign"! Right? </p> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Wed, 05 Apr 2017 11:39:39 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:7</guid> <description> <p> Right for android-ndk-<a class="changeset" href="https://svn.boost.org/trac10/changeset/14" title="*** empty log message *** ">r14</a>. And not right for android-ndk-r13b. Note: ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/12799" title="#12799: Bugs: Crash occurs inside fiber inside sscanf on Android (closed: worksforme)">#12799</a> is for x86_32 arch. And this ticket is for Arm. </p> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Wed, 05 Apr 2017 12:00:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:8</guid> <description> <p> I have executed standard tests. </p> <p> Inputs: </p> <pre class="wiki">boost_1_64_0_b2, ndk-r14, files: ${BOOST_ROOT}/libs/context/src/asm/jump_arm_aapcs_elf_gas.S ${BOOST_ROOT}/libs/context/src/asm/make_arm_aapcs_elf_gas.S ${BOOST_ROOT}/libs/context/src/asm/ontop_arm_aapcs_elf_gas.S compiler flags: -fexceptions -std=c++14 -DBOOST_NO_TYPEID -DBOOST_EXECUTION_CONTEXT=1 -fno-rtti </pre><p> Results: </p> <pre class="wiki">${BOOST_ROOT}/libs/context/test/test_apply.cpp OK ${BOOST_ROOT}/libs/context/test/test_callcc.cpp FAIL "BOOST_CHECK_EQUAL( i, 2);" ${BOOST_ROOT}/libs/context/test/test_execution_context.cpp FAIL, crash inside test_prealloc ${BOOST_ROOT}/libs/context/test/test_fcontext.cpp OK ${BOOST_ROOT}/libs/context/test/test_invoke.cpp OK </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Wed, 05 Apr 2017 12:56:14 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:9</guid> <description> <p> could you use/execute the unit-tests, please </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 05 Apr 2017 13:02:49 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:10</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/12948#comment:7" title="Comment 7">Lev Sch &lt;zorechfan@…&gt;</a>: </p> <blockquote class="citation"> <p> Right for android-ndk-<a class="changeset" href="https://svn.boost.org/trac10/changeset/14" title="*** empty log message *** ">r14</a>. And not right for android-ndk-r13b. Note: ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/12799" title="#12799: Bugs: Crash occurs inside fiber inside sscanf on Android (closed: worksforme)">#12799</a> is for x86_32 arch. And this ticket is for Arm. </p> </blockquote> <p> unit-tests on ARMv7/Linux pass why are you sure that this is not again a problem of the android-ndk? </p> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Wed, 05 Apr 2017 16:13:29 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:11</guid> <description> <blockquote class="citation"> <p> unit-tests on ARMv7/Linux pass why are you sure that this is not again a problem of the android-ndk? </p> </blockquote> <ol><li>Is Android platform supported by boost::context? </li><li>Are you try to execute boost::context tests by yours hands on Android + ndk-<a class="changeset" href="https://svn.boost.org/trac10/changeset/14" title="*** empty log message *** ">r14</a>? </li><li>If not supported then I go away. If it is supported then let's try to fix problem. </li></ol><p> May be it is again android developers issue... But why it is not reproduced on boost_1_62_0... I have no idea. </p> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Wed, 05 Apr 2017 16:19:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:12</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/12948#comment:9" title="Comment 9">olli</a>: </p> <blockquote class="citation"> <p> could you use/execute the unit-tests, please </p> </blockquote> <p> I am gladly to do. Which unit tests I should to execute? </p> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Wed, 05 Apr 2017 17:50:30 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:13 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:13</guid> <description> <p> I have found way to run tests by using &lt;boost/test/unit_test.hpp&gt;. </p> <p> output: </p> <pre class="wiki">04-05 20:42:28.043 5756 5756 D boostTest: void runBoostTests() 100 04-05 20:42:28.043 5756 5756 D boostTest: Running 13 test cases... 04-05 20:42:28.043 5756 5756 D boostTest: C:/lib/boost_1_64_0_b2/boost_1_64_0/libs/context/test/test_callcc.cpp(352): error: in "Boost.Context: callcc test suite/_test_ontop": check i == 2 has failed [-2 != 2] 04-05 20:42:28.043 5756 5756 D boostTest: void runBoostTests() 175 END OF TESTS </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Wed, 05 Apr 2017 18:06:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:14 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:14</guid> <description> <p> I think I've found the problem - was a misaligned start address of the stack. The problem was only triggered by the snprintf()-test, the other tests executed before did succeed. </p> <p> Could you fetch the latest sources from branch develop and test it on Android, please. I've checked ODROID-X (armv7l) with Linearo. </p> <p> The unit-tests are contained in the sub-directory 'test' (run with b2). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Wed, 05 Apr 2017 19:16:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:15 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:15</guid> <description> <p> commit 64d8d1445b46fe27042af165749538ce79b674fa is important </p> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Wed, 05 Apr 2017 21:23:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:16 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:16</guid> <description> <p> ${BOOST_ROOT}/libs/context/test/test_apply.cpp </p> <pre class="wiki">04-05 23:21:31.035 20005-20005/com.example.hellojni D/boostTest: void runBoostTests() 91 BEGIN TESTS 04-05 23:21:31.049 20005-20005/com.example.hellojni D/boostTest: void runBoostTests() 100 Running 7 test cases... 04-05 23:21:31.049 20005-20005/com.example.hellojni D/boostTest: void runBoostTests() 175 END OF TESTS </pre><p> ${BOOST_ROOT}/libs/context/test/test_callcc.cpp </p> <pre class="wiki">Error:(598, 17) error: no member named 'snprintf' in namespace 'std'; did you mean simply 'snprintf'? </pre><p> after compile error is fixed and BOOST_STATIC_ASSERT is added: </p> <pre class="wiki">04-05 23:27:49.215 21852-21852/? D/boostTest: void runBoostTests() 91 BEGIN TESTS 04-05 23:27:49.233 21852-21852/? D/boostTest: void runBoostTests() 100 Running 15 test cases... C:/temp/boostDevelop/boost/libs/context/test/test_callcc.cpp(355): error: in "Boost.Context: callcc test suite/_test_ontop": check i == 2 has failed [-2 != 2] 04-05 23:27:49.233 21852-21852/? D/boostTest: void runBoostTests() 175 END OF TESTS </pre><p> changed function text: </p> <pre class="wiki">void test_snprintf() { ctx::continuation c = ctx::callcc( []( ctx::continuation &amp;&amp; c) { { const char *fmt = "sqrt(2) = %f"; char buf[15]; snprintf( buf, sizeof( buf), fmt, std::sqrt( 2) ); BOOST_CHECK( 0 &lt; sizeof( buf) ); BOOST_ASSERT( std::string("sqrt(2) = 1.41") == std::string( buf) ); } { std::uint64_t n = 0xbcdef1234567890; const char *fmt = "0x%016llX"; BOOST_STATIC_ASSERT(sizeof(unsigned long long int)==sizeof(std::uint64_t)); // llX format char buf[100]; snprintf( buf, sizeof( buf), fmt, n); BOOST_ASSERT( std::string("0x0BCDEF1234567890") == std::string( buf) ); } return std::move( c); }); } </pre><p> ${BOOST_ROOT}/libs/context/test/test_execution_context.cpp </p> <pre class="wiki"> 04-05 23:30:55.313 22059 22059 D boostTest: void runBoostTests() 91 BEGIN TESTS --------- beginning of crash 04-05 23:30:55.326 22059 22059 F libc : Fatal signal 7 (SIGBUS), code 1, fault addr 0xe9ae1fd2 in tid 22059 (xample.hellojni) ********** Crash dump: ********** Build fingerprint: 'HighScreen/PowerRageEvo/PowerRageEvo:6.0/MRA58K/1473872291:user/release-keys' pid: 22059, tid: 22059, name: xample.hellojni &gt;&gt;&gt; com.example.hellojni &lt;&lt;&lt; signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0xe9ae1fd2 Stack frame 04-05 23:30:55.401 22108 22108 I AEE/AED : #00 pc 000fc808 /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZNSt13__atomic_baseIjEppEv+23): Routine std::__atomic_base&lt;unsigned int&gt;::operator++() at C:/lib/AndroidStudioSdk/1/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include\bits/atomic_base.h:411 Stack frame 04-05 23:30:55.401 22108 22108 I AEE/AED : #01 pc 000fc7e7 /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZN5boost7context6detail21intrusive_ptr_add_refEPNS1_17activation_recordE+14): Routine boost::context::detail::intrusive_ptr_add_ref(boost::context::detail::activation_record*) at C:/temp/boostDevelop/boost/libs/context/include\boost/context/execution_context_v1.hpp:138 Stack frame 04-05 23:30:55.401 22108 22108 I AEE/AED : #02 pc 000fc77f /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZN5boost13intrusive_ptrINS_7context6detail17activation_recordEEC2EPS3_b+62): Routine intrusive_ptr at C:/temp/boostDevelop/boost/libs/smart_ptr/include\boost/smart_ptr/intrusive_ptr.hpp:69 (discriminator 2) Stack frame 04-05 23:30:55.401 22108 22108 I AEE/AED : #03 pc 001857f1 /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZN5boost7context17execution_contextC2INS0_21basic_fixedsize_stackINS0_12stack_traitsEEERFviPvEJiEEESt15allocator_arg_tNS0_12preallocatedET_OT0_DpOT1_+180): Routine execution_context&lt;boost::context::basic_fixedsize_stack&lt;boost::context::stack_traits&gt;, void (&amp;)(int, void *), int&gt; at C:/temp/boostDevelop/boost/libs/context/include\boost/context/execution_context_v1.hpp:399 (discriminator 3) Stack frame 04-05 23:30:55.401 22108 22108 I AEE/AED : #04 pc 0018557f /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_Z13test_preallocv+154): Routine test_prealloc() at C:\temp\boostDevelop\boost\libs\context\test/test_execution_context_v1.impl:182 (discriminator 3) Stack frame 04-05 23:30:55.401 22108 22108 I AEE/AED : #05 pc 0018b0ed /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZN5boost6detail8function22void_function_invoker0IPFvvEvE6invokeERNS1_15function_bufferE+16): Routine boost::detail::function::void_function_invoker0&lt;void (*)(), void&gt;::invoke(boost::detail::function::function_buffer&amp;) at C:/temp/boostDevelop/boost/libs/function/include\boost/function/function_template.hpp:118 Stack frame 04-05 23:30:55.401 22108 22108 I AEE/AED : #06 pc 00169c2b /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZNK5boost9function0IvEclEv+86): Routine boost::function0&lt;void&gt;::operator()() const at C:/temp/boostDevelop/boost/libs/function/include\boost/function/function_template.hpp:759 (discriminator 1) Stack frame 04-05 23:30:55.401 22108 22108 I AEE/AED : #07 pc 00169bcb /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZN5boost6detail7forwardclEv+14): Routine boost::detail::forward::operator()() at C:/temp/boostDevelop/boost/libs/test/include\boost/test/impl/execution_monitor.ipp:1300 Stack frame 04-05 23:30:55.401 22108 22108 I AEE/AED : #08 pc 0016996b /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZN5boost6detail8function21function_obj_invoker0INS0_7forwardEiE6invokeERNS1_15function_bufferE+14): Routine boost::detail::function::function_obj_invoker0&lt;boost::detail::forward, int&gt;::invoke(boost::detail::function::function_buffer&amp;) at C:/temp/boostDevelop/boost/libs/function/include\boost/function/function_template.hpp:138 Stack frame 04-05 23:30:55.401 22108 22108 I AEE/AED : #09 pc 001697a3 /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZNK5boost9function0IiEclEv+86): Routine boost::function0&lt;int&gt;::operator()() const at C:/temp/boostDevelop/boost/libs/function/include\boost/function/function_template.hpp:759 (discriminator 1) Stack frame 04-05 23:30:55.401 22108 22108 I AEE/AED : #10 pc 0010be43 /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZN5boost6detail9do_invokeINS_10shared_ptrINS0_22translator_holder_baseEEENS_8functionIFivEEEEEiRKT_RKT0_+54): Routine int boost::detail::do_invoke&lt;boost::shared_ptr&lt;boost::detail::translator_holder_base&gt;, boost::function&lt;int ()&gt; &gt;(boost::shared_ptr&lt;boost::detail::translator_holder_base&gt; const&amp;, boost::function&lt;int ()&gt; const&amp;) at C:/temp/boostDevelop/boost/libs/test/include\boost/test/impl/execution_monitor.ipp:281 (discriminator 2) Stack frame 04-05 23:30:55.401 22108 22108 I AEE/AED : #11 pc 0010bc5d /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZN5boost17execution_monitor13catch_signalsERKNS_8functionIFivEEE+296): Routine boost::execution_monitor::catch_signals(boost::function&lt;int ()&gt; const&amp;) at C:/temp/boostDevelop/boost/libs/test/include\boost/test/impl/execution_monitor.ipp:864 Stack frame 04-05 23:30:55.401 22108 22108 I AEE/AED : #12 pc 0010c01f /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZN5boost17execution_monitor7executeERKNS_8functionIFivEEE+94): Routine boost::execution_monitor::execute(boost::function&lt;int ()&gt; const&amp;) at C:/temp/boostDevelop/boost/libs/test/include\boost/test/impl/execution_monitor.ipp:1203 Stack frame 04-05 23:30:55.401 22108 22108 I AEE/AED : #13 pc 001069d7 /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZN5boost17execution_monitor8vexecuteERKNS_8functionIFvvEEE+66): Routine boost::execution_monitor::vexecute(boost::function&lt;void ()&gt; const&amp;) at C:/temp/boostDevelop/boost/libs/test/include\boost/test/impl/execution_monitor.ipp:1309 Stack frame 04-05 23:30:55.401 22108 22108 I AEE/AED : #14 pc 001185dd /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZN5boost9unit_test19unit_test_monitor_t21execute_and_translateERKNS_8functionIFvvEEEj+204): Routine boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function&lt;void ()&gt; const&amp;, unsigned int) at C:/temp/boostDevelop/boost/libs/test/include\boost/test/impl/unit_test_monitor.ipp:46 Stack frame 04-05 23:30:55.402 22108 22108 I AEE/AED : #15 pc 0010a08f /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZN5boost9unit_test9framework5state17execute_test_treeEmjPKNS2_23random_generator_helperE+3894): Routine boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned int, boost::unit_test::framework::state::random_generator_helper const*) at C:/temp/boostDevelop/boost/libs/test/include\boost/test/impl/framework.ipp:717 (discriminator 1) Stack frame 04-05 23:30:55.402 22108 22108 I AEE/AED : #16 pc 00109c61 /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZN5boost9unit_test9framework5state17execute_test_treeEmjPKNS2_23random_generator_helperE+2824): Routine boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned int, boost::unit_test::framework::state::random_generator_helper const*) at C:/temp/boostDevelop/boost/libs/test/include\boost/test/impl/framework.ipp:666 Stack frame 04-05 23:30:55.402 22108 22108 I AEE/AED : #17 pc 00109c61 /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZN5boost9unit_test9framework5state17execute_test_treeEmjPKNS2_23random_generator_helperE+2824): Routine boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned int, boost::unit_test::framework::state::random_generator_helper const*) at C:/temp/boostDevelop/boost/libs/test/include\boost/test/impl/framework.ipp:666 Stack frame 04-05 23:30:55.402 22108 22108 I AEE/AED : #18 pc 001087b5 /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZN5boost9unit_test9framework3runEmb+1268): Routine boost::unit_test::framework::run(unsigned long, bool) at C:/temp/boostDevelop/boost/libs/test/include\boost/test/impl/framework.ipp:1442 (discriminator 1) Stack frame 04-05 23:30:55.402 22108 22108 I AEE/AED : #19 pc 001181f3 /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_ZN5boost9unit_test14unit_test_mainEPFPNS0_10test_suiteEiPPcEiS4_+954): Routine boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) at C:/temp/boostDevelop/boost/libs/test/include\boost/test/impl/unit_test_main.ipp:231 Stack frame 04-05 23:30:55.402 22108 22108 I AEE/AED : #20 pc 001209f3 /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_Z13runBoostTestsv+94): Routine runBoostTests() at C:\temp\asProjects\HelloJNI_test\HelloJNI\app\src\main\cpp/runBoostTests.cpp:98 Stack frame 04-05 23:30:55.402 22108 22108 I AEE/AED : #21 pc 000fc5c5 /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (_Z16boostContextTestv+4): Routine boostContextTest() at C:\temp\asProjects\HelloJNI_test\HelloJNI\app\src\main\cpp/boostTest.cpp:85 Stack frame 04-05 23:30:55.402 22108 22108 I AEE/AED : #22 pc 000fbfa7 /data/app/com.example.hellojni-1/lib/arm/libhello-jni.so (Java_com_example_hellojni_HelloJni_stringFromJNI+18): Routine Java_com_example_hellojni_HelloJni_stringFromJNI at C:\temp\asProjects\HelloJNI_test\HelloJNI\app\src\main\cpp/hello-jni.cpp:64 Stack frame 04-05 23:30:55.402 22108 22108 I AEE/AED : #23 pc 000ea779 /system/lib/libart.so (art_quick_generic_jni_trampoline+40) Stack frame 04-05 23:30:55.402 22108 22108 I AEE/AED : #24 pc 000e6081 /system/lib/libart.so (art_quick_invoke_stub_internal+64) Stack frame 04-05 23:30:55.402 22108 22108 I AEE/AED : #25 pc 003e8ed7 /system/lib/libart.so (art_quick_invoke_stub+170) Stack frame 04-05 23:30:55.402 22108 22108 I AEE/AED : #26 pc 007fd4ac [stack] </pre><p> ${BOOST_ROOT}/libs/context/test/test_fcontext.cpp </p> <pre class="wiki">Error:(177, 9) error: no member named 'snprintf' in namespace 'std'; did you mean simply 'snprintf'? </pre><p> after compile error is fixed and BOOST_STATIC_ASSERT is added: </p> <pre class="wiki">04-05 23:37:06.426 27390-27390/com.example.hellojni D/boostTest: void runBoostTests() 91 BEGIN TESTS 04-05 23:37:06.442 27390-27390/com.example.hellojni D/boostTest: void runBoostTests() 100 Running 12 test cases... 04-05 23:37:06.442 27390-27390/com.example.hellojni D/boostTest: void runBoostTests() 175 END OF TESTS </pre><p> changed function text: </p> <pre class="wiki">void f14( ctx::transfer_t t) { { const char *fmt = "sqrt(2) = %f"; char buf[15]; snprintf( buf, sizeof( buf), fmt, std::sqrt( 2) ); BOOST_CHECK( 0 &lt; sizeof( buf) ); BOOST_ASSERT( std::string("sqrt(2) = 1.41") == std::string( buf) ); } { std::uint64_t n = 0xbcdef1234567890; const char *fmt = "0x%016llX"; BOOST_STATIC_ASSERT(sizeof(unsigned long long int)==sizeof(std::uint64_t)); // llX format char buf[100]; snprintf( buf, sizeof( buf), fmt, n); BOOST_ASSERT( std::string("0x0BCDEF1234567890") == std::string( buf) ); } ctx::jump_fcontext( t.fctx, 0); } </pre><p> ${BOOST_ROOT}/libs/context/test/test_invoke.cpp </p> <pre class="wiki">04-05 23:38:22.171 28167-28167/? D/boostTest: void runBoostTests() 91 BEGIN TESTS 04-05 23:38:22.184 28167-28167/? D/boostTest: void runBoostTests() 100 Running 8 test cases... 04-05 23:38:22.184 28167-28167/? D/boostTest: void runBoostTests() 175 END OF TESTS </pre><p> Note about these lines: </p> <pre class="wiki">BOOST_ASSERT( std::string("0x0BCDEF1234567890") == std::string( buf) ); </pre><p> BOOST_ASSERT checks only if debug build. Release build does nothing. I recomend to use BOOST_TEST instead. See <a href="http://www.boost.org/doc/libs/1_63_0/libs/test/doc/html/boost_test/testing_tools/boost_test_universal_macro.html">http://www.boost.org/doc/libs/1_63_0/libs/test/doc/html/boost_test/testing_tools/boost_test_universal_macro.html</a> </p> <p> Note about std::string( buf). I think, that buffer size should be sent to std::string. For example: </p> <pre class="wiki">std::string(buf,15) </pre><p> If replace file "make_arm_aapcs_elf_gas.S" by corresponding file from boost_1_64_0_b2 then test_callcc.cpp will fail: </p> <pre class="wiki">04-05 23:54:55.186 28365 28365 D boostTest: void runBoostTests() 91 BEGIN TESTS --------- beginning of crash 04-05 23:54:55.206 28365 28365 F libc : C:\temp\boostDevelop\boost\libs\context\test\test_callcc.cpp:600: auto test_snprintf()::(anonymous class)::operator()(ctx::continuation &amp;&amp;) const: assertion "std::string("sqrt(2) = 1.41") == std::string( buf)" failed </pre><p> The fix is working! Thank you. </p> <p> Tomorrow I will test the fix on a real application. </p> <p> It is time to sleep... </p> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Thu, 06 Apr 2017 04:38:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:17 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:17</guid> <description> <p> I'm confused by your lengthly output - does the fix work or not? I'm wondering of 'error: no member named 'snprintf' in namespace 'std<em> - std::snprintf is in cstdio (is included in the unit-test files). I don't get 'callcc test suite/_test_ontop": check i == 2 has failed [-2 != 2]' on ARM/Linux. </em></p> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Thu, 06 Apr 2017 06:11:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:18 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:18</guid> <description> <p> better you replace the complete source of boost.context </p> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Thu, 06 Apr 2017 09:46:57 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:19 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:19</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/12948#comment:17" title="Comment 17">olli</a>: </p> <blockquote class="citation"> <p> I'm confused by your lengthly output - does the fix work or not? </p> </blockquote> <p> The fix is works. </p> <blockquote class="citation"> <p> I'm wondering of 'error: no member named 'snprintf' in namespace 'std<em> - std::snprintf is in cstdio (is included in the unit-test files). </em></p> </blockquote> <p> Yes. Compilation error is present. I fixed it by removing "std::" prefix. snprintf is not a member of "std" namespace. See example: <a class="ext-link" href="http://www.cplusplus.com/reference/cstdio/snprintf/"><span class="icon">​</span>http://www.cplusplus.com/reference/cstdio/snprintf/</a> </p> <blockquote class="citation"> <p> I don't get 'callcc test suite/_test_ontop": check i == 2 has failed [-2 != 2]' on ARM/Linux. </p> </blockquote> <p> And I get... </p> <p> All my words in comment 16 are related to SHA-1: 14d05c5553969671b5253617585efe9970295a6c commit. One exception: words started at "If replace" are related to a modified version. I do the modification to make ensure that test fails if bug is present. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Thu, 06 Apr 2017 10:11:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:20 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:20</guid> <description> <p> It's hard to read the output of your unit-test runs. I've problems to decide if the code still contains the bug or if it still contains other bugs or if it works correctly. </p> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Thu, 06 Apr 2017 11:00:51 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:21 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:21</guid> <description> <p> Ok. I will execute only unmodified tests. </p> <p> I removed previous repository and checked out new, by using this command: </p> <pre class="wiki">git clone --recursive https://github.com/boostorg/boost.git </pre><p> Test ${BOOST_ROOT}/libs/context/test/test_apply.cpp. Its output: </p> <pre class="wiki">04-06 13:59:20.214 30785-30785/? D/boostTest: void runBoostTests() 90 BEGIN TESTS 04-06 13:59:20.228 30785-30785/? D/boostTest: Running 7 test cases... 04-06 13:59:20.228 30785-30785/? D/boostTest: void runBoostTests() 176 END OF TESTS </pre> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Thu, 06 Apr 2017 11:02:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:22 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:22</guid> <description> <p> Must I run next test? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 06 Apr 2017 12:19:27 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:23 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:23</guid> <description> <p> unit-tests test_fcontext.cpp and test_callcc.cpp (C++11) is important </p> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Thu, 06 Apr 2017 12:29:06 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:24 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:24</guid> <description> <p> Test ${BOOST_ROOT}/libs/context/test/test_callcc.cpp compile failed: </p> <pre class="wiki">Error:(598, 17) error: no member named 'snprintf' in namespace 'std'; did you mean simply 'snprintf'? Error:(606, 17) error: no member named 'snprintf' in namespace 'std'; did you mean simply 'snprintf'? </pre><p> 598 and 606 are line numbers. 17 is a column. </p> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Thu, 06 Apr 2017 12:33:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:25 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:25</guid> <description> <p> Test ${BOOST_ROOT}/libs/context/test/test_fcontext.cpp . Compile failed: </p> <pre class="wiki">Error:(177, 9) error: no member named 'snprintf' in namespace 'std'; did you mean simply 'snprintf'? Error:(185, 9) error: no member named 'snprintf' in namespace 'std'; did you mean simply 'snprintf'? </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Thu, 06 Apr 2017 12:59:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:26 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:26</guid> <description> <p> I assume you did not fetch the latest version - in test_fcontext.cpp std::snprintf is replaced by snprintf (+stdio.h). In the case of test_callcc.cpp I'm surprised because test_callcc.cpp should only be compiled if C++11 is enabled. std::snprintf is contained in cstdio as described here: <a class="ext-link" href="http://en.cppreference.com/w/cpp/io/c/fprintf"><span class="icon">​</span>http://en.cppreference.com/w/cpp/io/c/fprintf</a> </p> <p> So to correct this: could you replace std::snprintf by snprintf and re-compile both files, please? </p> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Thu, 06 Apr 2017 13:47:30 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:27 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:27</guid> <description> <p> You are right. Default command did not get fresh version. I did following: </p> <pre class="wiki">1. cd ${BOOST_ROOT}\libs\context 2. remove all files and folders under current directory 3. git clone https://github.com/boostorg/context . </pre><p> ${BOOST_ROOT}/libs/context/test/test_fcontext.cpp </p> <pre class="wiki">04-06 16:38:57.660 6618-6618/? D/boostTest: void runBoostTests() 90 BEGIN TESTS 04-06 16:38:57.676 6618-6618/? D/boostTest: Running 12 test cases... 04-06 16:38:57.677 6618-6618/? D/boostTest: void runBoostTests() 176 END OF TESTS </pre><p> ${BOOST_ROOT}/libs/context/test/test_callcc.cpp </p> <pre class="wiki">Error:(598, 17) error: no member named 'snprintf' in namespace 'std'; did you mean simply 'snprintf'? Error:(606, 17) error: no member named 'snprintf' in namespace 'std'; did you mean simply 'snprintf'? </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Thu, 06 Apr 2017 13:58:31 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:28 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:28</guid> <description> <p> OK - test_fcontext.cpp seams to work. </p> <p> Is your compiler C++11 enabled? You could try to replace std::snprintf by snprintf in test_callcc() too? I guess that some feature checks returns true for your compiler, but the compiler is not C++1 complete. </p> <p> Because test_fcontext tests the fcontext-API that is used in callcc() and the unit-test for fcontext are OK, I would expect that callcc's unit-test will pass too. </p> <p> Could you verify it, please? </p> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Thu, 06 Apr 2017 14:04:03 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:29 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:29</guid> <description> <p> Note: I don't use b2 to generate executables and include files. I just "git clone" and put source files into compiler. </p> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Thu, 06 Apr 2017 14:19:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:30 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:30</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/12948#comment:28" title="Comment 28">olli</a>: </p> <blockquote class="citation"> <p> Is your compiler C++11 enabled? </p> </blockquote> <p> I think yes. I use -std=c++14 compiler flag. Additional information <a class="ext-link" href="https://developer.android.com/ndk/downloads/revision_history.html"><span class="icon">​</span>https://developer.android.com/ndk/downloads/revision_history.html</a> </p> <blockquote class="citation"> <p> You could try to replace std::snprintf by snprintf in test_callcc() too? </p> </blockquote> <p> I think will be better to get fresh commit from you. It give guarantee that no code desync will be. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Thu, 06 Apr 2017 15:33:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:31 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:31</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/12948#comment:30" title="Comment 30">Lev Sch &lt;zorechfan@…&gt;</a>: </p> <blockquote class="citation"> <blockquote class="citation"> <p> You could try to replace std::snprintf by snprintf in test_callcc() too? </p> </blockquote> <p> I think will be better to get fresh commit from you. It give guarantee that no code desync will be. </p> </blockquote> <p> I've updated the unit-tests (sscanf/snprintf in public namespace). Please note that I've re-written the git-history - you need commit 1abb5c4d32e166e83806ffdf6d69b418bef971c8 ty </p> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Thu, 06 Apr 2017 16:09:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:32 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:32</guid> <description> <p> ${BOOST_ROOT}/libs/context/test/test_callcc.cpp </p> <pre class="wiki">04-06 19:06:20.404 8214-8214/com.example.hellojni D/boostTest: void runBoostTests() 90 BEGIN TESTS 04-06 19:06:20.423 8214-8214/com.example.hellojni D/boostTest: Running 15 test cases... C:/temp/boostDevelop/boost/libs/context/test/test_callcc.cpp(358): error: in "Boost.Context: callcc test suite/_test_ontop": check i == 2 has failed [-2 != 2] 04-06 19:06:20.423 8214-8214/com.example.hellojni D/boostTest: void runBoostTests() 176 END OF TESTS </pre> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Thu, 06 Apr 2017 16:27:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:33 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:33</guid> <description> <p> another architecture have same error: </p> <pre class="wiki">04-06 19:21:26.745 13445-13445/? D/boostTest: ABI=arm64-v8a 04-06 19:21:26.745 13445-13445/? D/boostTest: void runBoostTests() 90 BEGIN TESTS 04-06 19:21:26.785 13445-13445/? D/boostTest: Running 15 test cases... C:/temp/boostDevelop/boost/libs/context/test/test_callcc.cpp(358): error: in "Boost.Context: callcc test suite/_test_ontop": check i == 2 has failed [-2 != 2] 04-06 19:21:26.785 13445-13445/? D/boostTest: void runBoostTests() 176 END OF TESTS </pre> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Thu, 06 Apr 2017 16:49:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:34 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:34</guid> <description> <pre class="wiki">04-06 16:48:08.952 4922-4922/com.example.hellojni D/boostTest: Executable ABI=x86_64 04-06 16:48:08.952 4922-4922/com.example.hellojni D/boostTest: void runBoostTests() 90 BEGIN TESTS 04-06 16:48:08.966 4922-4922/com.example.hellojni D/boostTest: Running 15 test cases... C:/temp/boostDevelop/boost/libs/context/test/test_callcc.cpp(358): error: in "Boost.Context: callcc test suite/_test_ontop": check i == 2 has failed [-2 != 2] 04-06 16:48:08.966 4922-4922/com.example.hellojni D/boostTest: void runBoostTests() 176 END OF TESTS </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Thu, 06 Apr 2017 17:00:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:35 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:35</guid> <description> <p> That's strange because fcontext unit-test works. </p> <p> If I run the unit-tests on ARM, x86_64, PPC systems using gcc, clang, msvc, intel compiler - the unit-tests pass too. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Thu, 06 Apr 2017 17:56:29 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:36 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:36</guid> <description> <p> do you use gcc or clang - maybe, if possible, you should try both </p> <p> is it possible to debug the code? I'd like to know the values of i,j at each step (before/after std::tie() etc.) </p> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Thu, 06 Apr 2017 18:09:17 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:37 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:37</guid> <description> <pre class="wiki">04-06 18:05:02.569 3639 3639 D boostTest: Executable ABI=x86_64 04-06 18:05:02.569 3639 3639 D boostTest: void runBoostTests() 91 BEGIN TESTS 04-06 18:05:02.578 3639 3639 D boostTest: Running 15 test cases... 04-06 18:05:02.578 3639 3639 D boostTest: lineA:352, i=3, j=1 04-06 18:05:02.578 3639 3639 D boostTest: lineD:240, i=3, j=1 04-06 18:05:02.578 3639 3639 D boostTest: lineB:359, x=1, y=3 04-06 18:05:02.578 3639 3639 D boostTest: lineE:244, i=-2, j=4 04-06 18:05:02.578 3639 3639 D boostTest: lineC:364, i=-2, j=4 04-06 18:05:02.578 3639 3639 D boostTest: C:/temp/boostDevelop/boost/libs/context/test/test_callcc.cpp(365): error: in "Boost.Context: callcc test suite/_test_ontop": check i == 2 has failed [-2 != 2] 04-06 18:05:02.578 3639 3639 D boostTest: void runBoostTests() 182 END OF TESTS </pre><pre class="wiki">ctx::continuation fn17( ctx::continuation &amp;&amp; c) { int i; int j; std::tie( i, j) = c.get_data&lt; int, int &gt;(); LOG_MACRO("lineD",i, j); for (;;) { c = c.resume( i, j); std::tie( i, j) = c.get_data&lt; int, int &gt;(); LOG_MACRO("lineE",i, j); } return std::move( c); } </pre><p> </p> <pre class="wiki"> { int i = 3, j = 1; LOG_MACRO("lineA",i, j); ctx::continuation c; c = ctx::callcc( fn17, i, j); c = c.resume_with( [](ctx::continuation &amp;&amp; c){ int x, y; std::tie( x, y) = c.get_data&lt; int, int &gt;(); LOG_MACRO("lineB",x, y); return std::make_tuple( x - y, x + y); }, i, j); std::tie( i, j) = c.get_data&lt; int, int &gt;(); LOG_MACRO("lineC",i, j); BOOST_CHECK_EQUAL( i, 2); BOOST_CHECK_EQUAL( j, 4); } </pre><pre class="wiki">#define LOG_MACRO(name,theX,theY) BOOST_TEST_MESSAGE( name &lt;&lt; ":" &lt;&lt; __LINE__ &lt;&lt; ", " #theX "=" &lt;&lt; (theX) &lt;&lt; ", " #theY "=" &lt;&lt; (theY)); </pre> </description> <category>Ticket</category> </item> <item> <author>emile.cormier.jr@…</author> <pubDate>Thu, 06 Apr 2017 19:08:29 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:38 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:38</guid> <description> <p> Are these fixes going to be introduced into Boost 1.64.0, or is it now too late for that? </p> <p> We have also observed strange snprintf behavior when it is called within the context of a Boost coroutine. The problem goes away if we revert back to Boost 1.62.0. </p> <p> Our platform is the Beaglebone Black, using this Debian image: <a class="ext-link" href="https://debian.beagleboard.org/images/bone-debian-8.7-iot-armhf-2017-03-19-4gb.img.xz"><span class="icon">​</span>https://debian.beagleboard.org/images/bone-debian-8.7-iot-armhf-2017-03-19-4gb.img.xz</a> </p> <p> Processor: AM355x, Cortex-A8, Neon, VFPv3 </p> <p> We are cross-compiling Boost and our application using Ubuntu's <code>g++-4.9-arm-linux-gnueabihf</code>, which is based on sources from Linaro GCC. </p> <p> Boost was built with: </p> <pre class="wiki">./b2 link=static variant=release threading=multi toolset=gcc-arm \ cxxflags=-std=c++11 target-os=linux abi=aapcs binary-format=elf \ architecture=arm address-model=32 </pre><p> We can attempt to run unit tests after Oliver and Lev sort things out. </p> <p> Oliver, our company will gladly ship you an ARM board (Beaglebone Black) if you need one. Our project is heavily dependent on Boost.Coroutine, and therefore Boost.Context as well. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Thu, 06 Apr 2017 19:14:06 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:39 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:39</guid> <description> <p> 04-06 18:05:02.578 3639 3639 D boostTest: lineD:240, i=3, j=1 04-06 18:05:02.578 3639 3639 D boostTest: lineB:359, x=1, y=3 </p> <p> here you see that the values of i and j are flipped - strange as I explained, I've run the same unit-tests on Windows using msvc, mingw for 32/64 and UNIX Systems on different architectures (including ARM) compiled with different compilers and the tests are OK. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Thu, 06 Apr 2017 19:19:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:40 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:40</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/12948#comment:38" title="Comment 38">emile.cormier.jr@…</a>: </p> <blockquote class="citation"> <p> Are these fixes going to be introduced into Boost 1.64.0, or is it now too late for that? </p> </blockquote> <p> the commit fixing the snprintf is merged to master and should be included in boost-1.64.0 </p> <blockquote class="citation"> <p> We have also observed strange snprintf behavior when it is called within the context of a Boost coroutine. The problem goes away if we revert back to Boost 1.62.0. </p> </blockquote> <p> I was forced to change the assembler implementations to get better performance </p> <blockquote class="citation"> <p> Our platform is the Beaglebone Black, using this Debian image: <a class="ext-link" href="https://debian.beagleboard.org/images/bone-debian-8.7-iot-armhf-2017-03-19-4gb.img.xz"><span class="icon">​</span>https://debian.beagleboard.org/images/bone-debian-8.7-iot-armhf-2017-03-19-4gb.img.xz</a> </p> <p> Processor: AM355x, Cortex-A8, Neon, VFPv3 </p> <p> We are cross-compiling Boost and our application using Ubuntu's <code>g++-4.9-arm-linux-gnueabihf</code>, which is based on sources from Linaro GCC. </p> <p> Boost was built with: </p> <pre class="wiki">./b2 link=static variant=release threading=multi toolset=gcc-arm \ cxxflags=-std=c++11 target-os=linux abi=aapcs binary-format=elf \ architecture=arm address-model=32 </pre><p> We can attempt to run unit tests after Oliver and Lev sort things out. </p> </blockquote> <p> you could test the sources (execut teh unit-tests) of boost.context from branch develop but gcc-4.9 can not deal with the overloads of callcc() (gcc-5.x does compile) but test_fcontext.cpp tests the basic functionality - so good verify at least the fcontext-API is correct (contains a snprintf test). </p> <blockquote class="citation"> <p> Oliver, our company will gladly ship you an ARM board (Beaglebone Black) if you need one. Our project is heavily dependent on Boost.Coroutine, and therefore Boost.Context as well. </p> </blockquote> <p> I've an armv7l board (ODROID-X V1) running Ubuntu + gcc-5 -&gt; no problems with boost.context </p> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Thu, 06 Apr 2017 19:43:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:41 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:41</guid> <description> <p> Tested again the newest sources from branch develop on ODROID-X (1.7 GHz Exynos 4412/ARM Cortex-A9, Ubuntu 16.04 + gcc-5.4.0) all test pass - no flip of i and j in test_ontop() </p> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Thu, 06 Apr 2017 20:08:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:42 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:42</guid> <description> <p> GCC 4.9 from android toolchain is not able to build: </p> <pre class="wiki">C:\temp\boostDevelop\boost\libs\context\test\test_callcc.cpp: In function 'void test_prealloc()': C:\temp\boostDevelop\boost\libs\context\test\test_callcc.cpp:320:109: error: call of overloaded 'callcc(const std::allocator_arg_t&amp;, boost::context::preallocated, boost::context::default_stack&amp;, boost::context::continuation (&amp;)(boost::context::continuation&amp;&amp;), int)' is ambiguous ctx::continuation c = ctx::callcc( std::allocator_arg, ctx::preallocated( sp, size, sctx), alloc, fn1, 7); ^ C:\temp\boostDevelop\boost\libs\context\test\test_callcc.cpp:320:109: note: candidates are: In file included from C:\temp\boostDevelop\boost\libs\context\test\test_callcc.cpp:29:0: </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 06 Apr 2017 20:33:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:43 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:43</guid> <description> <p> That's what I've told gcc-4.9 has problems with the overloads of callcc() - but gcc-5 dorsn't </p> </description> <category>Ticket</category> </item> <item> <author>Lev Sch <zorechfan@…></author> <pubDate>Thu, 06 Apr 2017 21:32:19 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12948#comment:44 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12948#comment:44</guid> <description> <p> I have no issues related to snprintf. My own tests are passed. I have no more items to keep this ticket opened. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Fri, 07 Apr 2017 04:11:01 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/12948#comment:45 https://svn.boost.org/trac10/ticket/12948#comment:45 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> OK, ty for supporting the lib - I'll close this ticket. </p> Ticket