Opened 6 years ago

Closed 6 years ago

#12799 closed Bugs (worksforme)

Crash occurs inside fiber inside sscanf on Android

Reported by: Lev Sch <zorechfan@…> Owned by: olli
Milestone: To Be Determined Component: context
Version: Boost 1.63.0 Severity: Problem
Keywords: Cc:

Description

I started migrating from boost_1_62_0 to boost_1_63_0.

Migration failed: application crashed (no changes in my code).

I have constructed a minimal example that leads to crash. The test (boostTest.cpp file):

#include <cassert>
#include <android/log.h>
#include <boost/context/all.hpp>

#define TRACE(...) __android_log_print(ANDROID_LOG_DEBUG, "boostTest", __VA_ARGS__)

void callSscanf()
{
  TRACE("callSscanf begin");
  TRACE("callSscanf line=%d",__LINE__);
  if ( true ) {
    int n1=0;
    int n2=0;
    sscanf("1 23", "%d %d", &n1,&n2);
    assert(n1==1);
    assert(n2==23);
  }
  TRACE("callSscanf line=%d",__LINE__);
  if(true) {
    int n1=0;
    int n2=0;
    sscanf("1 jjj 23", "%d %*[j] %d", &n1,&n2);
    assert(n1==1);
    assert(n2==23);
  }
  TRACE("callSscanf end");
}

void FiberProc(void* arg)
{
  TRACE("FiberProc begin");
  boost::context::execution_context& mainCtx = *((boost::context::execution_context*)arg);
  callSscanf();
  mainCtx();
  TRACE("FiberProc unreachable!!!");
  assert(false); // not reachable
}

void boostContextTest()
{
  TRACE("boostContextTest start");
  {
    TRACE("boostContextTest calling WITHOUT fiber");
    callSscanf();
  }
  {
    TRACE("boostContextTest calling WITH fiber");
    boost::context::execution_context mainCtx(boost::context::execution_context::current());
    boost::context::execution_context childCtx(&FiberProc);
    childCtx(&mainCtx);
  }
  
  TRACE("boostContextTest end");
}

Attachments (2)

HelloJNI.zip (44.0 KB ) - added by Lev Sch <zorechfan@…> 6 years ago.
HelloJNI_cpp_rational.zip (46.3 KB ) - added by Lev Sch <zorechfan@…> 6 years ago.

Download all attachments as: .zip

Change History (17)

by Lev Sch <zorechfan@…>, 6 years ago

Attachment: HelloJNI.zip added

comment:1 by Lev Sch <zorechfan@…>, 6 years ago

Second sscanf is crashed. Notes:

  1. if boost_1_62_0 and callSscanf is called in main or from fiber context then no crash.
  2. if boost_1_63_0 and callSscanf is called in main context then no crash
  3. if boost_1_63_0 and callSscanf is called in fiber context then CRASH

Architecture: android x86(32bit) api23

Android Studio project is attached. Before build, updating path to boost is required in CMakeLists.txt.

by Lev Sch <zorechfan@…>, 6 years ago

Attachment: HelloJNI_cpp_rational.zip added

comment:2 by Lev Sch <zorechfan@…>, 6 years ago

I have found another way to reproduce by using boost::multiprecision::cpp_rational.

Steps to reproduce:

  1. Unpack HelloJNI_cpp_rational.zip into a folder
  2. open the unpaked folder by Android Studio
  3. Android Studio requests to use gradle wrapper. Click "OK".
  4. Android Studio opens the project.
  5. on left bottom place, click "Build Variants" tab
  6. on opened tab, set "Build Variant" to "x86Release"
  7. in HelloJNI\app\src\main\cpp\CMakeLists.txt update BOOST_ROOT
  8. Build and run app: click "play" button or Shift+F10

Results:

  1. boost_1_62_0 & (x86Release | x86Debug) => OK
  2. boost_1_63_0 & x86Debug => OK
  3. boost_1_63_0 & x86Release => crash
  4. boost_1_63_0 & x86Release & (*.S files from boost_1_62_0) => OK

Note: *.S files are:

jump_i386_sysv_elf_gas.S make_i386_sysv_elf_gas.S ontop_i386_sysv_elf_gas.S

comment:3 by olli, 6 years ago

Could you test the code from github + branch develop?

comment:4 by Lev Sch <zorechfan@…>, 6 years ago

Yes. I can git clone and test.

comment:5 by olli, 6 years ago

I need architecture + complete compiler output (errors)

comment:6 by Lev Sch <zorechfan@…>, 6 years ago

device architecture: x86_64 build output:

Executing tasks: [:app:assembleX86Release]

Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preX86ReleaseBuild UP-TO-DATE
:app:checkX86ReleaseManifest
:app:preX86DebugBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2340Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72340Library UP-TO-DATE
:app:prepareComAndroidSupportConstraintConstraintLayout100Alpha7Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42340Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2340Library UP-TO-DATE
:app:prepareX86ReleaseDependencies
:app:compileX86ReleaseAidl UP-TO-DATE
:app:compileX86ReleaseRenderscript UP-TO-DATE
:app:generateX86ReleaseBuildConfig UP-TO-DATE
:app:generateX86ReleaseResValues UP-TO-DATE
:app:generateX86ReleaseResources UP-TO-DATE
:app:mergeX86ReleaseResources UP-TO-DATE
:app:processX86ReleaseManifest UP-TO-DATE
:app:processX86ReleaseResources
:app:generateX86ReleaseSources
:app:incrementalX86ReleaseJavaCompilationSafeguard
:app:compileX86ReleaseJavaWithJavac
:app:compileX86ReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:app:generateJsonModelX86Release UP-TO-DATE
:app:externalNativeBuildX86Release
  building C:\temp\androidSandbox\HelloJNI_cpp_rational\HelloJNI\app\build\intermediates\cmake\x86\release\obj\x86\libhello-jni.so
:app:compileX86ReleaseSources
:app:lintVitalX86Release
:app:mergeX86ReleaseShaders
:app:compileX86ReleaseShaders
:app:generateX86ReleaseAssets
:app:mergeX86ReleaseAssets
:app:transformClassesWithDexForX86Release
:app:mergeX86ReleaseJniLibFolders
:app:transformNative_libsWithMergeJniLibsForX86Release
:app:transformNative_libsWithStripDebugSymbolForX86Release
:app:processX86ReleaseJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForX86Release
:app:validateSigningX86Release
:app:packageX86Release
:app:assembleX86Release

BUILD SUCCESSFUL

Total time: 13.593 secs

log:

03-15 14:09:42.548 2909-2909/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
03-15 14:09:42.549 2909-2909/? D/AndroidRuntime: CheckJNI is ON
03-15 14:09:42.549 2909-2909/? E/cutils-trace: Error opening trace file: Permission denied (13)
03-15 14:09:42.610 2909-2909/? W/art: Unexpected CPU variant for X86 using defaults: x86_64
03-15 14:09:42.637 2909-2909/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
03-15 14:09:42.649 2909-2909/? E/memtrack: Couldn't load memtrack module (No such file or directory)
03-15 14:09:42.649 2909-2909/? E/android.os.Debug: failed to load memtrack module: -2
03-15 14:09:42.650 2909-2909/? I/Radio-JNI: register_android_hardware_Radio DONE
03-15 14:09:42.657 2909-2909/? D/AndroidRuntime: Calling main entry com.android.commands.pm.Pm
03-15 14:09:42.673 2909-2909/? I/art: System.exit called, status: 0
03-15 14:09:42.673 2909-2909/? I/AndroidRuntime: VM exiting with result code 0.
03-15 14:09:57.948 2923-2923/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
03-15 14:09:57.949 2923-2923/? D/AndroidRuntime: CheckJNI is ON
03-15 14:09:57.949 2923-2923/? E/cutils-trace: Error opening trace file: Permission denied (13)
03-15 14:09:58.050 2923-2923/? W/art: Unexpected CPU variant for X86 using defaults: x86_64
03-15 14:09:58.053 2923-2923/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
03-15 14:09:58.065 2923-2923/? E/memtrack: Couldn't load memtrack module (No such file or directory)
03-15 14:09:58.065 2923-2923/? E/android.os.Debug: failed to load memtrack module: -2
03-15 14:09:58.065 2923-2923/? I/Radio-JNI: register_android_hardware_Radio DONE
03-15 14:09:58.074 2929-2929/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
03-15 14:09:58.075 2929-2929/? D/AndroidRuntime: CheckJNI is ON
03-15 14:09:58.075 2929-2929/? E/cutils-trace: Error opening trace file: Permission denied (13)
03-15 14:09:58.076 2923-2923/? D/AndroidRuntime: Calling main entry com.android.commands.wm.Wm
03-15 14:09:58.077 2923-2923/? D/AndroidRuntime: Shutting down VM
03-15 14:09:58.136 2929-2929/? W/art: Unexpected CPU variant for X86 using defaults: x86_64
03-15 14:09:58.140 2929-2929/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
03-15 14:09:58.150 2929-2929/? E/memtrack: Couldn't load memtrack module (No such file or directory)
03-15 14:09:58.150 2929-2929/? E/android.os.Debug: failed to load memtrack module: -2
03-15 14:09:58.150 2929-2929/? I/Radio-JNI: register_android_hardware_Radio DONE
03-15 14:09:58.159 2929-2929/? D/AndroidRuntime: Calling main entry com.android.commands.pm.Pm
                                                 
                                                 [ 03-15 14:09:58.183  1230: 1230 I/         ]
                                                 free_cache(1384400) avail 455221248
                                                 
                                                 
                                                 --------- beginning of system
03-15 14:09:58.256 1488-1516/system_process I/ActivityManager: Killing 2561:com.android.keychain/1000 (adj 906): empty for 1803s
03-15 14:09:58.275 1488-1516/system_process I/PackageManager.DexOptimizer: Running dexopt (dex2oat) on: /data/app/vmdl177924478.tmp/base.apk pkg=com.example.hellojni isa=x86 vmSafeMode=false debuggable=false target-filter=interpret-only oatDir = /data/app/vmdl177924478.tmp/oat sharedLibraries=null
03-15 14:09:58.290 2948-2948/? W/dex2oat: Unexpected CPU variant for X86 using defaults: x86
03-15 14:09:58.290 2948-2948/? W/dex2oat: Mismatch between dex2oat instruction set features (ISA: X86 Feature string: smp,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,-lock_add,-popcnt) and those of dex2oat executable (ISA: X86 Feature string: smp,ssse3,sse4.1,sse4.2,-avx,-avx2,-lock_add,popcnt) for the command line:
03-15 14:09:58.290 2948-2948/? W/dex2oat: /system/bin/dex2oat --zip-fd=6 --zip-location=base.apk --oat-fd=7 --oat-location=/data/app/vmdl177924478.tmp/oat/x86/base.odex --instruction-set=x86 --instruction-set-variant=x86 --instruction-set-features=default --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=interpret-only --swap-fd=9
03-15 14:09:58.290 2948-2948/? I/dex2oat: /system/bin/dex2oat --compiler-filter=interpret-only
03-15 14:09:58.291 2948-2948/? E/cutils-trace: Error opening trace file: Permission denied (13)
03-15 14:09:58.533 2948-2948/? W/dex2oat: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
03-15 14:09:58.542 2948-2950/? W/dex2oat: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
03-15 14:09:59.204 2948-2948/? I/dex2oat: dex2oat took 913.578ms (threads: 2) arena alloc=1648B (1648B) java alloc=2MB (2225080B) native alloc=3MB (3256296B) free=1940KB (1986584B)
03-15 14:09:59.211 1488-1503/system_process I/ActivityManager: Force stopping com.example.hellojni appid=10074 user=-1: installPackageLI
03-15 14:09:59.280 1488-1516/system_process I/PackageManager: Package com.example.hellojni codePath changed from /data/app/com.example.hellojni-1 to /data/app/com.example.hellojni-2; Retaining data and using new
03-15 14:09:59.280 1488-1516/system_process W/PackageManager: Code path for com.example.hellojni changing from /data/app/com.example.hellojni-1 to /data/app/com.example.hellojni-2
03-15 14:09:59.280 1488-1516/system_process W/PackageManager: Resource path for com.example.hellojni changing from /data/app/com.example.hellojni-1 to /data/app/com.example.hellojni-2
03-15 14:09:59.399 1488-1516/system_process I/art: Starting a blocking GC Explicit
03-15 14:09:59.439 1488-1516/system_process I/art: Explicit concurrent mark sweep GC freed 32364(1837KB) AllocSpace objects, 18(460KB) LOS objects, 32% free, 8MB/12MB, paused 754us total 35.984ms
                                                   
                                                   [ 03-15 14:09:59.443  1230: 1230 E/         ]
                                                   Couldn't opendir /data/app/vmdl177924478.tmp: No such file or directory
