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

node v16.13: infinite loop in node_mksnapshot #516

Closed
andreas-schwab opened this issue Nov 24, 2021 · 14 comments
Closed

node v16.13: infinite loop in node_mksnapshot #516

andreas-schwab opened this issue Nov 24, 2021 · 14 comments

Comments

@andreas-schwab
Copy link

While building node v16.13 (using v8 9.4.146.19) the following command runs into an infinite loop:

LD_LIBRARY_PATH=/home/abuild/rpmbuild/BUILD/node-v16.13.0/out/Release/lib.host:/home/abuild/rpmbuild/BUILD/node-v16.13.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../.; mkdir -p /home/abuild/rpmbuild/BUILD/node-v16.13.0/out/Release/obj/gen; "/home/abuild/rpmbuild/BUILD/node-v16.13.0/out/Release/node_mksnapshot" "/home/abuild/rpmbuild/BUILD/node-v16.13.0/out/Release/obj/gen/node_snapshot.cc"

https://build.opensuse.org/package/live_build_log/openSUSE:Factory:RISCV/nodejs16/standard/riscv64

@luyahan
Copy link
Collaborator

luyahan commented Nov 25, 2021

I run

osc -A https://api.opensuse.org checkout openSUSE:Factory:RISCV/nodejs16 && cd $_ 
osc build standard riscv64

encounter error:

/usr/sbin/zic: /lib64/lp64d/libc.so.6: version `GLIBC_2.34' not found (required by /usr/sbin/zic)

@andreas-schwab
Copy link
Author

Did you reuse an old build root? Try adding --clean.

@luyahan
Copy link
Collaborator

luyahan commented Nov 26, 2021

Did you reuse an old build root? Try adding --clean.

Thanks

And when i want to debug it by gdb
But gdb return error:

(gdb) run --riscv-debug ./node_snapshot.cc
Starting program: /home/abuild/rpmbuild/BUILD/node-v16.13.0/out/Release/node_mksnapshot --riscv-debug ./node_snapshot.cc
warning: Could not trace the inferior process.
warning: ptrace: Function not implemented
During startup program exited with code 127.

Is this virtual machine don't support gdb?

@lazyparser
Copy link
Collaborator

Looks like it is caused by nested VM. gdb uses ptrace for sub-process operations. ptrace is a feature of kernel IIRC.

https://stackoverflow.com/a/68439156

@andreas-schwab
Copy link
Author

Qemu linux-user emulation does not support ptrace. You need to use system emulation or real hardware if you want to run gdb. I usually export the build root via nfs, so that I can mount it on my hifive board. Or you can use "osc build --vm-type qemu native riscv64" to start qemu in system emulation.

@luyahan
Copy link
Collaborator

luyahan commented Nov 29, 2021

Qemu linux-user emulation does not support ptrace. You need to use system emulation or real hardware if you want to run gdb. I usually export the build root via nfs, so that I can mount it on my hifive board. Or you can use "osc build --vm-type qemu native riscv64" to start qemu in system emulation.

Hi @andreas-schwab
In builtins-riscv64.cc:3704

__ Branch(&install_baseline_code, eq, type, Operand(FEEDBACK_VECTOR_TYPE));

It should be ne not eq

@luyahan
Copy link
Collaborator

luyahan commented Nov 29, 2021

Qemu linux-user emulation does not support ptrace. You need to use system emulation or real hardware if you want to run gdb. I usually export the build root via nfs, so that I can mount it on my hifive board. Or you can use "osc build --vm-type qemu native riscv64" to start qemu in system emulation.

Hi @andreas-schwab In builtins-riscv64.cc:3704

__ Branch(&install_baseline_code, eq, type, Operand(FEEDBACK_VECTOR_TYPE));

It should be ne not eq

May be you should add patch : https://chromium-review.googlesource.com/c/v8/v8/+/3093009

@andreas-schwab
Copy link
Author

Importing the whole patch causes node_mksnapshot to crash.

@andreas-schwab
Copy link
Author

And the s/eq/ne/ change alone has the same problem.

@luyahan
Copy link
Collaborator

luyahan commented Nov 30, 2021

Importing the whole patch causes node_mksnapshot to crash.

i will try it again

@luyahan
Copy link
Collaborator

luyahan commented Dec 1, 2021

0001-fix.zip
HI @andreas-schwab ~
Try this. It should fix this.

@lazyparser
Copy link
Collaborator

lazyparser commented Dec 1, 2021

0001-fix.zip HI @andreas-schwab ~ Try this. It should fix this.

Paste the patch as a github gist may better.

Thanks. I had updated.

@andreas-schwab
Copy link
Author

Thanks a lot, this patch fixes the issue.

@luyahan luyahan closed this as completed Dec 2, 2021
@luyahan
Copy link
Collaborator

luyahan commented Dec 2, 2021

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

No branches or pull requests

3 participants