Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on iOS (probably related to op-sqlite / libsql ) #2238

Open
386sx opened this issue Dec 30, 2024 · 3 comments
Open

Build fails on iOS (probably related to op-sqlite / libsql ) #2238

386sx opened this issue Dec 30, 2024 · 3 comments

Comments

@386sx
Copy link

386sx commented Dec 30, 2024

Building on iOS is crashing, probably because of some mixup with op-sqlite
https://github.com/OP-Engineering/op-sqlite (11.2.5).
I will also create an issue there since it is not clear if this is an op-sqlite problem.

Environment

  • Plugin version: 4.18.3
  • Platform: iOS
  • OS version: Xcode 16.2, iOS 18.2
  • Device manufacturer / model: mbp m4 / Apple iPhone 15
  • React Native version (react-native -v): 0.76.1
  • op-sqlite: 11.2.5
  • Plugin config
{
      triggerActivities: 'in_vehicle',
      backgroundPermissionRationale: {
        message: t('lBpRm'),
        title: t('lBpRmt'),
        positiveAction:t('lBpRmp'),
      },
      persist: false,
      desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_MEDIUM,
      distanceFilter: 10,
      stopTimeout: 5,
      debug: true,
      logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
      stopOnTerminate: false,
      startOnBoot: true,
      url: buildApirUrl('logPos', sessionId, userId, false),
      method: 'POST',
      batchSync: false, 
      autoSync: true,
      headers: {
        // <-- Optional HTTP headers
        ...X_HEADERS.headers,
      },
      params: {
        // <-- Optional HTTP params
        shareToken,
      },

Expected Behavior

should not crash when loading the lib

Actual Behavior

crashing at import BackgroundGeolocation

Steps to Reproduce

  1. install @op-engineering/op-sqlite (with libsql: true) and build on ios

Context

Trying to run the application in iOS (physical device)

Debug logs

Logs
thread '<unnamed>' panicked at libsql/src/local/database.rs:239:17:
assertion `left == right` failed: libsql was configured with an incorrect threading configuration and
                    the api is not safe to use. Please check that no multi-thread options have
                    been set. If nothing was configured then please open an issue at:
                    https://github.com/libsql/libsql
  left: 21
 right: 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at library/core/src/panicking.rs:221:5:
panic in a function that cannot unwind
stack backtrace:
   0:        0x104e9d520 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h6e07ac9cbc84bbf7
   1:        0x104edd160 - core::fmt::write::he4e08ea2421faad4
   2:        0x104e93388 - std::io::Write::write_fmt::h8e35f44829a6d492
   3:        0x104e9fadc - std::panicking::default_hook::{{closure}}::h5423069eaa907c60
   4:        0x104e9f6e8 - std::panicking::default_hook::ha5bc641a0ba9a664
   5:        0x104ea0784 - std::panicking::rust_panic_with_hook::hff8ab7378efed505
   6:        0x104e9fff0 - std::panicking::begin_panic_handler::{{closure}}::h7f4f159596a77c8b
   7:        0x104e9d9ac - std::sys::backtrace::__rust_end_short_backtrace::hd94c1ab8ebbb033f
   8:        0x104e9fce0 - _rust_begin_unwind
   9:        0x104f9eb70 - core::panicking::panic_nounwind_fmt::h28cf8620a708db9b
  10:        0x104f9ebe8 - core::panicking::panic_nounwind::h23f9ec7786b388ce
  11:        0x104f9ed60 - core::panicking::panic_cannot_unwind::hb9fd807402cdce34
  12:        0x1048c11cc - _libsql_connect
  13:        0x104784aa8 - __ZN8opsqlite20opsqlite_libsql_openERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_S8_
  14:        0x10479fb2c - __ZN8opsqlite12DBHostObjectC2ERN8facebook3jsi7RuntimeERNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEENS5_10shared_ptrINS1_5react11CallInvokerEEENSD_INS_10ThreadPoolEEESC_SC_SC_SC_SC_
  15:        0x10479fd10 - __ZN8opsqlite12DBHostObjectC1ERN8facebook3jsi7RuntimeERNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEENS5_10shared_ptrINS1_5react11CallInvokerEEENSD_INS_10ThreadPoolEEESC_SC_SC_SC_SC_
  16:        0x10477b064 - __ZNSt3__112construct_atB8de180100IN8opsqlite12DBHostObjectEJRN8facebook3jsi7RuntimeERNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10shared_ptrINS3_5react11CallInvokerEEERNSE_INS1_10ThreadPoolEEESD_SD_SD_SD_SD_EPS2_EEPT_SP_DpOT0_
  17:        0x10477af90 - __ZNSt3__114__construct_atB8de180100IN8opsqlite12DBHostObjectEJRN8facebook3jsi7RuntimeERNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10shared_ptrINS3_5react11CallInvokerEEERNSE_INS1_10ThreadPoolEEESD_SD_SD_SD_SD_EPS2_EEPT_SP_DpOT0_
  18:        0x10477ad88 - __ZNSt3__116allocator_traitsINS_9allocatorIN8opsqlite12DBHostObjectEEEE9constructB8de180100IS3_JRN8facebook3jsi7RuntimeERNS_12basic_stringIcNS_11char_traitsIcEENS1_IcEEEERKNS_10shared_ptrINS7_5react11CallInvokerEEERNSH_INS2_10ThreadPoolEEESG_SG_SG_SG_SG_EvvEEvRS4_PT_DpOT0_
  19:        0x10477ac5c - __ZNSt3__120__shared_ptr_emplaceIN8opsqlite12DBHostObjectENS_9allocatorIS2_EEEC2B8de180100IJRN8facebook3jsi7RuntimeERNS_12basic_stringIcNS_11char_traitsIcEENS3_IcEEEERKNS_10shared_ptrINS7_5react11CallInvokerEEERNSH_INS1_10ThreadPoolEEESG_SG_SG_SG_SG_ES4_Li0EEES4_DpOT_
  20:        0x10477a8f8 - __ZNSt3__120__shared_ptr_emplaceIN8opsqlite12DBHostObjectENS_9allocatorIS2_EEEC1B8de180100IJRN8facebook3jsi7RuntimeERNS_12basic_stringIcNS_11char_traitsIcEENS3_IcEEEERKNS_10shared_ptrINS7_5react11CallInvokerEEERNSH_INS1_10ThreadPoolEEESG_SG_SG_SG_SG_ES4_Li0EEES4_DpOT_
  21:        0x10477a7ac - __ZNSt3__115allocate_sharedB8de180100IN8opsqlite12DBHostObjectENS_9allocatorIS2_EEJRN8facebook3jsi7RuntimeERNS_12basic_stringIcNS_11char_traitsIcEENS3_IcEEEERKNS_10shared_ptrINS5_5react11CallInvokerEEERNSF_INS1_10ThreadPoolEEESE_SE_SE_SE_SE_EvEENSF_IT_EERKT0_DpOT1_
  22:        0x104779c54 - __ZNSt3__111make_sharedB8de180100IN8opsqlite12DBHostObjectEJRN8facebook3jsi7RuntimeERNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_10shared_ptrINS3_5react11CallInvokerEEERNSE_INS1_10ThreadPoolEEESD_SD_SD_SD_SD_EvEENSE_IT_EEDpOT0_
  23:        0x104779954 - __ZZN8opsqlite7installERN8facebook3jsi7RuntimeERKNSt3__110shared_ptrINS0_5react11CallInvokerEEEPKcSC_SC_ENK3$_0clES3_RKNS1_5ValueEPSF_m
  24:        0x104779568 - __ZNSt3__18__invokeB8de180100IRZN8opsqlite7installERN8facebook3jsi7RuntimeERKNS_10shared_ptrINS2_5react11CallInvokerEEEPKcSD_SD_E3$_0JS5_RKNS3_5ValueEPSH_mEEEDTclclsr3stdE7declvalIT_EEspclsr3stdE7declvalIT0_EEEEOSK_DpOSL_
  25:        0x1047794f0 - __ZNSt3__128__invoke_void_return_wrapperIN8facebook3jsi5ValueELb0EE6__callB8de180100IJRZN8opsqlite7installERNS2_7RuntimeERKNS_10shared_ptrINS1_5react11CallInvokerEEEPKcSG_SG_E3$_0S8_RKS3_PSJ_mEEES3_DpOT_
  26:        0x1047794a4 - __ZNSt3__110__function12__alloc_funcIZN8opsqlite7installERN8facebook3jsi7RuntimeERKNS_10shared_ptrINS3_5react11CallInvokerEEEPKcSE_SE_E3$_0NS_9allocatorISF_EEFNS4_5ValueES6_RKSI_PSJ_mEEclB8de180100ES6_SK_OSL_Om
  27:        0x1047780d8 - __ZNSt3__110__function6__funcIZN8opsqlite7installERN8facebook3jsi7RuntimeERKNS_10shared_ptrINS3_5react11CallInvokerEEEPKcSE_SE_E3$_0NS_9allocatorISF_EEFNS4_5ValueES6_RKSI_PSJ_mEEclES6_SK_OSL_Om
  28:        0x106031a08 - __ZNKSt3__110__function12__value_funcIFN8facebook3jsi5ValueERNS3_7RuntimeERKS4_PS7_mEEclB8de180100ES6_S8_OS9_Om
  29:        0x10603138c - __ZNKSt3__18functionIFN8facebook3jsi5ValueERNS2_7RuntimeERKS3_PS6_mEEclES5_S7_S8_m
  30:        0x106030a28 - __ZZN8facebook3jsc10JSCRuntime30createFunctionFromHostFunctionERKNS_3jsi10PropNameIDEjNSt3__18functionIFNS2_5ValueERNS2_7RuntimeERKS8_PSB_mEEEEN20HostFunctionMetadata4callEPK15OpaqueJSContextP13OpaqueJSValueSL_mPKPKSK_PSN_
thread caused non-unwinding panic. aborting.
@386sx 386sx changed the title Build fails on iOS (op-sqlite / libsql) probably Build fails on iOS (probably related to op-sqlite / libsql ) Dec 30, 2024
@christocracy
Copy link
Member

No it is not possible to disable the plugin's sqlite.

@386sx
Copy link
Author

386sx commented Jan 4, 2025

Ok, so, any suggestions or plans to look into it?

@christocracy
Copy link
Member

I’ve never heard of it. Like the error message says:

If nothing was configured then please open an issue at:
https://github.com/libsql/libsql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants