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

Opening the camera for a barcode scan crashes the app on iOS #275

Open
LaKing opened this issue Sep 3, 2021 · 3 comments
Open

Opening the camera for a barcode scan crashes the app on iOS #275

LaKing opened this issue Sep 3, 2021 · 3 comments

Comments

@LaKing
Copy link

LaKing commented Sep 3, 2021

The nomal log writes: (11db)

#3 0x000000010554b9f8 in tns::Interop::CallInitializer(v8::Local<v8::Context>, tns::MethodMeta const*, objc_object*, objc_class*, tns::V8Args&) at /Users/rigor789/Code/ns-v8ios-runtime/NativeScript/runtime/Interop.mm:111

NativeScript`tns::Interop::CallInitializer:
    0x10554b928 <+0>:   sub    sp, sp, #0x70             ; =0x70 
    0x10554b92c <+4>:   stp    x26, x25, [sp, #0x20]
    0x10554b930 <+8>:   stp    x24, x23, [sp, #0x30]
    0x10554b934 <+12>:  stp    x22, x21, [sp, #0x40]
    0x10554b938 <+16>:  stp    x20, x19, [sp, #0x50]
    0x10554b93c <+20>:  stp    x29, x30, [sp, #0x60]
    0x10554b940 <+24>:  add    x29, sp, #0x60            ; =0x60 
    0x10554b944 <+28>:  mov    x20, x4
    0x10554b948 <+32>:  mov    x21, x2
    0x10554b94c <+36>:  mov    x19, x1
    0x10554b950 <+40>:  mov    x22, x0
    0x10554b954 <+44>:  add    x0, x1, #0xb              ; =0xb 
    0x10554b958 <+48>:  bl     0x1054b8b7c               ; tns::PtrTo<tns::TypeEncodingsList<int> >::valuePtr at Metadata.h:378
    0x10554b95c <+52>:  add    x23, x0, #0x4             ; =0x4 
    0x10554b960 <+56>:  mov    x0, x19
    0x10554b964 <+60>:  mov    w1, #0x1
    0x10554b968 <+64>:  bl     0x1054b8bf4               ; tns::Meta::getNameByIndex at Metadata.h:612
    0x10554b96c <+68>:  bl     0x105ed697c               ; symbol stub for: sel_registerName
    0x10554b970 <+72>:  mov    x24, x0
    0x10554b974 <+76>:  ldr    x8, [x20]
    0x10554b978 <+80>:  ldr    x8, [x8, #0x8]
    0x10554b97c <+84>:  mov    x0, x20
    0x10554b980 <+88>:  blr    x8
    0x10554b984 <+92>:  add    w25, w0, #0x2             ; =0x2 
    0x10554b988 <+96>:  mov    x0, x23
    0x10554b98c <+100>: mov    w1, #0x2
    0x10554b990 <+104>: mov    x2, x25
    0x10554b994 <+108>: bl     0x10553c5c0               ; tns::ParametrizedCall::Get at FFICall.cpp:248
    0x10554b998 <+112>: mov    x19, x0
    0x10554b99c <+116>: add    x0, sp, #0x8              ; =0x8 
    0x10554b9a0 <+120>: mov    x1, x19
    0x10554b9a4 <+124>: bl     0x1055502bc               ; tns::FFICall::FFICall at FFICall.h:73
    0x10554b9a8 <+128>: ldr    x8, [sp, #0x18]
    0x10554b9ac <+132>: ldr    x8, [x8]
    0x10554b9b0 <+136>: str    x21, [x8]
    0x10554b9b4 <+140>: ldr    x8, [sp, #0x18]
    0x10554b9b8 <+144>: ldr    x8, [x8, #0x8]
    0x10554b9bc <+148>: str    x24, [x8]
    0x10554b9c0 <+152>: add    x2, sp, #0x8              ; =0x8 
    0x10554b9c4 <+156>: mov    x0, x22
    0x10554b9c8 <+160>: mov    x1, x23
    0x10554b9cc <+164>: mov    x3, x25
    0x10554b9d0 <+168>: mov    w4, #0x2
    0x10554b9d4 <+172>: mov    x5, x20
    0x10554b9d8 <+176>: bl     0x10554ba3c               ; tns::Interop::SetFFIParams at Interop.mm:118
    0x10554b9dc <+180>: ldr    x0, [x19]
    0x10554b9e0 <+184>: ldp    x8, x9, [sp, #0x8]
    0x10554b9e4 <+188>: add    x2, x8, x9
    0x10554b9e8 <+192>: ldr    x3, [sp, #0x18]
    0x10554b9ec <+196>: adrp   x1, 2633
    0x10554b9f0 <+200>: ldr    x1, [x1, #0x410]
    0x10554b9f4 <+204>: bl     0x1055aa994               ; ffi_call
->  0x10554b9f8 <+208>: ldp    x0, x8, [sp, #0x8]

Thread 1: EXC_BAD_ACCESS (code=1, address=0x5)

    0x10554b9fc <+212>: ldr    x19, [x0, x8]
    0x10554ba00 <+216>: bl     0x105ed64e4               ; symbol stub for: free
    0x10554ba04 <+220>: mov    x0, x19
    0x10554ba08 <+224>: ldp    x29, x30, [sp, #0x60]
    0x10554ba0c <+228>: ldp    x20, x19, [sp, #0x50]
    0x10554ba10 <+232>: ldp    x22, x21, [sp, #0x40]
    0x10554ba14 <+236>: ldp    x24, x23, [sp, #0x30]
    0x10554ba18 <+240>: ldp    x26, x25, [sp, #0x20]
    0x10554ba1c <+244>: add    sp, sp, #0x70             ; =0x70 
    0x10554ba20 <+248>: ret    
    0x10554ba24 <+252>: mov    x19, x0
    0x10554ba28 <+256>: ldr    x0, [sp, #0x8]
    0x10554ba2c <+260>: bl     0x105ed64e4               ; symbol stub for: free
    0x10554ba30 <+264>: mov    x0, x19
    0x10554ba34 <+268>: bl     0x105ed5cd4               ; symbol stub for: _Unwind_Resume
    0x10554ba38 <+272>: brk    #0x1

Could someone help me to get this rolling?
Thanks

@LaKing
Copy link
Author

LaKing commented Sep 3, 2021

This might be related:

ERROR in ./node_modules/nativescript-barcodescanner/barcodescanner.ios.js 243:20-56
Module not found: Error: Can't resolve 'tns-core-modules/ui/frame' in '/Users/istvankiraly/NativeScript-devel/Hangmaffia/node_modules/nativescript-barcodescanner'
resolve 'tns-core-modules/ui/frame' in '/Users/istvankiraly/NativeScript-devel/Hangmaffia/node_modules/nativescript-barcodescanner'
  Parsed request is a module
  using description file: /Users/istvankiraly/NativeScript-devel/Hangmaffia/node_modules/nativescript-barcodescanner/package.json (relative path: .)
    resolve as module
      looking for modules in /Users/istvankiraly/NativeScript-devel/Hangmaffia/node_modules
        /Users/istvankiraly/NativeScript-devel/Hangmaffia/node_modules/tns-core-modules doesn't exist
      /Users/istvankiraly/NativeScript-devel/Hangmaffia/node_modules/nativescript-barcodescanner/node_modules doesn't exist or is not a directory
      /Users/istvankiraly/NativeScript-devel/Hangmaffia/node_modules/node_modules doesn't exist or is not a directory
      looking for modules in /Users/istvankiraly/NativeScript-devel/Hangmaffia/node_modules
        /Users/istvankiraly/NativeScript-devel/Hangmaffia/node_modules/tns-core-modules doesn't exist
      /Users/istvankiraly/NativeScript-devel/node_modules doesn't exist or is not a directory
      /Users/istvankiraly/node_modules doesn't exist or is not a directory
      /Users/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
 @ ./app/app.js 50:44-101

@LaKing
Copy link
Author

LaKing commented Sep 3, 2021

find and replace tns-core-modules/ui/frame to @nativescript/core/ui/frame

Fixes the ERROR in the build process, but the scanner still crashes with the EXC_BAD_ADDRESS

@bradmartin
Copy link

#278 this PR should fix this. Demo app on that branch runs fine with the fix.

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