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

NativeScript::SymbolLoader incorrectly caches framework bundles #273

Closed
jasssonpet opened this issue Aug 19, 2015 · 3 comments
Closed

NativeScript::SymbolLoader incorrectly caches framework bundles #273

jasssonpet opened this issue Aug 19, 2015 · 3 comments

Comments

@jasssonpet
Copy link
Contributor

Reported by @Fatme:

<Notice>: /app/tns_modules/location/location.js:56:52: JS ERROR ReferenceError: Can't find variable: kCLDistanceFilterNone
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 1   0x10007ac3c NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif, void, void*, void)
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 2   0x1004fab24 ffi_closure_SYSV_inner
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 3   0x1004fb1b4 .Ldo_closure
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 4   0x18a7cbf08 <redacted>
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 5   0x18a86a544 <redacted>
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 6   0x18a869f30 <redacted>
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 7   0x18a869c50 <redacted>
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 8   0x18a869bd0 <redacted>
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 9   0x18a7b16f4 <redacted>
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 10  0x18a0eddb8 <redacted>
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 11  0x18a0e8820 <redacted>
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 12  0x18a0e86c4 <redacted>
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 13  0x18a0e7e58 <redacted>
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 14  0x18a0e7bd8 <redacted>
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 15  0x18aa407cc <redacted>
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 17  0x18aa3f70c <redacted>
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 19  0x185cf427c <redacted>
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 20  0x185cf3384 <redacted>
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 21  0x185cf19a8 <redacted>
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 22  0x185c1d2d4 CFRunLoopRunSpecific
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 23  0x18a8203d0 <redacted>
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 24  0x18a81af40 UIApplicationMain
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 25  0x1004fb044 ffi_call_SYSV
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 26  0x1004fa334 ffi_call_int
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 27  0x10004f71c NativeScript::FFIFunctionCall::derivedExecuteCall(JSC::ExecState, unsigned char)
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 28  0x10004f8e4 long long NativeScript::FFICall::executeCall<NativeScript::FFIFunctionCall>(JSC::ExecState*)
Aug 19 15:46:13 Georgi-Alexandrovs-iPhone sampleFriends[6373] <Notice>: 29  0x1002f9acc JSC::LLInt::setUpCall(JSC::ExecState, JSC::Instruction, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*)
@jasssonpet jasssonpet added the bug label Aug 19, 2015
@jasssonpet jasssonpet self-assigned this Aug 19, 2015
@jasssonpet jasssonpet changed the title Can't find variable: kCLDistanceFilterNone on iOS 8.4 Can't find variable: kCLDistanceFilterNone Aug 20, 2015
@jasssonpet
Copy link
Contributor Author

It turns out that our _bundleCache in SymbolLoader uses for key char * who are temporary. Just changing it to std::string fixed the problem.

@jasssonpet jasssonpet removed their assignment Aug 20, 2015
@fealebenpae fealebenpae self-assigned this Aug 20, 2015
@fealebenpae fealebenpae added this to the 1.3.0 milestone Aug 20, 2015
@fealebenpae
Copy link
Contributor

I'd like to tackle this next week.

@fealebenpae fealebenpae changed the title Can't find variable: kCLDistanceFilterNone NativeScript::SymbolLoader incorrectly caches framework bundles Aug 20, 2015
@fealebenpae
Copy link
Contributor

As pointed out by @jasssonpet, the underlying issue is that SymbolLoader does not resolve module names to framework bundles correctly, leading to searching for a data or function symbol in the wrong bundle. Our class resolution logic has somewhat subverted this issue, because we resolve classes through the Objective-C runtime which looks into all bundles, ambient and explicit alike.

Currently this means that any function or extern data symbol exported from a framework has a chance of not being resolved at runtime.

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

No branches or pull requests

2 participants