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

The embedded Node.js example leads to a crash #42670

Closed
mmomtchev opened this issue Apr 9, 2022 · 0 comments · Fixed by #42671
Closed

The embedded Node.js example leads to a crash #42670

mmomtchev opened this issue Apr 9, 2022 · 0 comments · Fixed by #42671

Comments

@mmomtchev
Copy link
Contributor

Version

18.x

Platform

Linux

Subsystem

Embedded Node

What steps will reproduce the bug?

Compile and run the example from https://github.com/nodejs/node/blob/master/doc/api/embedding.md

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior?

A working example

What do you see instead?

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff24ba700 (LWP 352617)]
[New Thread 0x7ffff1cb9700 (LWP 352618)]
[New Thread 0x7ffff14b8700 (LWP 352619)]
[New Thread 0x7ffff0cb7700 (LWP 352620)]
[New Thread 0x7fffebfff700 (LWP 352621)]
[New Thread 0x7ffff2a84700 (LWP 352622)]
FATAL ERROR: v8::HandleScope::CreateHandle() Cannot create a handle without a HandleScope
 1: 0x7ffff3707ddc node::Abort() [/home/mmom/src/node/out/Release/libnode.so.105]
 2: 0x7ffff36014a8  [/home/mmom/src/node/out/Release/libnode.so.105]
 3: 0x7ffff412e2e1 v8::Utils::ReportApiFailure(char const*, char const*) [/home/mmom/src/node/out/Release/libnode.so.105]
 4: 0x7ffff42b3aa6 v8::internal::HandleScope::Extend(v8::internal::Isolate*) [/home/mmom/src/node/out/Release/libnode.so.105]
 5: 0x7ffff412f73d v8::HandleScope::CreateHandle(v8::internal::Isolate*, unsigned long) [/home/mmom/src/node/out/Release/libnode.so.105]
 6: 0x7ffff362fe76 node::CommonEnvironmentSetup::context() const [/home/mmom/src/node/out/Release/libnode.so.105]
 7: 0x5555555568f8  [/home/mmom/src/embedded_node/embedded_node]
 8: 0x555555556ccc  [/home/mmom/src/embedded_node/embedded_node]
 9: 0x7ffff26a00b3 __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6]
10: 0x55555555666e  [/home/mmom/src/embedded_node/embedded_node]

Thread 1 "embedded_node" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff269e859 in __GI_abort () at abort.c:79
#2  0x00007ffff3707de9 in node::Abort() () from /home/mmom/src/node/out/Release/libnode.so.105
#3  0x00007ffff36014a8 in node::OnFatalError(char const*, char const*) () from /home/mmom/src/node/out/Release/libnode.so.105
#4  0x00007ffff412e2e1 in v8::Utils::ReportApiFailure(char const*, char const*) () from /home/mmom/src/node/out/Release/libnode.so.105
#5  0x00007ffff42b3aa6 in v8::internal::HandleScope::Extend(v8::internal::Isolate*) () from /home/mmom/src/node/out/Release/libnode.so.105
#6  0x00007ffff412f73d in v8::HandleScope::CreateHandle(v8::internal::Isolate*, unsigned long) () from /home/mmom/src/node/out/Release/libnode.so.105
#7  0x00007ffff362fe76 in node::CommonEnvironmentSetup::context() const () from /home/mmom/src/node/out/Release/libnode.so.105
#8  0x00005555555568f8 in RunNodeInstance (platform=0x555555587b60, args=std::vector of length 1, capacity 1 = {...}, exec_args=std::vector of length 0, capacity 0) at embedded_node.cc:23
#9  0x0000555555556ccc in main (argc=1, argv=0x7fffffffdda8) at embedded_node.cc:77
(gdb) frame 8
#8  0x00005555555568f8 in RunNodeInstance (platform=0x555555587b60, args=std::vector of length 1, capacity 1 = {...}, exec_args=std::vector of length 0, capacity 0) at embedded_node.cc:23
23	        v8::Context::Scope context_scope(setup->context());

Additional information

A handle scope is missing

mmomtchev added a commit to mmomtchev/node that referenced this issue Apr 9, 2022
nodejs-github-bot pushed a commit that referenced this issue Apr 13, 2022
Refs: #42670

PR-URL: #42671
Fixes: #42670
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
vmoroz pushed a commit to vmoroz/node that referenced this issue Apr 13, 2022
Refs: nodejs#42670

PR-URL: nodejs#42671
Fixes: nodejs#42670
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
xtx1130 pushed a commit to xtx1130/node that referenced this issue Apr 25, 2022
Refs: nodejs#42670

PR-URL: nodejs#42671
Fixes: nodejs#42670
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
juanarbol pushed a commit that referenced this issue May 31, 2022
Refs: #42670

PR-URL: #42671
Fixes: #42670
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
danielleadams pushed a commit that referenced this issue Jun 27, 2022
Refs: #42670

PR-URL: #42671
Fixes: #42670
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
targos pushed a commit that referenced this issue Jul 11, 2022
Refs: #42670

PR-URL: #42671
Fixes: #42670
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
targos pushed a commit that referenced this issue Jul 31, 2022
Refs: #42670

PR-URL: #42671
Fixes: #42670
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
guangwong pushed a commit to noslate-project/node that referenced this issue Oct 10, 2022
Refs: #42670

PR-URL: nodejs/node#42671
Fixes: nodejs/node#42670
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
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