NativeScript / ios-jsc

NativeScript for iOS using JavaScriptCore

Home Page:http://docs.nativescript.org/runtimes/ios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

crash instantiating native class

farfromrefug opened this issue · comments

With ios-runtime 6.4.1 i have a crash with a plugin of mine. It works fine with 6.3.0.

the related code is this

this.delegate = HandlerDelegate.new().initWithOwner(new WeakRef(this));
NativeScript caught signal 11.
Native Stack:
1   0x10991f3e1 sig_handler(int)
2   0x10f6ad42d _sigtramp
3   0x10f5ea6be libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::setInfoBasedOnIPRegister(bool)
4   0x10f5e9b1f libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::step()
5   0x10f5ede4d _Unwind_RaiseException
6   0x10f1c32f1 __cxa_rethrow
7   0x10e3108de objc_exception_rethrow
8   0x10e311795 _class_initialize
9   0x10e318248 lookUpImpOrForward
10  0x10e325814 _objc_msgSend_uncached
11  0x10e324073 +[NSObject new]
12  0x10a310c1d ffi_call_unix64
13  0x130d44010
JS Stack:
new([native code])
at file:///app/bundle.js:300:39
at file:///app/bundle.js:349:54
at file:///app/bundle.js:2921:36
at invokeWithErrorHandling(file:///app/vendor.js:59222:61)
at callHook(file:///app/vendor.js:62453:30)
at insert(file:///app/vendor.js:61384:15)
at invokeInsertHook(file:///app/vendor.js:63036:34)
at patch(file:///app/vendor.js:63255:21)
at file:///app/vendor.js:62179:28
at updateComponent(file:///app/vendor.js:62300:17)
at get(file:///app/vendor.js:59696:29)
at Watcher(file:///app/vendor.js:59685:15)
at mountComponent(file:///app/vendor.js:62307:14)
at file:///app/vendor.js:70163:43
at initializePromise
at Promise([native code])
at file:///app/vendor.js:70150:25
at [native code]
at file:///app/bundle.js:2643:28
at [native code]
at file:///app/bundle.js:2515:27
at [native code]
at invokeWithErrorHandling(file:///app/vendor.js:59222:31)
at file:///app/vendor.js:23627:26
at UIApplicationMain([native code])
at run(file:///app/vendor.js:644:26)
at file:///app/vendor.js:69981:18
at file:///a<…>
^C

HandlerDelegate.new().initWithOwner doesn't seem right. new is a shortcut to alloc().init() and calling initWithOwnerfor an already initialized instance is incorrect. I suggest you test with HandlerDelegate.alloc().initWithOwner instead.

This actually may be unrelated to the iOS runtime version, but the device's iOS version. In order to find out the native exception which is being thrown, you may run your app on a real device instead of a simulator, as the callstack suggests you're hitting this limitation of {N} iOS due to libffi breaking the exception rewind mechanism.

@mbektchiev you are write about the naming issue. I already fixed it locally but it is the same error. And as i said it does not crash with 6.3.0. Something changed.

I ll try and run the app on a device thanks!

@mbektchiev I had actually forgot about that issue. Now i faced it again.
Running on a device i get that error:

Class "GestureHandlerEventExtraData" referenced by type encoding not found at runtime.

So i realized it was an issue on my side!

Thanks again @mbektchiev as always!