Skip to content

[Tabs][BottomNavigation] Crash with TabStrip configured in code-behind #7692

Description

@tsonevn

Environment

  • CLI: 6.0.3
  • Cross-platform modules: 6.1.0-next-2019-08-18-231654-03
  • iOS Runtime: 6.1.0-2019-08-15-135151-01

The problem is related to incorrect handling of a scenario where TabStrip and TabStripItems are created dynamically in code behind. The issue is reproducible only on iOS. Error:

CONSOLE INFO file:///node_modules/nativescript-dev-webpack/hot.js:3:0 HMR: Hot Module Replacement Enabled. Waiting for signal.
CONSOLE LOG file:///app/ns-ui-widgets-category/tabs/properties/properties-page.js:96:0 >>> Loaded [Content 1]
CONSOLE LOG file:///app/ns-ui-widgets-category/tabs/properties/properties-page.js:96:0 >>> Loaded [Content 2]
CONSOLE LOG file:///app/ns-ui-widgets-category/tabs/properties/properties-page.js:96:0 >>> Loaded [Content 3]
CONSOLE LOG file:///app/ns-ui-widgets-category/tabs/properties/properties-page.js:41:0 tabs.nativeView:  <_UIPageViewControllerContentView: 0x7fb6e7647bc0; frame = (0 0; 375 812); clipsToBounds = YES; opaque = NO; autoresize = W+H; layer = <CALayer: 0x6000019bbd40>>
***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1   0x1015e362a NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2   0x10161d108 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
3   0x101fc3a86 ffi_closure_unix64_inner
4   0x101fc44aa ffi_closure_unix64
5   0x10558bd22 -[CALayer layoutSublayers]
6   0x1055909fc CA::Layer::layout_if_needed(CA::Transaction*)
7   0x10559cd58 CA::Layer::layout_and_display_if_needed(CA::Transaction*)
8   0x10550c24a CA::Context::commit_transaction(CA::Transaction*)
9   0x105543606 CA::Transaction::commit()
10  0x1062ea99c _afterCACommitHandler
11  0x1048c52c7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
12  0x1048bf78e __CFRunLoopDoObservers
13  0x1048bfe01 __CFRunLoopRun
14  0x1048bf4d2 CFRunLoopRunSpecific
15  0x10baca2fe GSEventRunModal
16  0x1062c2fc2 UIApplicationMain
17  0x101fc42ed ffi_call_unix64
18  0x118c5a870
JavaScript stack trace:
viewDidLayoutSubviews(file:///node_modules/tns-core-modules/ui/tabs/tabs.js:103:0
at UIApplicationMain([native code])
at _start(file:///node_modules/tns-core-modules/application/application.js:286:0
at run(file:///node_modules/tns-core-modules/application/application.js:314:0
at file:///app/bundle.js:1131:65
at ./app.ts(file:///app/bundle.js:1143:34)
at __webpack_require__(file:///app/webpack/bootstrap:750:0
at checkDeferredModules(file:///app/webpack/bootstrap:43:0
at webpackJsonpCallback(file:///app/webpack/bootstrap:30:0
at anonymous(file:///app/bundle.js:2:61)
at evaluate([native code])
at moduleEvaluation([native code])
at promiseReactionJob([native code])
JavaScript error:
file:///node_modules/tns-core-modules/ui/tabs/tabs.js:103:0 JS ERROR TypeError: undefined is not an object (evaluating 'this.tabBar.frame')
NativeScript caught signal 11.
Native Stack:
1   0x10162b2bf sig_handler(int)
2   0x105278b5d _sigtramp
3   0x0
4   0x1051beb4d libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::step()
5   0x1051c2e4c _Unwind_RaiseException
6   0x104d9b4aa __cxa_throw
7   0x1037b2bfa _objc_exception_destructor(void*)
8   0x1015e3a08 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
9   0x10161d108 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
10  0x101fc3a86 ffi_closure_unix64_inner
11  0x101fc44aa ffi_closure_unix64
12  0x10558bd22 -[CALayer layoutSublayers]
13  0x1055909fc CA::Layer::layout_if_needed(CA::Transaction*)
14  0x10559cd58 CA::Layer::layout_and_display_if_needed(CA::Transaction*)
15  0x10550c24a CA::Context::commit_transaction(CA::Transaction*)
16  0x105543606 CA::Transaction::commit()
17  0x1062ea99c _afterCACommitHandler
18  0x1048c52c7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
19  0x1048bf78e __CFRunLoopDoObservers
20  0x1048bfe01 __CFRunLoopRun
21  0x1048bf4d2 CFRunLoopRunSpecific
22  0x10baca2fe GSEventRunModal
23  0x1062c2fc2 UIApplicationMain
24  0x101fc42ed ffi_call_unix64
25  0x118c5a870
JS Stack:
UIApplicationMain([native code])
at _start(file:///node_modules/tns-core-modules/application/application.js:286:0
at run(file:///node_modules/tns-core-modules/application/application.js:314:0
at file:///app/bundle.js:1131:65
at ./app.ts(file:///app/bundle.js:1143:34)
at __webpack_require__(file:///app/webpack/bootstrap:750:0
at checkDeferredModules(file:///app/webpack/bootstrap:43:0
at webpackJsonpCallback(file:///app/webpack/bootstrap:30:0
at anonymous(file:///app/bundle.js:2:61)
at evaluate([native code])
at moduleEvaluation
at promiseReactionJob

The problem can be reproduced with nativescript-sdk-examples-js app with properties example. Might be related to PR#7580.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions