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

plugin test is flaky on windows #3473

Closed
ry opened this issue Dec 9, 2019 · 8 comments · Fixed by #5210
Closed

plugin test is flaky on windows #3473

ry opened this issue Dec 9, 2019 · 8 comments · Fixed by #5210

Comments

@ry
Copy link
Member

ry commented Dec 9, 2019

ex1 https://github.com/denoland/deno/pull/3470/checks?check_run_id=340389213
ex2 https://github.com/denoland/deno/pull/3467/checks?check_run_id=340012284

2019-12-09T16:52:40.7820723Z test basic ... FAILED
2019-12-09T16:52:40.7820950Z 
2019-12-09T16:52:40.7821938Z failures:
2019-12-09T16:52:40.7822131Z 
2019-12-09T16:52:40.7822526Z ---- basic stdout ----
2019-12-09T16:52:40.7822888Z target_dir D:\a\deno\deno\target\release
2019-12-09T16:52:40.7823084Z target_dir D:\a\deno\deno\target\release
2019-12-09T16:52:40.7823290Z stdout Hello from plugin. data: test | zero_copy: test
2019-12-09T16:52:40.7823496Z Plugin Sync Response: test
2019-12-09T16:52:40.7824000Z 
2019-12-09T16:52:40.7824961Z stderr 
2019-12-09T16:52:40.7825174Z 
2019-12-09T16:52:40.7825352Z #
2019-12-09T16:52:40.7825549Z # Fatal error in , line 0
2019-12-09T16:52:40.7825745Z # ignored
2019-12-09T16:52:40.7825933Z #
2019-12-09T16:52:40.7826118Z #
2019-12-09T16:52:40.7826282Z #
2019-12-09T16:52:40.7826478Z #FailureMessage Object: 0000008B0EDFD330
2019-12-09T16:52:40.7826848Z ==== C stack trace ===============================
2019-12-09T16:52:40.7827031Z 
2019-12-09T16:52:40.7827264Z 	v8::base::debug::StackTrace::StackTrace [0x00007FF6C68D499B+27]
2019-12-09T16:52:40.7827511Z 	v8::platform::DefaultPlatform::GetStackTracePrinter [0x00007FF6C6726317+55]
2019-12-09T16:52:40.7827724Z 	V8_Fatal [0x00007FF6C6724DB9+217]
2019-12-09T16:52:40.7827936Z 	v8::internal::GlobalBackingStoreRegistry::Register [0x00007FF6C6832689+441]
2019-12-09T16:52:40.7828137Z 	v8::ArrayBuffer::GetBackingStore [0x00007FF6C6715636+262]
2019-12-09T16:52:40.7828350Z 	deno::Send [0x00007FF6C672110C+284]
2019-12-09T16:52:40.7828564Z 	v8::internal::FunctionCallbackArguments::Call [0x00007FF6C6AE557D+589]
2019-12-09T16:52:40.7828784Z 	v8::internal::Builtins::InvokeApiFunction [0x00007FF6C6AE49CA+2378]
2019-12-09T16:52:40.7829031Z 	v8::internal::Builtin_HandleApiCall [0x00007FF6C6AE3FFC+1020]
2019-12-09T16:52:40.7829248Z 	v8::internal::Builtin_HandleApiCall [0x00007FF6C6AE3C47+71]
2019-12-09T16:52:40.7829447Z 	Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [0x00007FF6C695559D+61]
2019-12-09T16:52:40.7829671Z 	Builtins_InterpreterEntryTrampoline [0x00007FF6C68E125B+187]
2019-12-09T16:52:40.7829888Z 	Builtins_InterpreterEntryTrampoline [0x00007FF6C68E125B+187]
2019-12-09T16:52:40.7830093Z 	Builtins_InterpreterEntryTrampoline [0x00007FF6C68E125B+187]
2019-12-09T16:52:40.7830297Z 	Builtins_InterpreterEntryTrampoline [0x00007FF6C68E125B+187]
2019-12-09T16:52:40.7830502Z 	Builtins_InterpreterEntryTrampoline [0x00007FF6C68E125B+187]
2019-12-09T16:52:40.7830685Z 	Builtins_GeneratorPrototypeNext [0x00007FF6C6913072+146]
2019-12-09T16:52:40.7830888Z 	Builtins_JSEntryTrampoline [0x00007FF6C68DEADE+94]
2019-12-09T16:52:40.7831220Z 	Builtins_JSEntry [0x00007FF6C68DE6CC+204]
2019-12-09T16:52:40.7831476Z 	v8::internal::Execution::Call [0x00007FF6C67C7AF6+1062]
2019-12-09T16:52:40.7831688Z 	v8::internal::Execution::Call [0x00007FF6C67C77C3+243]
2019-12-09T16:52:40.7831891Z 	v8::internal::SourceTextModule::ExecuteModule [0x00007FF6C67CFA3F+287]
2019-12-09T16:52:40.7832117Z 	v8::internal::SourceTextModule::InnerModuleEvaluation [0x00007FF6C67CF27F+1071]
2019-12-09T16:52:40.7832338Z 	v8::internal::SourceTextModule::Evaluate [0x00007FF6C67CEDB2+146]
2019-12-09T16:52:40.7832567Z 	v8::internal::SourceTextModule::EvaluateMaybeAsync [0x00007FF6C67CEB5E+302]
2019-12-09T16:52:40.7832785Z 	v8::internal::Module::Evaluate [0x00007FF6C67CA905+101]
2019-12-09T16:52:40.7832990Z 	v8::Module::Evaluate [0x00007FF6C6711226+486]
2019-12-09T16:52:40.7833169Z 	deno_mod_evaluate [0x00007FF6C670C206+230]
2019-12-09T16:52:40.7833381Z 	ZN4deno7isolate7Isolate12mod_evaluate17hcc2f0fdc8c14dcb6E [0x00007FF6C662899E+30]
2019-12-09T16:52:40.7833621Z 	ZN80_$LT$std..future..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$4poll17h4a15c2b98a574942E [0x00007FF6C625DCDB+1963]
2019-12-09T16:52:40.7833877Z 	ZN80_$LT$std..future..GenFuture$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$4poll17hb38b650467cbede1E [0x00007FF6C625FE54+1044]
2019-12-09T16:52:40.7834127Z 	ZN97_$LT$futures_util..compat..compat03as01..Compat$LT$Fut$GT$$u20$as$u20$futures..future..Future$GT$4poll17h4d9b699aa4581661E [0x00007FF6C61A4F33+83]
2019-12-09T16:52:40.7834500Z 	ZN7futures6future5chain22Chain$LT$A$C$B$C$C$GT$4poll17hd679173e7149e6ecE [0x00007FF6C610EF11+97]
2019-12-09T16:52:40.7834722Z 	ZN7futures9task_impl3std3set17hc40a385e2375be91E [0x00007FF6C6602280+96]
2019-12-09T16:52:40.7834924Z 	ZN3std9panicking3try7do_call17hcb4923d650ed8541E.llvm.5887183077164218732 [0x00007FF6C6601F35+149]
2019-12-09T16:52:40.7835175Z 	panic_unwind::__rust_maybe_catch_panic [0x00007FF6C66F4272+34] (/rustc/4560ea788cb760f0a34127156c78e2552949f734\/src\libpanic_unwind\lib.rs:80)
2019-12-09T16:52:40.7835400Z 	ZN16tokio_threadpool4task4Task3run17hb52befe50050fc40E [0x00007FF6C660B8B5+245]
2019-12-09T16:52:40.7835623Z 	ZN16tokio_threadpool6worker6Worker3run17h62be210ba81dc782E [0x00007FF6C6600136+3366]
2019-12-09T16:52:40.7835913Z 	ZN16tokio_threadpool6worker6Worker3run17h62be210ba81dc782E [0x00007FF6C65FF813+1027]
2019-12-09T16:52:40.7836620Z 	ZN3std6thread5local17LocalKey$LT$T$GT$4with17h602f66a0b54c5d82E [0x00007FF6C65E10D9+153]
2019-12-09T16:52:40.7836991Z error: test failed, to rerun pass '-p test_plugin --test integration_tests'
2019-12-09T16:52:40.7837134Z 	ZN3std6thread5local17LocalKey$LT$T$GT$4with17h952ea0e63369e2c8E [0x00007FF6C65E1354+212]
2019-12-09T16:52:40.7837397Z 	ZN96_$LT$tokio_threadpool..park..boxed..BoxedPark$LT$T$GT$$u20$as$u20$tokio_executor..park..Park$GT$6unpark17ha9dd4ebec68c4809E [0x00007FF6C65E87E0+224]
2019-12-09T16:52:40.7837642Z 	ZN3std6thread5local17LocalKey$LT$T$GT$4with17h31781bbcad31b5fbE [0x00007FF6C6607CD3+147]
2019-12-09T16:52:40.7837871Z 	ZN3std6thread5local17LocalKey$LT$T$GT$4with17h9dd6dab994fa9906E [0x00007FF6C6608257+151]
2019-12-09T16:52:40.7838103Z 	ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h1bca0a7c71f16f26E [0x00007FF6C660AD21+241]
2019-12-09T16:52:40.7838317Z 	ZN3std9panicking3try7do_call17hc8e4e3ad30f41392E.llvm.5887183077164218732 [0x00007FF6C6601E8F+31]
2019-12-09T16:52:40.7838698Z 	panic_unwind::__rust_maybe_catch_panic [0x00007FF6C66F4272+34] (/rustc/4560ea788cb760f0a34127156c78e2552949f734\/src\libpanic_unwind\lib.rs:80)
2019-12-09T16:52:40.7838941Z 	ZN3std6thread7Builder5spawn17he4f870f7a6333807E [0x00007FF6C6602B90+992]
2019-12-09T16:52:40.7839191Z 	alloc::boxed::{{impl}}::call_once<(),FnOnce<()>> [0x00007FF6C66D0817+87] (/rustc/4560ea788cb760f0a34127156c78e2552949f734\src\liballoc\boxed.rs:922)
2019-12-09T16:52:40.7839448Z 	std::sys::windows::thread::{{impl}}::new::thread_start [0x00007FF6C66F22F7+119] (/rustc/4560ea788cb760f0a34127156c78e2552949f734\/src\libstd\sys\windows\thread.rs:47)
2019-12-09T16:52:40.7839671Z 	BaseThreadInitThunk [0x00007FFA68647974+20]
2019-12-09T16:52:40.7839872Z 	RtlUserThreadStart [0x00007FFA6B3AA271+33]
2019-12-09T16:52:40.7840014Z 
2019-12-09T16:52:40.7840238Z thread 'basic' panicked at 'assertion failed: output.status.success()', test_plugin\tests\integration_tests.rs:36:3
2019-12-09T16:52:40.7840478Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-12-09T16:52:40.7840639Z 
2019-12-09T16:52:40.7840810Z 
2019-12-09T16:52:40.7840986Z failures:
2019-12-09T16:52:40.7841181Z     basic
2019-12-09T16:52:40.7841340Z 
2019-12-09T16:52:40.7841528Z test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
2019-12-09T16:52:40.7841702Z 
2019-12-09T16:52:41.0053770Z ##[error]Process completed with exit code 1.
2019-12-09T16:52:41.0106046Z Cleaning up orphan processes
2019-12-09T16:52:41.0892995Z Terminate orphan process: pid (3560) (sccache)
@ry ry changed the title plugin test is flaky on windows? plugin test is flaky on windows Dec 9, 2019
@lucacasonato
Copy link
Member

