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

JSONKit usage here may cause serious crash hard to debug(I found the … #8592

Closed
wants to merge 2 commits into from

Conversation

dustturtle
Copy link

Kicking out of the JSONKit. React-native did not integrate JSONKit in it. So the version of JSONKit is OUT OF CONTROL.

Tested.

JSONKit usage here may cause serious crash hard to debug(I got one! Finally I found the crash on simulator, on device I got nothing but app freezed)!
My app has an old version of JSONKit which is still using MRC. I think JSONKit is not needed if system version is available. Kicking out of JSONKit will make react native stronger.

Crash stack:

  • thread Exception in render() propagates to Xcode #11: tid = 0xbd672f, 0x000000010a10edeb imobii-waiqinjk_encode_add_atom_to_buffer(encodeState=0x00007f9b820a1000, objectPtr=22 key/value pairs) + 16971 at JSONKit.m:2807, name = 'com.facebook.React.JavaScript', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT) frame #0: 0x000000010a10edeb imobii-waiqinjk_encode_add_atom_to_buffer(encodeState=0x00007f9b820a1000, objectPtr=22 key/value pairs) + 16971 at JSONKit.m:2807
    frame nil #1: 0x000000010a10ef67 imobii-waiqinjk_encode_add_atom_to_buffer(encodeState=0x00007f9b820a1000, objectPtr=2 key/value pairs) + 17351 at JSONKit.m:2811 frame #2: 0x000000010a10ef67 imobii-waiqinjk_encode_add_atom_to_buffer(encodeState=0x00007f9b820a1000, objectPtr=25 key/value pairs) + 17351 at JSONKit.m:2811
    frame docs(README): fix quickstart instruction #3: 0x000000010a10e768 imobii-waiqin`jk_encode_add_atom_to_buffer(encodeState=0x00007f9b820a1000, objectPtr=@"3 elements") + 15304 at JSONKit.m:2778
    • frame Set UIStatusBarStyleLightContent #4: 0x000000010a10a26a imobii-waiqin-[JKSerializer serializeObject:options:encodeOption:block:delegate:selector:error:](self=0x00007f9b831fbc80, _cmd="serializeObject:options:encodeOption:block:delegate:selector:error:", object=@"3 elements", optionFlags=0, encodeOption=10, block=0x0000000000000000, delegate=0x0000000000000000, selector=<no value available>, error=domain: class name = NSInvocation - code: 0) + 2250 at JSONKit.m:2876 frame #5: 0x000000010a109992 imobii-waiqin+[JKSerializer serializeObject:options:encodeOption:block:delegate:selector:error:](self=JKSerializer, cmd="serializeObject:options:encodeOption:block:delegate:selector:error:", object=@"3 elements", optionFlags=0, encodeOption=10, block=0x0000000000000000, delegate=0x0000000000000000, selector=, error=domain: class name = NSInvocation - code: 0) + 178 at JSONKit.m:2831
      frame Renamed hasMove to hasMark #6: 0x000000010a10f700 imobii-waiqin-[NSArray(self=@"3 elements", _cmd="JSONStringWithOptions:error:", serializeOptions=0, error=domain: class name = NSInvocation - code: 0) JSONStringWithOptions:error:] + 112 at JSONKit.m:2985 frame #7: 0x000000010ac13c02 imobii-waiqinRCTJSONStringifyNoRetry(jsonObject=@"3 elements", error=domain: class name = NSInvocation - code: 0) + 338 at RCTUtils.m:49
      frame Support webpack-dev-server #8: 0x000000010ac13990 imobii-waiqinRCTJSONStringify(jsonObject=@"3 elements", error=0x0000000000000000) + 128 at RCTUtils.m:77 frame #9: 0x000000010ab5fdfa imobii-waiqin**27-[RCTContextExecutor setUp]block_invoke_2(.block_descriptor=, moduleName=@"UIManager") + 218 at RCTContextExecutor.m:363
      frame How do I use superagent from react-native? #10: 0x00000001134495cc CoreFoundation__invoking**_ + 140 frame #11: 0x000000011344941e CoreFoundation-[NSInvocation invoke] + 286
      frame Running on device should be possible #12: 0x000000010db13db3 JavaScriptCoreJSC::ObjCCallbackFunctionImpl::call(JSContext_, OpaqueJSValue_, unsigned long, OpaqueJSValue const\* const_, OpaqueJSValue const__) + 451 frame #13: 0x000000010db13926 JavaScriptCoreJSC::objCCallbackFunctionCallAsFunction(OpaqueJSContext const
      , OpaqueJSValue
      , OpaqueJSValue
      , unsigned long, OpaqueJSValue const* const_, OpaqueJSValue const__) + 262
      frame Add response headers to XMLHttpRequest #14: 0x000000010db14bad JavaScriptCorelong long JSC::APICallbackFunction::callJSC::ObjCCallbackFunction(JSC::ExecState_) + 573 frame #15: 0x000000010dade340 JavaScriptCoreJSC::LLInt::setUpCall(JSC::ExecState*, JSC::Instruction*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*) + 528
      frame Improve error when forgetting to npm install #16: 0x000000010dae535d JavaScriptCorellint_entry + 22900 frame #17: 0x000000010dadf7d9 JavaScriptCorevmEntryToJavaScript + 326
      frame Add .DS_Store to gitignore #18: 0x000000010d9b1959 JavaScriptCoreJSC::JITCode::execute(JSC::VM_, JSC::ProtoCallFrame_) + 169 frame #19: 0x000000010d9985ad JavaScriptCoreJSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 493
      frame npm start fails with "Watcher took too long to load" #20: 0x000000010d76cb7e JavaScriptCoreJSC::call(JSC::ExecState_, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 62 frame #21: 0x000000010d929a55 JavaScriptCoreJSC::callGetter(JSC::ExecState_, JSC::JSValue, JSC::JSValue) + 149
      frame Guidance for talking publically #22: 0x000000010dad49fb JavaScriptCorellint_slow_path_get_by_id + 2203 frame #23: 0x000000010dae22f0 JavaScriptCorellint_entry + 10503
      frame React.Image doesn't support animated GIFs on iOS #24: 0x000000010dae5368 JavaScriptCorellint_entry + 22911 frame #25: 0x000000010dae52fd JavaScriptCorellint_entry + 22804
      frame Can NavigatorIOS notify that a "back" happened? #26: 0x000000010dae5368 JavaScriptCorellint_entry + 22911 frame #27: 0x000000010dae5368 JavaScriptCorellint_entry + 22911
      frame unrecognized selector setReactTag #28: 0x000000010dae52fd JavaScriptCorellint_entry + 22804 frame #29: 0x000000010dae5368 JavaScriptCorellint_entry + 22911
      frame Does even bubbling exist, or how to enable cancelsTouchesInView ? #30: 0x000000010dae5368 JavaScriptCorellint_entry + 22911 frame #31: 0x000000010dae5368 JavaScriptCorellint_entry + 22911
      frame npm start fails with FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-21) #32: 0x000000010dae552a JavaScriptCorellint_entry + 23361 frame #33: 0x000000010dae5368 JavaScriptCorellint_entry + 22911
      frame How does calling from JS to Obj-C work? #34: 0x000000010dae5368 JavaScriptCorellint_entry + 22911 frame #35: 0x000000010dadf7d9 JavaScriptCorevmEntryToJavaScript + 326
      frame Carousel component #36: 0x000000010d9b1959 JavaScriptCoreJSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 169 frame #37: 0x000000010d998264 JavaScriptCoreJSC::Interpreter::execute(JSC::ProgramExecutable_, JSC::ExecState_, JSC::JSObject_) + 10404
      frame ScrollView onScroll only fires once #38: 0x000000010d7a8786 JavaScriptCoreJSC::evaluate(JSC::ExecState_, JSC::SourceCode const&, JSC::JSValue, WTF::NakedPtrJSC::Exception&) + 470 frame #39: 0x000000010d9f6fb8 JavaScriptCoreJSEvaluateScript + 424
      frame react-native CLI? #40: 0x000000010ab6379e imobii-waiqin**68-[RCTContextExecutor executeApplicationScript:sourceURL:onComplete:]_block_invoke.264(.block_descriptor=<unavailable>) + 414 at RCTContextExecutor.m:589 frame #41: 0x000000010ab63262 imobii-waiqin__68-[RCTContextExecutor executeApplicationScript:sourceURL:onComplete:]_block_invoke(.block_descriptor=) + 498 at RCTContextExecutor.m:589
      frame Pattern for interacting with the main thread #42: 0x000000010ab63df8 imobii-waiqin-[RCTContextExecutor executeBlockOnJavaScriptQueue:](self=0x00007f9b832f6040, _cmd="executeBlockOnJavaScriptQueue:", block=0x00007f9b80c92970) + 248 at RCTContextExecutor.m:627 frame #43: 0x000000010eb1d7a7 Foundation__NSThreadPerformPerform + 283
      frame Padding at the top of a list view #44: 0x0000000113486301 CoreFoundation__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION** + 17 frame #45: 0x000000011347c22c CoreFoundation__CFRunLoopDoSources0 + 556
      frame Are flexbox animations from JS possible? #46: 0x000000011347b6e3 CoreFoundation**CFRunLoopRun + 867 frame #47: 0x000000011347b0f8 CoreFoundationCFRunLoopRunSpecific + 488
      frame Support for Camera Roll #48: 0x000000010ab5e41b imobii-waiqin+[RCTContextExecutor runRunLoopThread](self=RCTContextExecutor, _cmd="runRunLoopThread") + 363 at RCTContextExecutor.m:284 frame #49: 0x000000010ebc012b Foundation__NSThread__start** + 1198
      frame Fixed formatting of README #50: 0x00000001140869b1 libsystem_pthread.dylib_pthread_body + 131 frame #51: 0x000000011408692e libsystem_pthread.dylib_pthread_start + 168
      frame What's the idea behind the file names inside Components? #52: 0x0000000114084385 libsystem_pthread.dylib`thread_start + 13

