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

Crash when changing boolean value of native iOS View #76

Closed
bradmartin opened this issue Oct 29, 2020 · 2 comments
Closed

Crash when changing boolean value of native iOS View #76

bradmartin opened this issue Oct 29, 2020 · 2 comments

Comments

@bradmartin
Copy link

====== Assertion failed ======
Native stack trace:
1          0x11008d19f tns::Assert(bool, v8::Isolate*) + 119
2          0x1100b2840 tns::Interop::SetFFIParams(v8::Local<v8::Context>, tns::TypeEncoding const*, tns::FFICall*, int, int, tns::V8Args&) + 110
3          0x1100b24a5 tns::Interop::CallFunctionInternal(tns::MethodCall&) + 421
4          0x10ffee4f0 tns::ArgConverter::Invoke(v8::Local<v8::Context>, objc_class*, v8::Local<v8::Object>, tns::V8Args&, tns::MethodMeta const*, bool) + 758
5          0x11004ee5a tns::MetadataBuilder::InvokeMethod(v8::Local<v8::Context>, tns::MethodMeta const*, v8::Local<v8::Object>, tns::V8Args&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool) + 76
6          0x11004eb03 tns::MetadataBuilder::PropertySetterCallback(v8::FunctionCallbackInfo<v8::Value> const&) + 249
7          0x1101da13c v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 620
8          0x1101d95ec v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) + 556
9          0x1101d8f94 v8::internal::Builtins::InvokeApiFunction(v8::internal::Isolate*, bool, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*, v8::internal::Handle<v8::internal::HeapObject>) + 692
10         0x11057b09f v8::internal::Object::SetPropertyWithAccessor(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::Maybe<v8::internal::ShouldThrow>) + 511
11         0x1105802c6 v8::internal::Object::SetPropertyInternal(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::Maybe<v8::internal::ShouldThrow>, v8::internal::StoreOrigin, bool*) + 358
12         0x1105800a6 v8::internal::Object::SetProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::StoreOrigin, v8::Maybe<v8::internal::ShouldThrow>) + 54
13         0x1103e0f2d v8::internal::StoreIC::Store(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Object>, v8::internal::StoreOrigin) + 1053
14         0x1103e61ed v8::internal::Runtime_StoreIC_Miss(int, unsigned long*, v8::internal::Isolate*) + 413
15         0x110a71b39 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit + 57
JavaScript stack trace:
at set clockwise (file: node_modules/@nativescript/animated-circle/index.ios.js:103:0)
at setPropertyInternal (file: node_modules/@nativescript/angular/__ivy_ngcc__/fesm2015/nativescript-angular.js:2661:0)
at setProperty (file: node_modules/@nativescript/angular/__ivy_ngcc__/fesm2015/nativescript-angular.js:2631:0)
at setAttribute (file: node_modules/@nativescript/angular/__ivy_ngcc__/fesm2015/nativescript-angular.js:2814:0)
at setUpAttributes (file: node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:3394:0)
at ɵɵelementStart (file: node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:14781:0)
at ɵɵelement (file: node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:14851:0)
at HomeTabComponent_Template (file: src/app/modules/home-tab/home-tab.component.html:16:8)
at executeTemplate (file: node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:7449:0)
at renderView (file: node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js:7258:0)

Crashes with the setter of the animated-circle plugin here

	/**
	 * The draw direction for the filled circle
	 */
	set clockwise(value: boolean) {
		this._ios.clockwise = value;
	}

Confirmed that switching to the tns-ios: 6.5.3 runtime and the app runs without crashing.

@bradmartin
Copy link
Author

The value here ends up coming through as a string instead of boolean. For now updating the plugin to use booleanConverter() to handle the setting on the plugin side.

@NathanWalker
Copy link
Contributor

This is expected with runtime behavior and setters. Property setter should always use a booleanConverter for proper type handling.

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