03-15 14:09:59.445 1488-1516/system_process I/ActivityManager: Force stopping com.example.hellojni appid=10074 user=0: pkg removed
03-15 14:09:59.449 1488-1532/system_process I/InputReader: Reconfiguring input devices.  changes=0x00000010
03-15 14:09:59.456 1488-1532/system_process I/InputReader: Reconfiguring input devices.  changes=0x00000010
03-15 14:09:59.465 2955-2955/? W/art: Unexpected CPU variant for X86 using defaults: x86_64
03-15 14:09:59.472 1488-1873/system_process I/ActivityManager: Start proc 2955:com.android.keychain/1000 for broadcast com.android.keychain/.KeyChainBroadcastReceiver
03-15 14:09:59.474 1488-1532/system_process I/InputReader: Reconfiguring input devices.  changes=0x00000010
03-15 14:09:59.479 2929-2929/? I/art: System.exit called, status: 0
03-15 14:09:59.479 2929-2929/? I/AndroidRuntime: VM exiting with result code 0.
03-15 14:09:59.490 2955-2955/com.android.keychain W/System: ClassLoader referenced unknown path: /system/app/KeyChain/lib/x86_64
03-15 14:09:59.522 1657-1657/com.android.phone E/PhoneInterfaceManager: [PhoneIntfMgr] getCarrierPackageNamesForIntent: No UICC
03-15 14:09:59.522 1657-1657/com.android.phone D/CarrierSvcBindHelper: No carrier app for: 0
03-15 14:09:59.522 1657-1657/com.android.phone E/PhoneInterfaceManager: [PhoneIntfMgr] getCarrierPackageNamesForIntent: No UICC
03-15 14:09:59.522 1657-1657/com.android.phone D/CarrierSvcBindHelper: No carrier app for: 0
03-15 14:09:59.523 1657-1657/com.android.phone D/CarrierConfigLoader: mHandler: 9 phoneId: 0
03-15 14:09:59.527 2955-2955/com.android.keychain W/ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1385 android.content.ContextWrapper.startService:613 android.content.ContextWrapper.startService:613 com.android.keychain.KeyChainBroadcastReceiver.onReceive:12 android.app.ActivityThread.handleReceiver:3011 
03-15 14:09:59.554 1488-1501/system_process W/VoiceInteractionManagerService: no available voice recognition services found for user 0
03-15 14:09:59.554 1488-1501/system_process W/LocationProviderProxy-network: Odd, no component found for service com.android.location.service.v3.NetworkLocationProvider
03-15 14:09:59.554 1488-1501/system_process W/GeocoderProxy: Odd, no component found for service com.android.location.service.GeocodeProvider
03-15 14:09:59.554 1488-1501/system_process W/GeofenceProxy: Odd, no component found for service com.android.location.service.GeofenceProvider
03-15 14:09:59.555 1488-1501/system_process W/ActivityRecognitionProxy: Odd, no component found for service com.android.location.service.ActivityRecognitionProvider
03-15 14:09:59.792 2978-2978/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
03-15 14:09:59.793 2978-2978/? D/AndroidRuntime: CheckJNI is ON
03-15 14:09:59.793 2978-2978/? E/cutils-trace: Error opening trace file: Permission denied (13)
03-15 14:09:59.854 2978-2978/? W/art: Unexpected CPU variant for X86 using defaults: x86_64
03-15 14:09:59.857 2978-2978/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
03-15 14:09:59.867 2978-2978/? E/memtrack: Couldn't load memtrack module (No such file or directory)
03-15 14:09:59.867 2978-2978/? E/android.os.Debug: failed to load memtrack module: -2
03-15 14:09:59.868 2978-2978/? I/Radio-JNI: register_android_hardware_Radio DONE
03-15 14:09:59.877 2978-2978/? D/AndroidRuntime: Calling main entry com.android.commands.am.Am
03-15 14:09:59.883 1488-1499/system_process I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.hellojni/.HelloJni} from uid 2000 on display 0
03-15 14:09:59.891 2978-2978/? D/AndroidRuntime: Shutting down VM
03-15 14:09:59.899 2987-2987/? W/art: Unexpected CPU variant for X86 using defaults: x86
03-15 14:09:59.903 1488-1596/system_process I/ActivityManager: Start proc 2987:com.example.hellojni/u0a74 for activity com.example.hellojni/.HelloJni
03-15 14:10:00.064 1568-1568/com.android.systemui W/asset: Asset path /data/app/com.example.hellojni-1/base.apk is neither a directory nor file (type=1).
03-15 14:10:00.064 1568-1568/com.android.systemui W/PackageManager: Failure retrieving resources for com.example.hellojni
03-15 14:10:00.064 1568-1568/com.android.systemui W/asset: Asset path /data/app/com.example.hellojni-1/base.apk is neither a directory nor file (type=1).
03-15 14:10:00.064 1568-1568/com.android.systemui W/PackageManager: Failure retrieving resources for com.example.hellojni
03-15 14:10:00.064 1568-1568/com.android.systemui W/asset: Asset path /data/app/com.example.hellojni-1/base.apk is neither a directory nor file (type=1).
03-15 14:10:00.064 1568-1568/com.android.systemui W/PackageManager: Failure retrieving resources for com.example.hellojni
03-15 14:10:00.164 2987-2987/com.example.hellojni D/boostTest: line void showBuildType() 38 release build
03-15 14:10:00.164 2987-2987/com.example.hellojni D/boostTest: line void boostContextTest2() 47
03-15 14:10:00.164 2987-2987/com.example.hellojni D/boostTest: line void boostContextTest2() 49 calling WITHOUT fiber
03-15 14:10:00.164 2987-2987/com.example.hellojni D/boostTest: line void boostContextTest2() 53 calling WITH fiber
03-15 14:10:00.164 2987-2987/com.example.hellojni D/boostTest: line void FiberProc2(void *) 26
                                                               
                                                               --------- beginning of crash
03-15 14:10:00.164 2987-2987/com.example.hellojni A/libc: Fatal signal 11 (SIGSEGV), code 128, fault addr 0x0 in tid 2987 (xample.hellojni)
                                                          
                                                          [ 03-15 14:10:00.165  1175: 1175 W/         ]
                                                          debuggerd: handling request: pid=2987 uid=10074 gid=10074 tid=2987
03-15 14:10:00.198 3006-3006/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-15 14:10:00.198 3006-3006/? A/DEBUG: Build fingerprint: 'Android/sdk_phone_x86_64/generic_x86_64:7.0/NYC/3245079:userdebug/test-keys'
03-15 14:10:00.198 3006-3006/? A/DEBUG: Revision: '0'
03-15 14:10:00.198 3006-3006/? A/DEBUG: ABI: 'x86'
03-15 14:10:00.198 3006-3006/? A/DEBUG: pid: 2987, tid: 2987, name: xample.hellojni  >>> com.example.hellojni <<<
03-15 14:10:00.198 3006-3006/? A/DEBUG: signal 11 (SIGSEGV), code 128 (SI_KERNEL), fault addr 0x0
03-15 14:10:00.198 3006-3006/? A/DEBUG:     eax 00000035  ebx d376978c  ecx 00000035  edx 3fe00000
03-15 14:10:00.198 3006-3006/? A/DEBUG:     esi 00000000  edi d3593850
03-15 14:10:00.198 3006-3006/? A/DEBUG:     xcs 00000023  xds 0000002b  xes 0000002b  xfs 0000006b  xss 0000002b
03-15 14:10:00.198 3006-3006/? A/DEBUG:     eip d36b6acf  ebp d3593850  esp d3593758  flags 00000202
03-15 14:10:00.198 3006-3006/? A/DEBUG: backtrace:
03-15 14:10:00.198 3006-3006/? A/DEBUG:     #00 pc 00018acf  /data/app/com.example.hellojni-2/lib/x86/libhello-jni.so (_ZN5boost14multiprecision8backends15cpp_int_backendILj0ELj0ELNS0_16cpp_integer_typeE1ELNS0_18cpp_int_check_typeE0ESaImEE20do_assign_arithmeticEeRKN4mpl_5bool_ILb0EEE+367)
03-15 14:10:00.198 3006-3006/? A/DEBUG:     #01 pc 0001864e  /data/app/com.example.hellojni-2/lib/x86/libhello-jni.so (_ZN5boost14multiprecision8backends16rational_adaptorINS1_15cpp_int_backendILj0ELj0ELNS0_16cpp_integer_typeE1ELNS0_18cpp_int_check_typeE0ESaImEEEEaSIeEENS_9enable_ifINS_17is_floating_pointIT_EERS8_E4typeESC_+126)
03-15 14:10:00.198 3006-3006/? A/DEBUG:     #02 pc 000180b7  /data/app/com.example.hellojni-2/lib/x86/libhello-jni.so (_Z23testCpp_rational_getValv+103)
03-15 14:10:00.198 3006-3006/? A/DEBUG:     #03 pc 000181b9  /data/app/com.example.hellojni-2/lib/x86/libhello-jni.so (_Z10FiberProc2Pv+73)
03-15 14:10:00.199 3006-3006/? A/DEBUG:     #04 pc 0001ee7b  /data/app/com.example.hellojni-2/lib/x86/libhello-jni.so (_ZN5boost7context17execution_context10entry_funcINS0_6detail14capture_recordINS0_21basic_fixedsize_stackINS0_12stack_traitsEEEPFvPvEJEEEEEvNS3_10transfer_tE+59)
03-15 14:10:00.199 3006-3006/? A/DEBUG:     #05 pc 0002263a  /data/app/com.example.hellojni-2/lib/x86/libhello-jni.so (make_fcontext+66)
                                        
                                        
                                        [ 03-15 14:10:00.418  1175: 1175 W/         ]
                                        debuggerd: resuming target 2987