…crash on simulator, on device I got nothing but app freezed)!

My app has an old version of JSONKit which is still using MRC. I think JSONKit is not needed if system version is available. Kicking out of JSONKit will make react native stronger.
Crash stack:
* thread facebook#11: tid = 0xbd672f, 0x000000010a10edeb imobii-waiqin`jk_encode_add_atom_to_buffer(encodeState=0x00007f9b820a1000, objectPtr=22 key/value pairs) + 16971 at JSONKit.m:2807, name = 'com.facebook.React.JavaScript', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
    frame #0: 0x000000010a10edeb imobii-waiqin`jk_encode_add_atom_to_buffer(encodeState=0x00007f9b820a1000, objectPtr=22 key/value pairs) + 16971 at JSONKit.m:2807
    frame facebook#1: 0x000000010a10ef67 imobii-waiqin`jk_encode_add_atom_to_buffer(encodeState=0x00007f9b820a1000, objectPtr=2 key/value pairs) + 17351 at JSONKit.m:2811
    frame facebook#2: 0x000000010a10ef67 imobii-waiqin`jk_encode_add_atom_to_buffer(encodeState=0x00007f9b820a1000, objectPtr=25 key/value pairs) + 17351 at JSONKit.m:2811
    frame facebook#3: 0x000000010a10e768 imobii-waiqin`jk_encode_add_atom_to_buffer(encodeState=0x00007f9b820a1000, objectPtr=@"3 elements") + 15304 at JSONKit.m:2778
  * frame facebook#4: 0x000000010a10a26a imobii-waiqin`-[JKSerializer serializeObject:options:encodeOption:block:delegate:selector:error:](self=0x00007f9b831fbc80, _cmd="serializeObject:options:encodeOption:block:delegate:selector:error:", object=@"3 elements", optionFlags=0, encodeOption=10, block=0x0000000000000000, delegate=0x0000000000000000, selector=<no value available>, error=domain: class name = NSInvocation - code: 0) + 2250 at JSONKit.m:2876
    frame facebook#5: 0x000000010a109992 imobii-waiqin`+[JKSerializer serializeObject:options:encodeOption:block:delegate:selector:error:](self=JKSerializer, _cmd="serializeObject:options:encodeOption:block:delegate:selector:error:", object=@"3 elements", optionFlags=0, encodeOption=10, block=0x0000000000000000, delegate=0x0000000000000000, selector=<no value available>, error=domain: class name = NSInvocation - code: 0) + 178 at JSONKit.m:2831
    frame facebook#6: 0x000000010a10f700 imobii-waiqin`-[NSArray(self=@"3 elements", _cmd="JSONStringWithOptions:error:", serializeOptions=0, error=domain: class name = NSInvocation - code: 0) JSONStringWithOptions:error:] + 112 at JSONKit.m:2985
    frame facebook#7: 0x000000010ac13c02 imobii-waiqin`_RCTJSONStringifyNoRetry(jsonObject=@"3 elements", error=domain: class name = NSInvocation - code: 0) + 338 at RCTUtils.m:49
    frame facebook#8: 0x000000010ac13990 imobii-waiqin`RCTJSONStringify(jsonObject=@"3 elements", error=0x0000000000000000) + 128 at RCTUtils.m:77
    frame facebook#9: 0x000000010ab5fdfa imobii-waiqin`__27-[RCTContextExecutor setUp]_block_invoke_2(.block_descriptor=<unavailable>, moduleName=@"UIManager") + 218 at RCTContextExecutor.m:363
    frame facebook#10: 0x00000001134495cc CoreFoundation`__invoking___ + 140
    frame facebook#11: 0x000000011344941e CoreFoundation`-[NSInvocation invoke] + 286
    frame facebook#12: 0x000000010db13db3 JavaScriptCore`JSC::ObjCCallbackFunctionImpl::call(JSContext*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) + 451
    frame facebook#13: 0x000000010db13926 JavaScriptCore`JSC::objCCallbackFunctionCallAsFunction(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) + 262
    frame facebook#14: 0x000000010db14bad JavaScriptCore`long long JSC::APICallbackFunction::call<JSC::ObjCCallbackFunction>(JSC::ExecState*) + 573
    frame facebook#15: 0x000000010dade340 JavaScriptCore`JSC::LLInt::setUpCall(JSC::ExecState*, JSC::Instruction*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*) + 528
    frame facebook#16: 0x000000010dae535d JavaScriptCore`llint_entry + 22900
    frame facebook#17: 0x000000010dadf7d9 JavaScriptCore`vmEntryToJavaScript + 326
    frame facebook#18: 0x000000010d9b1959 JavaScriptCore`JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 169
    frame facebook#19: 0x000000010d9985ad JavaScriptCore`JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 493
    frame facebook#20: 0x000000010d76cb7e JavaScriptCore`JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 62
    frame facebook#21: 0x000000010d929a55 JavaScriptCore`JSC::callGetter(JSC::ExecState*, JSC::JSValue, JSC::JSValue) + 149
    frame facebook#22: 0x000000010dad49fb JavaScriptCore`llint_slow_path_get_by_id + 2203
    frame facebook#23: 0x000000010dae22f0 JavaScriptCore`llint_entry + 10503
    frame facebook#24: 0x000000010dae5368 JavaScriptCore`llint_entry + 22911
    frame facebook#25: 0x000000010dae52fd JavaScriptCore`llint_entry + 22804
    frame facebook#26: 0x000000010dae5368 JavaScriptCore`llint_entry + 22911
    frame facebook#27: 0x000000010dae5368 JavaScriptCore`llint_entry + 22911
    frame facebook#28: 0x000000010dae52fd JavaScriptCore`llint_entry + 22804
    frame facebook#29: 0x000000010dae5368 JavaScriptCore`llint_entry + 22911
    frame facebook#30: 0x000000010dae5368 JavaScriptCore`llint_entry + 22911
    frame facebook#31: 0x000000010dae5368 JavaScriptCore`llint_entry + 22911
    frame facebook#32: 0x000000010dae552a JavaScriptCore`llint_entry + 23361
    frame facebook#33: 0x000000010dae5368 JavaScriptCore`llint_entry + 22911
    frame facebook#34: 0x000000010dae5368 JavaScriptCore`llint_entry + 22911
    frame facebook#35: 0x000000010dadf7d9 JavaScriptCore`vmEntryToJavaScript + 326
    frame facebook#36: 0x000000010d9b1959 JavaScriptCore`JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 169
    frame facebook#37: 0x000000010d998264 JavaScriptCore`JSC::Interpreter::execute(JSC::ProgramExecutable*, JSC::ExecState*, JSC::JSObject*) + 10404
    frame facebook#38: 0x000000010d7a8786 JavaScriptCore`JSC::evaluate(JSC::ExecState*, JSC::SourceCode const&, JSC::JSValue, WTF::NakedPtr<JSC::Exception>&) + 470
    frame facebook#39: 0x000000010d9f6fb8 JavaScriptCore`JSEvaluateScript + 424
    frame facebook#40: 0x000000010ab6379e imobii-waiqin`__68-[RCTContextExecutor executeApplicationScript:sourceURL:onComplete:]_block_invoke.264(.block_descriptor=<unavailable>) + 414 at RCTContextExecutor.m:589
    frame facebook#41: 0x000000010ab63262 imobii-waiqin`__68-[RCTContextExecutor executeApplicationScript:sourceURL:onComplete:]_block_invoke(.block_descriptor=<unavailable>) + 498 at RCTContextExecutor.m:589
    frame facebook#42: 0x000000010ab63df8 imobii-waiqin`-[RCTContextExecutor executeBlockOnJavaScriptQueue:](self=0x00007f9b832f6040, _cmd="executeBlockOnJavaScriptQueue:", block=0x00007f9b80c92970) + 248 at RCTContextExecutor.m:627
    frame facebook#43: 0x000000010eb1d7a7 Foundation`__NSThreadPerformPerform + 283
    frame facebook#44: 0x0000000113486301 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    frame facebook#45: 0x000000011347c22c CoreFoundation`__CFRunLoopDoSources0 + 556
    frame facebook#46: 0x000000011347b6e3 CoreFoundation`__CFRunLoopRun + 867
    frame facebook#47: 0x000000011347b0f8 CoreFoundation`CFRunLoopRunSpecific + 488
    frame facebook#48: 0x000000010ab5e41b imobii-waiqin`+[RCTContextExecutor runRunLoopThread](self=RCTContextExecutor, _cmd="runRunLoopThread") + 363 at RCTContextExecutor.m:284
    frame facebook#49: 0x000000010ebc012b Foundation`__NSThread__start__ + 1198
    frame facebook#50: 0x00000001140869b1 libsystem_pthread.dylib`_pthread_body + 131
    frame facebook#51: 0x000000011408692e libsystem_pthread.dylib`_pthread_start + 168
    frame facebook#52: 0x0000000114084385 libsystem_pthread.dylib`thread_start + 13
@ghost
Copy link

ghost commented Jul 6, 2016

By analyzing the blame information on this pull request, we identified @nicklockwood and @grabbou to be potential reviewers.

@ghost
Copy link

ghost commented Jul 6, 2016

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@dustturtle
Copy link
Author

I don't know why the CI build npm error occured?

@ghost
Copy link

ghost commented Jul 6, 2016

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 6, 2016
@ide
Copy link
Contributor

ide commented Jul 6, 2016

Facebook might still use JSONKit internally. cc @javache

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 12, 2016
@javache
Copy link
Member

javache commented Aug 3, 2016

We're still using JSONKit internally. I'll evaluate if we can get rid of that dependency and revisit this then.

@javache javache closed this Aug 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants