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

[appverifer] Playground crashes on master using direct debugging #6170

Closed
asklar opened this issue Oct 2, 2020 · 14 comments
Closed

[appverifer] Playground crashes on master using direct debugging #6170

asklar opened this issue Oct 2, 2020 · 14 comments
Assignees
Labels
Area: Playground Area: Test Infrastructure bug Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity)
Milestone

Comments

@asklar
Copy link
Member

asklar commented Oct 2, 2020

Load playground with rntester
disable web debugging
reload
app crashes with the stack below

 	Chakra.dll!LocalCallFunction()	Unknown
 	Chakra.dll!Js::JavascriptFunction::CallFunction<1>(class Js::RecyclableObject *,void * (*)(class Js::RecyclableObject *,struct Js::CallInfo,...),struct Js::Arguments,bool)	Unknown
 	Chakra.dll!Js::InterpreterStackFrame::OP_CallCommon<struct Js::OpLayoutDynamicProfile<struct Js::OpLayoutT_CallI<struct Js::LayoutSizePolicy<0> > > >(struct Js::OpLayoutDynamicProfile<struct Js::OpLayoutT_CallI<struct Js::LayoutSizePolicy<0> > > const *,class Js::RecyclableObject *,unsigned int,struct Js::AuxArray<unsigned int> const *)	Unknown
 	Chakra.dll!Js::InterpreterStackFrame::OP_CallI<Js::OpLayoutDynamicProfile<Js::OpLayoutT_CallIWithICIndex<Js::LayoutSizePolicy<0>>>>()	Unknown
 	Chakra.dll!Js::InterpreterStackFrame::ProcessUnprofiled()	Unknown
 	Chakra.dll!Js::InterpreterStackFrame::InterpreterHelper()	Unknown
 	Chakra.dll!Js::InterpreterStackFrame::InterpreterThunk(class Js::JavascriptCallStackLayout *)	Unknown
 	113b1902()	Unknown
 	Chakra.dll!LocalCallFunction()	Unknown
 	Chakra.dll!Js::JavascriptFunction::CallFunction<1>(class Js::RecyclableObject *,void * (*)(class Js::RecyclableObject *,struct Js::CallInfo,...),struct Js::Arguments,bool)	Unknown
 	Chakra.dll!Js::BoundFunction::NewInstance()	Unknown
 	Chakra.dll!LocalCallFunction()	Unknown
 	Chakra.dll!Js::JavascriptFunction::CallFunction<1>(class Js::RecyclableObject *,void * (*)(class Js::RecyclableObject *,struct Js::CallInfo,...),struct Js::Arguments,bool)	Unknown
 	Chakra.dll!Js::JavascriptFunction::CallRootFunctionInternal()	Unknown
 	Chakra.dll!Js::JavascriptFunction::CallRootFunction()	Unknown
 	Chakra.dll!Js::JavascriptFunction::CallRootFunction(struct Js::Arguments,class Js::ScriptContext *,bool)	Unknown
 	Chakra.dll!<lambda>(void)()	Unknown
 	Chakra.dll!ContextAPIWrapper_Core<1,<lambda_bb922596bf9cae1d9d6738ec63b220cc>>()	Unknown
 	Chakra.dll!_JsCallFunction@16�()	Unknown
>	Microsoft.ReactNative.dll!Microsoft::JSI::ChakraRuntime::call(const facebook::jsi::Function & func, const facebook::jsi::Value & jsThis, const facebook::jsi::Value * args, unsigned int count) Line 618	C++
 	Microsoft.ReactNative.dll!facebook::jsi::Function::call(facebook::jsi::Runtime & runtime, const facebook::jsi::Value * args, unsigned int count) Line 228	C++
 	Microsoft.ReactNative.dll!facebook::jsi::Function::call(facebook::jsi::Runtime & runtime, std::initializer_list<facebook::jsi::Value> args) Line 233	C++
 	Microsoft.ReactNative.dll!facebook::jsi::Function::call<std::string const &,std::string const &,facebook::jsi::Value>(facebook::jsi::Runtime & runtime, const std::string & <args_0>, const std::string & <args_1>, facebook::jsi::Value && <args_2>) Line 241	C++
 	Microsoft.ReactNative.dll!facebook::react::JSIExecutor::callFunction::__l6::<lambda>() Line 231	C++
 	Microsoft.ReactNative.dll!std::invoke<void <lambda>(void) &>(facebook::react::JSIExecutor::callFunction::__l6::void <lambda>(void) & _Obj) Line 1597	C++
 	Microsoft.ReactNative.dll!std::_Invoker_ret<void,1>::_Call<void <lambda>(void) &>(facebook::react::JSIExecutor::callFunction::__l6::void <lambda>(void) & <_Vals_0>) Line 1641	C++
 	Microsoft.ReactNative.dll!std::_Func_impl_no_alloc<void <lambda>(void),void>::_Do_call() Line 904	C++
 	Microsoft.ReactNative.dll!std::_Func_class<void>::operator()() Line 951	C++
 	Microsoft.ReactNative.dll!facebook::react::JSIExecutor::defaultTimeoutInvoker(const std::function<void __stdcall(void)> & invokee, std::function<std::string __stdcall(void)> errorMessageProducer) Line 108	C++
 	Microsoft.ReactNative.dll!std::invoke<void (__stdcall*&)(std::function<void __stdcall(void)> const &,std::function<std::string __stdcall(void)>),std::function<void __stdcall(void)> const &,std::function<std::string __stdcall(void)>>(void(__stdcall*)(const std::function<void __stdcall(void)> &, std::function<std::string __stdcall(void)>) & _Obj, const std::function<void __stdcall(void)> & _Arg1, std::function<std::string __stdcall(void)> && <_Args2_0>) Line 1626	C++
 	Microsoft.ReactNative.dll!std::_Invoker_ret<void,1>::_Call<void (__stdcall*&)(std::function<void __stdcall(void)> const &,std::function<std::string __stdcall(void)>),std::function<void __stdcall(void)> const &,std::function<std::string __stdcall(void)>>(void(__stdcall*)(const std::function<void __stdcall(void)> &, std::function<std::string __stdcall(void)>) & <_Vals_0>, const std::function<void __stdcall(void)> & <_Vals_1>, std::function<std::string __stdcall(void)> && <_Vals_2>) Line 1641	C++
 	Microsoft.ReactNative.dll!std::_Func_impl_no_alloc<void (__stdcall*)(std::function<void __stdcall(void)> const &,std::function<std::string __stdcall(void)>),void,std::function<void __stdcall(void)> const &,std::function<std::string __stdcall(void)>>::_Do_call(const std::function<void __stdcall(void)> & <_Args_0>, std::function<std::string __stdcall(void)> && <_Args_1>) Line 904	C++
 	Microsoft.ReactNative.dll!std::_Func_class<void,std::function<void __stdcall(void)> const &,std::function<std::string __stdcall(void)>>::operator()(const std::function<void __stdcall(void)> & <_Args_0>, std::function<std::string __stdcall(void)> <_Args_1>) Line 951	C++
 	Microsoft.ReactNative.dll!facebook::react::JSIExecutor::callFunction(const std::string & moduleId, const std::string & methodId, const folly::dynamic & arguments) Line 229	C++
 	Microsoft.ReactNative.dll!facebook::react::NativeToJsBridge::callFunction::__l2::<lambda>(facebook::react::JSExecutor * executor) Line 207	C++
 	Microsoft.ReactNative.dll!std::invoke<void <lambda>(facebook::react::JSExecutor *) &,facebook::react::JSExecutor *>(facebook::react::NativeToJsBridge::callFunction::__l2::void <lambda>(facebook::react::JSExecutor *) & _Obj, facebook::react::JSExecutor * && _Arg1) Line 1626	C++
 	Microsoft.ReactNative.dll!std::_Invoker_ret<void,1>::_Call<void <lambda>(facebook::react::JSExecutor *) &,facebook::react::JSExecutor *>(facebook::react::NativeToJsBridge::callFunction::__l2::void <lambda>(facebook::react::JSExecutor *) & <_Vals_0>, facebook::react::JSExecutor * && <_Vals_1>) Line 1641	C++
 	Microsoft.ReactNative.dll!std::_Func_impl_no_alloc<void <lambda>(facebook::react::JSExecutor *),void,facebook::react::JSExecutor *>::_Do_call(facebook::react::JSExecutor * && <_Args_0>) Line 904	C++
 	Microsoft.ReactNative.dll!std::_Func_class<void,facebook::react::JSExecutor *>::operator()(facebook::react::JSExecutor * <_Args_0>) Line 951	C++
 	Microsoft.ReactNative.dll!facebook::react::NativeToJsBridge::runOnExecutorQueue::__l2::<lambda>() Line 311	C++
 	Microsoft.ReactNative.dll!std::invoke<void <lambda>(void) &>(facebook::react::NativeToJsBridge::runOnExecutorQueue::__l2::void <lambda>(void) & _Obj) Line 1597	C++
 	Microsoft.ReactNative.dll!std::_Invoker_ret<void,1>::_Call<void <lambda>(void) &>(facebook::react::NativeToJsBridge::runOnExecutorQueue::__l2::void <lambda>(void) & <_Vals_0>) Line 1641	C++
@asklar asklar added the bug label Oct 2, 2020
@ghost ghost added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Oct 2, 2020
@asklar
Copy link
Member Author

asklar commented Oct 2, 2020

CC @acoates-ms @tido64 fyi, I'm synced to 489d342
Fix native modules not being re-initialized on reload (#6159)

Could this be related since it's got to do with initialization?

@asklar asklar changed the title [regression] Playground crashes on master when reloading [regression] Playground crashes on master using direct debugging Oct 2, 2020
@asklar
Copy link
Member Author

asklar commented Oct 2, 2020

I also see a TimingModule assert firing a lot. @NickGerleman I remember you recently worked on this code?

0:007> g
Assertion failed!

Program: ...ws\Debug\playground\AppX\Microsoft.ReactNative.dll
File: E:\rnw\vnext\Microsoft.ReactNative\M...\TimingModule.cpp
Line: 125

Expression: false && "getInstance().lock failed"

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)(62a0.b6f4): Break instruction exception - code 80000003 (first chance)
eax=00000004 ebx=00cb9fb0 ecx=00000000 edx=00900000 esi=02f0e9f4 edi=02f0eb68
eip=7bb63eb6 esp=02f0e518 ebp=02f0e9ac iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
ucrtbased!common_assert_to_message_box<wchar_t>+0xc6:
7bb63eb6 cc              int     3
0:007> k
 # ChildEBP RetAddr      
00 02f0e9ac 7bb63d04     ucrtbased!common_assert_to_message_box<wchar_t>+0xc6 [minkernel\crts\ucrt\src\appcrt\startup\assert.cpp @ 388] 
01 02f0e9c8 7bb65c7a     ucrtbased!common_assert<wchar_t>+0x64 [minkernel\crts\ucrt\src\appcrt\startup\assert.cpp @ 423] 
02 02f0e9e0 04be741a     ucrtbased!_wassert+0x1a [minkernel\crts\ucrt\src\appcrt\startup\assert.cpp @ 443] 
03 02f0eb74 04befe6e     Microsoft_ReactNative!react::uwp::Timing::createTimer+0x1da [E:\rnw\vnext\Microsoft.ReactNative\Modules\TimingModule.cpp @ 125] 
04 02f0ebcc 04becb1e     Microsoft_ReactNative!<lambda_3eeaef217aa9a259813d0cfb31125f6b>::operator()+0xce [E:\rnw\vnext\Microsoft.ReactNative\Modules\TimingModule.cpp @ 193] 
05 02f0ec08 04be98fa     Microsoft_ReactNative!std::invoke<<lambda_3eeaef217aa9a259813d0cfb31125f6b> &,folly::dynamic>+0x2e [C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.27.29110\include\type_traits @ 1626] 
06 02f0ec18 04bf11ae     Microsoft_ReactNative!std::_Invoker_ret<void,1>::_Call<<lambda_3eeaef217aa9a259813d0cfb31125f6b> &,folly::dynamic>+0x1a [C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.27.29110\include\type_traits @ 1641] 

@tido64
Copy link
Member

tido64 commented Oct 2, 2020

I'm not able to repro this locally in my own project running 0.63 + my fix:

  • Remote debugging disabled
  • Direct debugging enabled

I have seen the TimingModule assertion from time to time as well. Even on 0.62.

@NickGerleman
Copy link
Collaborator

TimingModule has two assertions that it can get a strong instance of Instance. My change removed once of them, where we were assuming the instance was alive in cases where it wouldn't necessarily be, and that was fine.

The other, still present assertion should likely be removed as well. TimingModule methods are currently dispatched to the UI thread before execution, so the instance going away is still a possible case.

@NickGerleman
Copy link
Collaborator

Unable to repo on the current master branch when loading without web deugging checked. Did not test reloading after changing the option, but that has been flaky for some time I think.

image

@NickGerleman
Copy link
Collaborator

Unable to repo when switching from web debugger, unchecking, and loading an instance.

@asklar
Copy link
Member Author

asklar commented Oct 2, 2020

I'm running playground.exe with appverifier turned on, can you guys try to do the same? I'm able to get the Chakra crash fairly consistently which I hadn't gotten until yesterday.

@asklar asklar changed the title [regression] Playground crashes on master using direct debugging [appverifer] Playground crashes on master using direct debugging Oct 2, 2020
@tido64
Copy link
Member

