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

V8 inspector agent crashes on shutdown after attaching debugger when running unit tests #21

Closed
bghgary opened this issue Mar 29, 2023 · 0 comments · Fixed by #84
Closed
Milestone

Comments

@bghgary
Copy link
Contributor

bghgary commented Mar 29, 2023

Describe the bug
The unit tests crash on shutdown after attaching a debugger (e.g., with ChromeDevTools).

To Reproduce
Steps to reproduce the behavior:

  1. Set waitForDebugger to true in tests.js.
  2. Run the unit tests.
  3. Attach the V8 debugger using Chrome about://inspect.
  4. Continue when the debugger; statement hits.
  5. Unit tests crashes after completing the tests

Call Stack

<unknown> 0x000071421b6815bf
<unknown> 0x000071421b6837bd
<unknown> 0x000071421b683a29
std::__ndk1::default_delete::operator()(v8_inspector::V8InspectorSession *) const memory:2338
std::__ndk1::unique_ptr::reset(v8_inspector::V8InspectorSession *) memory:2593
std::__ndk1::unique_ptr::~unique_ptr() memory:2547
Babylon::V8NodeInspector::~V8NodeInspector() V8InspectorAgent.cpp:183
Babylon::V8NodeInspector::~V8NodeInspector() V8InspectorAgent.cpp:183
std::__ndk1::default_delete::operator()(Babylon::V8NodeInspector *) const memory:2338
std::__ndk1::unique_ptr::reset(Babylon::V8NodeInspector *) memory:2593
Babylon::AgentImpl::Stop() V8InspectorAgent.cpp:417
Babylon::V8InspectorAgent::stop() V8InspectorAgent.cpp:667
Babylon::AppRuntime::RunEnvironmentTier(const char *) AppRuntime_V8.cpp:91
Babylon::AppRuntime::RunPlatformTier() AppRuntime_Android.cpp:10
$_1::operator()() const AppRuntime.cpp:12
decltype(std::__ndk1::forward<Babylon::AppRuntime::AppRuntime(std::__ndk1::function<void (std::exception const&)>)::$_1&>(fp)()) std::__ndk1::__invoke<Babylon::AppRuntime::AppRuntime(std::__ndk1::function<void (std::exception const&)>)::$_1&>(Babylon::AppRuntime::AppRuntime(std::__ndk1::function<void (std::exception const&)>)::$_1&) type_traits:3501
std::__ndk1::__invoke_void_return_wrapper::__call<…>($_1 &) __functional_base:348
std::__ndk1::__function::__alloc_func::operator()() functional:1540
std::__ndk1::__function::__func::operator()() functional:1714
std::__ndk1::__function::__value_func::operator()() const functional:1867
std::__ndk1::function::operator()() const functional:2473
decltype(std::__ndk1::forward<std::__ndk1::function<void ()> >(fp)()) std::__ndk1::__invoke<std::__ndk1::function<void ()> >(std::__ndk1::function<void ()>&&) type_traits:3501
std::__ndk1::__thread_execute<…>(std::__ndk1::tuple<…> &, std::__ndk1::__tuple_indices<…>) thread:273
std::__ndk1::__thread_proxy<…>(void *) thread:283
__pthread_start(void *) 0x00007142b5480f3c
__start_thread 0x00007142b542fc8e
__bionic_clone 0x00007142b542e516

Expected behavior
The unit tests to exit cleanly.

Other

  • Platform: Android
bghgary added a commit that referenced this issue Mar 29, 2023
- Add support for V8 debugging via the V8 inspector protocol, moved from
Babylon Native repo, updated with simpler build steps for `llhttp`
dependencies.
- Fix issue with large JS files not working. `asio` usage was incorrect
in the v8 inspector agent.
- Add some JS logic to wait for debugger when requested.

There is a known issue where the inspector agent crashes after the unit
tests end after attaching a debugger. #21
@bghgary bghgary added this to the 7.0 milestone Jul 17, 2023
bghgary added a commit that referenced this issue Mar 20, 2024
- Remove dead code in V8 inspector
- Fix race condition on V8 inspector shutdown
- Add options struct to AppRuntime to support new WaitForDebugger flag
- Use new WaitForDebugger flag in JavaScript tests
- Remove newline from console log callback

Fixes #21
Fixes #61
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.

1 participant