@ozyman42
Copy link

Will Deno have a standard plugin API?

@ozyman42
Copy link

I'd like to be able to implement hot module swapping.

@kitsonk
Copy link
Contributor

kitsonk commented Feb 15, 2020

@alexleung it isn't helpful commenting like this on a random issue.

I will admit we don't mention the plugin API in the manual though. 😢 But it was merged in #3372. We really need docs for it @bartlomieju @afinch7.

@gewoonwoutje
Copy link
Contributor

I've been playing around with this issue a bit. On my PC it fails consistently, and I can't figure out how this test can succeed on non-windows devices. I'm creating a PR with some changes that fix the flakyness, but in turn also hide some error. I hope that the PR will point someone in the right direction to fix it more definitively.

In summary there are 2 problems:

  1. Deno exits before the async values are returned to js (i.e. response is not awaited) - note that the Plugin Async Response: test log statement is missing.
  2. Deno exits js with a non-zero code implicitly, while no errors are thrown in js.

@piscisaureus
Copy link
Member

piscisaureus commented May 10, 2020

I know what the problem is here btw: on shutdown, when CoreIsolate is dropped, the resource table gets dropped first, and when the resource table gets dropped the plugin DLL is unloaded and unmapped from memory.

Then the ops and op-dispatchers are dropped. When a plugin op or op dispatcher's drop handler (now at an unmapped address) runs, you can guess what happens.

I don't know why this is not an issue on linux / mac. Maybe the drop order is different. But it seems more likely that they just don't support unloading SOs/DYLIBs so dropping the plugin too early doesn't matter.

@ry
Copy link
Member Author

ry commented May 10, 2020

Maybe we should make async ops own a reference to the resource table (which IIRC is an Rc Refcell)..

@piscisaureus
Copy link
Member

piscisaureus commented May 10, 2020

Maybe we should make async ops own a reference to the resource table (which IIRC is an Rc Refcell)..

That works until someone writes a plugin that defines it's own resource type with drop handler.

I started on a patch making plugin ops have a reference to Rc<Library> yesterday but then I fell asleep.

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

Successfully merging a pull request may close this issue.

6 participants