tido64 commented Oct 3, 2020

Re-ran my local project running 0.63.3 + 489d342 cherry-picked with App Verifier. Still no repro. I did hit an exception when toggling the element inspector but I can't get a reliable repro.

@asklar
Copy link
Member Author

asklar commented Oct 3, 2020

thanks @tido64 . It's odd (but good! :) ) that you're not hitting it, maybe there's something different about my setup; I'm running what's in master so maybe that's it.

@chrisglein
Copy link
Member

@asklar It looks like there's been some issue reproducing this so we may need more environment info. Windows version combination maybe?

If we think we have deep issues AppVerifier might catch is there somewhere we can expand coverage? Does E2Etest use it? Should we expand to run Playground?

@chrisglein chrisglein added Area: Playground Area: Test Infrastructure Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) and removed Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) labels Oct 5, 2020
@chrisglein chrisglein added this to the Backlog milestone Oct 5, 2020
@ghost
Copy link

ghost commented Oct 12, 2020

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 14 days of this comment.

@ghost ghost added the no-recent-activity Issue/PR has gone stale and may be closed (label applied by bot) label Oct 12, 2020
@exotexot
Copy link

I also see a TimingModule assert firing a lot. @NickGerleman I remember you recently worked on this code?

0:007> g
Assertion failed!

Program: ...ws\Debug\playground\AppX\Microsoft.ReactNative.dll
File: E:\rnw\vnext\Microsoft.ReactNative\M...\TimingModule.cpp
Line: 125

Expression: false && "getInstance().lock failed"

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)(62a0.b6f4): Break instruction exception - code 80000003 (first chance)
eax=00000004 ebx=00cb9fb0 ecx=00000000 edx=00900000 esi=02f0e9f4 edi=02f0eb68
eip=7bb63eb6 esp=02f0e518 ebp=02f0e9ac iopl=0         nv up ei pl zr na pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
ucrtbased!common_assert_to_message_box<wchar_t>+0xc6:
7bb63eb6 cc              int     3
0:007> k
 # ChildEBP RetAddr      
00 02f0e9ac 7bb63d04     ucrtbased!common_assert_to_message_box<wchar_t>+0xc6 [minkernel\crts\ucrt\src\appcrt\startup\assert.cpp @ 388] 
01 02f0e9c8 7bb65c7a     ucrtbased!common_assert<wchar_t>+0x64 [minkernel\crts\ucrt\src\appcrt\startup\assert.cpp @ 423] 
02 02f0e9e0 04be741a     ucrtbased!_wassert+0x1a [minkernel\crts\ucrt\src\appcrt\startup\assert.cpp @ 443] 
03 02f0eb74 04befe6e     Microsoft_ReactNative!react::uwp::Timing::createTimer+0x1da [E:\rnw\vnext\Microsoft.ReactNative\Modules\TimingModule.cpp @ 125] 
04 02f0ebcc 04becb1e     Microsoft_ReactNative!<lambda_3eeaef217aa9a259813d0cfb31125f6b>::operator()+0xce [E:\rnw\vnext\Microsoft.ReactNative\Modules\TimingModule.cpp @ 193] 
05 02f0ec08 04be98fa     Microsoft_ReactNative!std::invoke<<lambda_3eeaef217aa9a259813d0cfb31125f6b> &,folly::dynamic>+0x2e [C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.27.29110\include\type_traits @ 1626] 
06 02f0ec18 04bf11ae     Microsoft_ReactNative!std::_Invoker_ret<void,1>::_Call<<lambda_3eeaef217aa9a259813d0cfb31125f6b> &,folly::dynamic>+0x1a [C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.27.29110\include\type_traits @ 1641] 

Getting this crash a lot when running the App in Debug mode. Running on react-native 0.62.2 and react-native-windows 0.62.12

@ghost ghost removed the no-recent-activity Issue/PR has gone stale and may be closed (label applied by bot) label Oct 16, 2020
@NickGerleman
Copy link
Collaborator

@exotexot the Timing related assertion is a bit of a red hearing, and itself should not be the root cause of a crash. The assertion will be removed in RNW 0.64, and should be ignorable.

We did have some unrelated crashes on instance reload that were fixed in 0.63. If you're still seeing a crash on 0.63+, filing a new issue with details would definitely be appreciated.

@exotexot
Copy link

exotexot commented Oct 16, 2020

Still running on 0.62.12 and cannot really update at the Moment. But anyway thanks for providing more info on this topic.

@asklar asklar closed this as completed Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Playground Area: Test Infrastructure bug Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity)
Projects
None yet
Development

No branches or pull requests

5 participants