03-15 14:10:00.418 1488-1507/system_process I/BootReceiver: Copying /data/tombstones/tombstone_04 to DropBox (SYSTEM_TOMBSTONE)
03-15 14:10:00.448 1226-1226/? I/Zygote: Process 2987 exited due to signal (11)
03-15 14:10:00.690 1488-3019/system_process W/ActivityManager:   Force finishing activity com.example.hellojni/.HelloJni
03-15 14:10:00.692 1488-3019/system_process W/ActivityManager: Exception thrown during pause
                                                               android.os.DeadObjectException
                                                                   at android.os.BinderProxy.transactNative(Native Method)
                                                                   at android.os.BinderProxy.transact(Binder.java:615)
                                                                   at android.app.ApplicationThreadProxy.schedulePauseActivity(ApplicationThreadNative.java:784)
                                                                   at com.android.server.am.ActivityStack.startPausingLocked(ActivityStack.java:1128)
                                                                   at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:3483)
                                                                   at com.android.server.am.ActivityStack.finishTopRunningActivityLocked(ActivityStack.java:3319)
                                                                   at com.android.server.am.ActivityStackSupervisor.finishTopRunningActivityLocked(ActivityStackSupervisor.java:1821)
                                                                   at com.android.server.am.AppErrors.handleAppCrashLocked(AppErrors.java:619)
                                                                   at com.android.server.am.AppErrors.makeAppCrashingLocked(AppErrors.java:481)
                                                                   at com.android.server.am.AppErrors.crashApplicationInner(AppErrors.java:357)
                                                                   at com.android.server.am.AppErrors.crashApplication(AppErrors.java:309)
                                                                   at com.android.server.am.ActivityManagerService.handleApplicationCrashInner(ActivityManagerService.java:13226)
                                                                   at com.android.server.am.NativeCrashListener$NativeCrashReporter.run(NativeCrashListener.java:86)
03-15 14:10:00.697 1218-1218/? E/lowmemorykiller: Error opening /proc/2987/oom_score_adj; errno=2
03-15 14:10:00.786 1220-1220/? D/gralloc: Registering a buffer in the process that created it. This may cause memory ordering problems.
03-15 14:10:00.786 1220-1220/? E/libEGL: called unimplemented OpenGL ES API
03-15 14:10:00.786 1220-1220/? E/SurfaceFlinger: glCheckFramebufferStatusOES error -816011848
03-15 14:10:00.786 1220-1220/? E/SurfaceFlinger: got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
03-15 14:10:00.787 1488-3019/system_process W/WindowManager: Screenshot failure taking screenshot for (480x800) to layer 22010
03-15 14:10:00.799 1488-1686/system_process W/art: Long monitor contention with owner NativeCrashReport (3019) at void com.android.server.am.AppErrors.crashApplicationInner(com.android.server.am.ProcessRecord, android.app.ApplicationErrorReport$CrashInfo)(AppErrors.java:328) waiters=0 in void com.android.server.am.ActivityManagerService$AppDeathRecipient.binderDied() for 350ms
03-15 14:10:00.799 1488-1686/system_process I/ActivityManager: Process com.example.hellojni (pid 2987) has died
03-15 14:10:00.799 1488-1488/system_process W/art: Long monitor contention with owner NativeCrashReport (3019) at void com.android.server.am.AppErrors.crashApplicationInner(com.android.server.am.ProcessRecord, android.app.ApplicationErrorReport$CrashInfo)(AppErrors.java:328) waiters=1 in int com.android.server.am.ActivityManagerService.broadcastIntent(android.app.IApplicationThread, android.content.Intent, java.lang.String, android.content.IIntentReceiver, int, java.lang.String, android.os.Bundle, java.lang.String[], int, android.os.Bundle, boolean, boolean, int) for 347ms
03-15 14:10:00.800 1488-1503/system_process W/art: Long monitor contention with owner NativeCrashReport (3019) at void com.android.server.am.AppErrors.crashApplicationInner(com.android.server.am.ProcessRecord, android.app.ApplicationErrorReport$CrashInfo)(AppErrors.java:328) waiters=2 in void com.android.server.am.ActivityStack$ActivityStackHandler.handleMessage(android.os.Message) for 334ms
03-15 14:10:00.812 1488-1596/system_process W/InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4871c08 attribute=android.view.inputmethod.EditorInfo@e418fa1, token = android.os.BinderProxy@d34b1e0
03-15 14:10:01.221 1488-1510/system_process I/WindowManager: Destroying surface Surface(name=Starting com.example.hellojni) called by com.android.server.wm.WindowStateAnimator.destroySurface:2014 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:881 com.android.server.wm.WindowState.removeLocked:1449 com.android.server.wm.WindowManagerService.removeWindowInnerLocked:2478 com.android.server.wm.AppWindowToken.destroySurfaces:365 com.android.server.wm.WindowStateAnimator.finishExit:565 com.android.server.wm.AppWindowAnimator.stepAnimationLocked:427 com.android.server.wm.WindowAnimator.updateAppWindowsLocked:196 
03-15 14:10:04.563 1488-1873/system_process I/ActivityManager: Killing 2706:com.android.documentsui/u0a7 (adj 906): empty for 1810s
03-15 14:10:08.285 1488-1874/system_process I/ActivityManager: Killing 2723:android.process.media/u0a8 (adj 906): empty for 1813s

comment:7 by Lev Sch <zorechfan@…>, 6 years ago

Symbolicated crash:

********** Crash dump: **********
Build fingerprint: 'Android/sdk_phone_x86_64/generic_x86_64:7.0/NYC/3245079:userdebug/test-keys'
pid: 2987, tid: 2987, name: xample.hellojni  >>> com.example.hellojni <<<
signal 11 (SIGSEGV), code 128 (SI_KERNEL), fault addr 0x0
Stack frame 03-15 14:10:00.198 3006-3006/? A/DEBUG:     #00 pc 00018acf  /data/app/com.example.hellojni-2/lib/x86/libhello-jni.so (_ZN5boost14multiprecision8backends15cpp_int_backendILj0ELj0ELNS0_16cpp_integer_typeE1ELNS0_18cpp_int_check_typeE0ESaImEE20do_assign_arithmeticEeRKN4mpl_5bool_ILb0EEE+367): Routine boost::multiprecision::backends::cpp_int_backend<0u, 0u, (boost::multiprecision::cpp_integer_type)1, (boost::multiprecision::cpp_int_check_type)0, std::allocator<unsigned long> >::do_assign_arithmetic(long double, mpl_::bool_<false> const&) at C:/lib/boost_1_63_0\boost/multiprecision/cpp_int.hpp:1294
Stack frame 03-15 14:10:00.198 3006-3006/? A/DEBUG:     #01 pc 0001864e  /data/app/com.example.hellojni-2/lib/x86/libhello-jni.so (_ZN5boost14multiprecision8backends16rational_adaptorINS1_15cpp_int_backendILj0ELj0ELNS0_16cpp_integer_typeE1ELNS0_18cpp_int_check_typeE0ESaImEEEEaSIeEENS_9enable_ifINS_17is_floating_pointIT_EERS8_E4typeESC_+126): Routine _ZN5boost14multiprecision8backends15cpp_int_backendILj0ELj0ELNS0_16cpp_integer_typeE1ELNS0_18cpp_int_check_typeE0ESaImEEaSIeEENS_11enable_if_cIXntsr5boost14multiprecision6detail17is_byte_containerIT_EE5valueERS6_E4typeES9_ at C:/lib/boost_1_63_0\boost/multiprecision/cpp_int.hpp:1311
Stack frame 03-15 14:10:00.198 3006-3006/? A/DEBUG:     #02 pc 000180b7  /data/app/com.example.hellojni-2/lib/x86/libhello-jni.so (_Z23testCpp_rational_getValv+103): Routine number<double> at C:/lib/boost_1_63_0\boost/multiprecision/number.hpp:53
Stack frame 03-15 14:10:00.198 3006-3006/? A/DEBUG:     #03 pc 000181b9  /data/app/com.example.hellojni-2/lib/x86/libhello-jni.so (_Z10FiberProc2Pv+73): Routine testCpp_rational_test() at C:\temp\androidSandbox\HelloJNI_cpp_rational\HelloJNI\app\src\main\cpp/boostTest.cpp:15
Stack frame 03-15 14:10:00.199 3006-3006/? A/DEBUG:     #04 pc 0001ee7b  /data/app/com.example.hellojni-2/lib/x86/libhello-jni.so (_ZN5boost7context17execution_context10entry_funcINS0_6detail14capture_recordINS0_21basic_fixedsize_stackINS0_12stack_traitsEEEPFvPvEJEEEEEvNS3_10transfer_tE+59): Routine _ZN5boost7context6detail6invokeIRPFvPvEJRS3_EEENSt9enable_ifIXntsr3std17is_member_pointerINSt5decayIT_E4typeEEE5valueENSt9result_ofIFOSA_DpOT0_EE4typeEE4typeESE_SH_ at C:/lib/boost_1_63_0\boost/context/detail/invoke.hpp:41 (discriminator 2)
Stack frame 03-15 14:10:00.199 3006-3006/? A/DEBUG:     #05 pc 0002263a  /data/app/com.example.hellojni-2/lib/x86/libhello-jni.so (make_fcontext+66): Routine trampoline at C:\\lib\\boost_1_63_0\\libs\\context\\src\\asm/make_i386_sysv_elf_gas.S:88

comment:8 by Lev Sch <zorechfan@…>, 6 years ago

Compiler options:

{
	"buildFiles" : 
	[
		"C:/temp/androidSandbox/HelloJNI_cpp_rational/HelloJNI/app/src/main/cpp/CMakeLists.txt"
	],
	"cFileExtensions" : [ "S" ],
	"cleanCommands" : 
	[
		"C:\\lib\\AndroidStudioSdk\\1\\cmake\\3.6.3155560\\bin\\cmake.exe --build C:\\temp\\androidSandbox\\HelloJNI_cpp_rational\\HelloJNI\\app\\.externalNativeBuild\\cmake\\x86Release\\x86 --target clean"
	],
	"cppFileExtensions" : [ "cpp" ],
	"libraries" : 
	{
		"hello-jni-Release-x86" : 
		{
			"abi" : "x86",
			"artifactName" : "hello-jni",
			"buildCommand" : "C:\\lib\\AndroidStudioSdk\\1\\cmake\\3.6.3155560\\bin\\cmake.exe --build C:\\temp\\androidSandbox\\HelloJNI_cpp_rational\\HelloJNI\\app\\.externalNativeBuild\\cmake\\x86Release\\x86 --target hello-jni",
			"buildType" : "release",
			"files" : 
			[
				
				{
					"flags" : "  -target i686-none-linux-android -gcc-toolchain C:/lib/AndroidStudioSdk/1/ndk-bundle/toolchains/x86-4.9/prebuilt/windows-x86_64 --sysroot=C:/lib/AndroidStudioSdk/1/ndk-bundle/platforms/android-23/arch-x86  -Dhello_jni_EXPORTS -IC:\\lib\\boost_1_63_0 -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\include -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\libs\\x86\\include -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\include\\backward  -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti  -O2 -DNDEBUG -O2 -DNDEBUG  -fPIC   -fexceptions -std=c++14 -DBOOST_NO_TYPEID -DBOOST_EXECUTION_CONTEXT=1 -fno-rtti  -c ",
					"src" : "C:/temp/androidSandbox/HelloJNI_cpp_rational/HelloJNI/app/src/main/cpp/hello-jni.cpp",
					"workingDirectory" : "C:/temp/androidSandbox/HelloJNI_cpp_rational/HelloJNI/app/.externalNativeBuild/cmake/x86Release/x86"
				},
				
				{
					"flags" : "  -target i686-none-linux-android -gcc-toolchain C:/lib/AndroidStudioSdk/1/ndk-bundle/toolchains/x86-4.9/prebuilt/windows-x86_64 --sysroot=C:/lib/AndroidStudioSdk/1/ndk-bundle/platforms/android-23/arch-x86  -Dhello_jni_EXPORTS -IC:\\lib\\boost_1_63_0 -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\include -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\libs\\x86\\include -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\include\\backward  -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti  -O2 -DNDEBUG -O2 -DNDEBUG  -fPIC   -fexceptions -std=c++14 -DBOOST_NO_TYPEID -DBOOST_EXECUTION_CONTEXT=1 -fno-rtti  -c ",
					"src" : "C:/temp/androidSandbox/HelloJNI_cpp_rational/HelloJNI/app/src/main/cpp/boostTest.cpp",
					"workingDirectory" : "C:/temp/androidSandbox/HelloJNI_cpp_rational/HelloJNI/app/.externalNativeBuild/cmake/x86Release/x86"
				},
				
				{
					"flags" : "  -target i686-none-linux-android -gcc-toolchain C:/lib/AndroidStudioSdk/1/ndk-bundle/toolchains/x86-4.9/prebuilt/windows-x86_64 --sysroot=C:/lib/AndroidStudioSdk/1/ndk-bundle/platforms/android-23/arch-x86  -Dhello_jni_EXPORTS -IC:\\lib\\boost_1_63_0 -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\include -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\libs\\x86\\include -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\include\\backward  -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti  -O2 -DNDEBUG -O2 -DNDEBUG  -fPIC   -fexceptions -std=c++14 -DBOOST_NO_TYPEID -DBOOST_EXECUTION_CONTEXT=1 -fno-rtti  -c ",
					"src" : "C:/lib/boost_1_63_0/libs/system/src/error_code.cpp",
					"workingDirectory" : "C:/temp/androidSandbox/HelloJNI_cpp_rational/HelloJNI/app/.externalNativeBuild/cmake/x86Release/x86"
				},
				
				{
					"flags" : "  -target i686-none-linux-android -gcc-toolchain C:/lib/AndroidStudioSdk/1/ndk-bundle/toolchains/x86-4.9/prebuilt/windows-x86_64 --sysroot=C:/lib/AndroidStudioSdk/1/ndk-bundle/platforms/android-23/arch-x86  -Dhello_jni_EXPORTS -IC:\\lib\\boost_1_63_0 -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\include -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\libs\\x86\\include -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\include\\backward  -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti  -O2 -DNDEBUG -O2 -DNDEBUG  -fPIC   -fexceptions -std=c++14 -DBOOST_NO_TYPEID -DBOOST_EXECUTION_CONTEXT=1 -fno-rtti  -c ",
					"src" : "C:/lib/boost_1_63_0/libs/context/src/execution_context.cpp",
					"workingDirectory" : "C:/temp/androidSandbox/HelloJNI_cpp_rational/HelloJNI/app/.externalNativeBuild/cmake/x86Release/x86"
				},
				
				{
					"flags" : "  -target i686-none-linux-android -gcc-toolchain C:/lib/AndroidStudioSdk/1/ndk-bundle/toolchains/x86-4.9/prebuilt/windows-x86_64 --sysroot=C:/lib/AndroidStudioSdk/1/ndk-bundle/platforms/android-23/arch-x86  -Dhello_jni_EXPORTS -IC:\\lib\\boost_1_63_0 -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\include -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\libs\\x86\\include -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\include\\backward  -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti  -O2 -DNDEBUG -O2 -DNDEBUG  -fPIC   -fexceptions -std=c++14 -DBOOST_NO_TYPEID -DBOOST_EXECUTION_CONTEXT=1 -fno-rtti  -c ",
					"src" : "C:/lib/boost_1_63_0/libs/context/src/posix/stack_traits.cpp",
					"workingDirectory" : "C:/temp/androidSandbox/HelloJNI_cpp_rational/HelloJNI/app/.externalNativeBuild/cmake/x86Release/x86"
				},
				
				{
					"flags" : "  -target i686-none-linux-android -gcc-toolchain C:/lib/AndroidStudioSdk/1/ndk-bundle/toolchains/x86-4.9/prebuilt/windows-x86_64 --sysroot=C:/lib/AndroidStudioSdk/1/ndk-bundle/platforms/android-23/arch-x86 -Dhello_jni_EXPORTS -IC:\\lib\\boost_1_63_0  -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security  -O2 -DNDEBUG -O2 -DNDEBUG  -fPIC   -fexceptions -std=c++14 -DBOOST_NO_TYPEID -DBOOST_EXECUTION_CONTEXT=1 -fno-rtti    -c ",
					"src" : "C:/lib/boost_1_63_0/libs/context/src/asm/jump_i386_sysv_elf_gas.S",
					"workingDirectory" : "C:/temp/androidSandbox/HelloJNI_cpp_rational/HelloJNI/app/.externalNativeBuild/cmake/x86Release/x86"
				},
				
				{
					"flags" : "  -target i686-none-linux-android -gcc-toolchain C:/lib/AndroidStudioSdk/1/ndk-bundle/toolchains/x86-4.9/prebuilt/windows-x86_64 --sysroot=C:/lib/AndroidStudioSdk/1/ndk-bundle/platforms/android-23/arch-x86 -Dhello_jni_EXPORTS -IC:\\lib\\boost_1_63_0  -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security  -O2 -DNDEBUG -O2 -DNDEBUG  -fPIC   -fexceptions -std=c++14 -DBOOST_NO_TYPEID -DBOOST_EXECUTION_CONTEXT=1 -fno-rtti    -c ",
					"src" : "C:/lib/boost_1_63_0/libs/context/src/asm/make_i386_sysv_elf_gas.S",
					"workingDirectory" : "C:/temp/androidSandbox/HelloJNI_cpp_rational/HelloJNI/app/.externalNativeBuild/cmake/x86Release/x86"
				},
				
				{
					"flags" : "  -target i686-none-linux-android -gcc-toolchain C:/lib/AndroidStudioSdk/1/ndk-bundle/toolchains/x86-4.9/prebuilt/windows-x86_64 --sysroot=C:/lib/AndroidStudioSdk/1/ndk-bundle/platforms/android-23/arch-x86 -Dhello_jni_EXPORTS -IC:\\lib\\boost_1_63_0  -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security  -O2 -DNDEBUG -O2 -DNDEBUG  -fPIC   -fexceptions -std=c++14 -DBOOST_NO_TYPEID -DBOOST_EXECUTION_CONTEXT=1 -fno-rtti    -c ",
					"src" : "C:/lib/boost_1_63_0/libs/context/src/asm/ontop_i386_sysv_elf_gas.S",
					"workingDirectory" : "C:/temp/androidSandbox/HelloJNI_cpp_rational/HelloJNI/app/.externalNativeBuild/cmake/x86Release/x86"
				},
				
				{
					"flags" : "  -target i686-none-linux-android -gcc-toolchain C:/lib/AndroidStudioSdk/1/ndk-bundle/toolchains/x86-4.9/prebuilt/windows-x86_64 --sysroot=C:/lib/AndroidStudioSdk/1/ndk-bundle/platforms/android-23/arch-x86  -Dhello_jni_EXPORTS -IC:\\lib\\boost_1_63_0 -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\include -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\libs\\x86\\include -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\include\\backward  -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti  -O2 -DNDEBUG -O2 -DNDEBUG  -fPIC   -fexceptions -std=c++14 -DBOOST_NO_TYPEID -DBOOST_EXECUTION_CONTEXT=1 -fno-rtti  -c ",
					"src" : "C:/lib/boost_1_63_0/libs/thread/src/pthread/once.cpp",
					"workingDirectory" : "C:/temp/androidSandbox/HelloJNI_cpp_rational/HelloJNI/app/.externalNativeBuild/cmake/x86Release/x86"
				},
				
				{
					"flags" : "  -target i686-none-linux-android -gcc-toolchain C:/lib/AndroidStudioSdk/1/ndk-bundle/toolchains/x86-4.9/prebuilt/windows-x86_64 --sysroot=C:/lib/AndroidStudioSdk/1/ndk-bundle/platforms/android-23/arch-x86  -Dhello_jni_EXPORTS -IC:\\lib\\boost_1_63_0 -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\include -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\libs\\x86\\include -isystem C:\\lib\\AndroidStudioSdk\\1\\ndk-bundle\\sources\\cxx-stl\\gnu-libstdc++\\4.9\\include\\backward  -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti  -O2 -DNDEBUG -O2 -DNDEBUG  -fPIC   -fexceptions -std=c++14 -DBOOST_NO_TYPEID -DBOOST_EXECUTION_CONTEXT=1 -fno-rtti  -c ",
					"src" : "C:/lib/boost_1_63_0/libs/thread/src/pthread/thread.cpp",
					"workingDirectory" : "C:/temp/androidSandbox/HelloJNI_cpp_rational/HelloJNI/app/.externalNativeBuild/cmake/x86Release/x86"
				}
			],
			"output" : "C:/temp/androidSandbox/HelloJNI_cpp_rational/HelloJNI/app/build/intermediates/cmake/x86/release/obj/x86/libhello-jni.so",
			"toolchain" : "735417383"
		}
	},
	"toolchains" : 
	{
		"735417383" : 
		{
			"cCompilerExecutable" : "C:/lib/AndroidStudioSdk/1/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe",
			"cppCompilerExecutable" : "C:/lib/AndroidStudioSdk/1/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe"
		}
	}
}

comment:9 by olli, 6 years ago

Sorry - I've no idea. It's too much output,I do not see which line of code causes the problem. Please note that i386/x86_64 boost-regression tests work - I don't develop for Android. Seams that Android does something different like LINUX (ELF+SYS V). Unfortunately I'm too busy to deal with Android.

comment:10 by Lev Sch <zorechfan@…>, 6 years ago

If change line

boost::multiprecision::cpp_rational n3 = 0.5;

to

boost::multiprecision::cpp_rational n3(1,2); // is same as 0.5;

in file HelloJNI\app\src\main\cpp\boostTest.cpp then no crash.

Probably something with floating point...

Thank you for a try.

comment:11 by bdowning@…, 6 years ago

I believe I've fixed the likely cause of this in the pull request here: https://github.com/boostorg/context/pull/47

A recent change broke stack alignment on arm32-elf, which amongst other things causes anything using varargs (notably libc formatted I/O) to be broken.

comment:12 by Lev Sch <zorechfan@…>, 6 years ago

I've found that adding compiller option "-mstackrealign" stops reproduce described here ticket:12799#comment:2

Then I found related tiket https://code.google.com/p/android/issues/detail?id=222239.

comment:13 by Lev Sch <zorechfan@…>, 6 years ago

Both sscanf and cpp_rational cases are reproduced on android-ndk-r14 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.

It was difficult to detect.

Thank you!

comment:14 by Lev Sch <zorechfan@…>, 6 years ago

Note: the cases are reproduced on android-ndk-r13b and are not reproduced on android-ndk-r14.

comment:15 by olli, 6 years ago

Resolution: worksforme
Status: newclosed

OK, ty - so I'll close this bugreport as 'Works for me'.

Note: See TracTickets for help on using tickets.