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

fatal v8 error:Entering the V8 API without proper locking in place #23997

Closed
lolobug opened this issue Oct 31, 2018 · 7 comments
Closed

fatal v8 error:Entering the V8 API without proper locking in place #23997

lolobug opened this issue Oct 31, 2018 · 7 comments
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. embedding Issues and PRs related to embedding Node.js in another project. v8 engine Issues and PRs related to the V8 dependency.

Comments

@lolobug
Copy link

lolobug commented Oct 31, 2018

stack :
signal 6 (SIGABRT), code -6 (?), fault addr 00004d37
#00  pc 0x39acc  /system/lib/libc.so (tgkill+12)
#01  pc 0x13dad  /system/lib/libc.so (pthread_kill+52)
#02  pc 0x14a27  /system/lib/libc.so (raise+10)
#03  pc 0x11145  /system/lib/libc.so (???)
#04  pc 0xf6ac  /system/lib/libc.so (abort+4)
#05  pc 0x37291  /data/app/com.xxxx-1/lib/arm/libj2v8.so (???)
#06  pc 0x3943ed  /data/app/com.xxxx-1/lib/arm/libv8.so (v8::HandleScope::Initialize(v8::Isolate*)+100)
#07  pc 0x394381  /data/app/com.xxxx-1/lib/arm/libv8.so (v8::HandleScope::HandleScope(v8::Isolate*)+4)
#08  pc 0xbccdc  /data/app/com.xxxx-1/lib/arm/libnode.so (node::Environment::CheckImmediate(uv_check_s*)+40)
  • Version:10.3.0
  • Platform:android:
    Subsystem:

V8 fatat handler message : Entering the V8 API without proper locking in place (HandleScope::HandleScope)
This occurs by chance.

I noticed :

uv_check_start(immediate_check_handle(), CheckImmediate);

Actually I place all the operations of node in a single thread and use a V8::Locker.
Is it possible that the CheckImmediate will switch to another thread?

there's V8 HandleScope::Initialize code:

Utils::ApiCheck(
  !v8::Locker::IsActive() ||
  internal_isolate->thread_manager()->IsLockedByCurrentThread() ||
   internal_isolate->serializer_enabled(),
   "HandleScope::HandleScope",
   "Entering the V8 API without proper locking in place");
@Trott Trott added c++ Issues and PRs that require attention from people who are familiar with C++. v8 engine Issues and PRs related to the V8 dependency. labels Nov 3, 2018
@Trott
Copy link
Member

Trott commented Nov 4, 2018

I know Android is currently an unsupported platform, but any chance someone wants to comment on this issue? @nodejs/v8

@hashseed
Copy link
Member

hashseed commented Nov 4, 2018

Don't use lockers if you only use a single thread.

I can't provide any more advice without more context unfortunately.

@refack
Copy link
Contributor

refack commented Nov 4, 2018

@JaneaSystems have a working Android version (@joaocgreis, @bzoz)

@lolobug
Copy link
Author

lolobug commented Nov 5, 2018

Don't use lockers if you only use a single thread.

I can't provide any more advice without more context unfortunately.

Thanks @hashseed . It may be solved without using a locker.
But I want to know whether the "CheckImmediate" callback switch to another thread from the main thread of the uv loop.
uv_check_start(immediate_check_handle(), CheckImmediate);

@jaimecbernardo
Copy link
Contributor

@JaneaSystems have a working Android version (@joaocgreis, @bzoz)

Regarding https://github.com/janeasystems/nodejs-mobile on Android:

We don't have any related issue, nor have anything similar happened on out tests, so I'm not sure what this can be. Our scenario is single threaded use for mobile, so it may not even occur inside that scenario, since we're not using the mentioned V8::Locker.

@addaleax addaleax added the embedding Issues and PRs related to embedding Node.js in another project. label Nov 5, 2018
@addaleax
Copy link
Member

addaleax commented Nov 5, 2018

@lolobug This sounds like an issue with embedding Node and using libnode.so, but that means that, most likely, we are unable to help unless you share more information about your embedding usage (for example, your code?).

@Trott
Copy link
Member

Trott commented Nov 13, 2018

I'm going to close this, but feel free to re-open if code is shared from original poster or if it otherwise becomes possible to troubleshoot further.

@Trott Trott closed this as completed Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. embedding Issues and PRs related to embedding Node.js in another project. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

No branches or pull requests

6 participants