Repository navigation
Crash in typescript using nodejs 16 on ppcle #38521
Copy link
Copy link
Closed
Labels
confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.ppcIssues and PRs related to the Power architecture.Issues and PRs related to the Power architecture.v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.
Description
- Version: 16.0.0
- Platform: Linux ls-ub-lf40a2dv 4.4.0-200-generic doc: update AUTHORS file, add tool for doing it #232-Ubuntu SMP Wed Jan 13 10:17:10 UTC 2021 ppc64le ppc64le ppc64le GNU/Linux
- Subsystem: @nodejs/v8
What steps will reproduce the bug?
building a project (unfortunately closed source) using typescript 4.2.4
Update: Seems to happen with other projects, e.g. building typescript itself
How often does it reproduce? Is there a required condition?
always, no special condition besides using PPCLE (no problem on windows, linux x86, linux arm).
What is the expected behavior?
building works also on PPCLE
What do you see instead?
/home/labuser/repo/node/proj/node_modules/typescript/lib/tsc.js:88057
throw e;
^
TypeError: nodes.slice is not a function
at visitNodes (/home/labuser/repo/node/proj/node_modules/typescript/lib/tsc.js:68214:37)
at Object.visitEachChild (/home/labuser/repo/node/proj/node_modules/typescript/lib/tsc.js:68448:58)
at visitTypeScript (/home/labuser/repo/node/proj/node_modules/typescript/lib/tsc.js:70186:31)
at visitorWorker (/home/labuser/repo/node/proj/node_modules/typescript/lib/tsc.js:69997:24)
at saveStateAndInvoke (/home/labuser/repo/node/proj/node_modules/typescript/lib/tsc.js:69956:27)
at visitor (/home/labuser/repo/node/proj/node_modules/typescript/lib/tsc.js:69993:20)
at visitNode (/home/labuser/repo/node/proj/node_modules/typescript/lib/tsc.js:68172:23)
at Object.visitFunctionBody (/home/labuser/repo/node/proj/node_modules/typescript/lib/tsc.js:68309:23)
at visitMethodDeclaration (/home/labuser/repo/node/proj/node_modules/typescript/lib/tsc.js:70932:292)
at visitTypeScript (/home/labuser/repo/node/proj/node_modules/typescript/lib/tsc.js:70145:28)
at visitorWorker (/home/labuser/repo/node/proj/node_modules/typescript/lib/tsc.js:69997:24)
at classElementVisitorWorker (/home/labuser/repo/node/proj/node_modules/typescript/lib/tsc.js:70065:28)
Additional information
If I attach the debugger problem is gone.
If I add typeof(node.slice) (which should be a not in my opinion) just before the line causing the TypeError it no longer occurs but a similar TypeError happens at another place.
If I add also typeof() checks at the next two such locations I finally end up in a segmentation fault with a quite small callstack:
#0 0x00000000115dd9b4 in Builtins_LoadIC_Megamorphic ()
#1 0x00000e8ec1d600e0 in ?? ()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.ppcIssues and PRs related to the Power architecture.Issues and PRs related to the Power architecture.v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.
Activity
targos commentedon May 3, 2021
/cc @nodejs/platform-ppc
mhdawson commentedon May 3, 2021
@miladfarca are there some options you could recommend to disable V8 optimizations to see if it might be related to code being generated?
miladfarca commentedon May 4, 2021
--jitlesscan be used to avoid generating code: i.e:will look into the details on why it is segfaulting on ppc.
Flarna commentedon May 4, 2021
I can confirm that
--jitlessavoids the crash.miladfarca commentedon May 4, 2021
@Flarna Thanks for confirming. Would you also be able to use the
v16.0.0node binary from this nightly build and check if the problem still exists? (without using--jitless)https://nodejs.org/download/nightly/v16.0.0-nightly202102126ea9af9906/
PPC file will be: https://nodejs.org/download/nightly/v16.0.0-nightly202102126ea9af9906/node-v16.0.0-nightly202102126ea9af9906-linux-ppc64le.tar.gz
Flarna commentedon May 4, 2021
@miladfarca This version looks good.
Tried also the next newer version v16.0.0-nightly2021021388d9268d08 => this one shows the problem
john-yan commentedon May 6, 2021
Debug build is not able to compile at the moment. I submitted another PR at #38571 so this might take longer. @targos Would you be able to help on the gyp/GN scraper issue?
gyakovlev commentedon May 7, 2021
can confirm segfault while building qtwebengine/chromium typescript parts on ppc64le with 16.1.0
gyakovlev commentedon May 7, 2021
I can't reproduce with debug build of node (with #38571 applied)
gyakovlev commentedon May 7, 2021
ok I've tried building with
-O0(default for debug unoptimized build),-Og, and-O2forBUILDTYPE=Debugit doesSIGTRAPso far here's the backtrace for
Releasebuild with flags overriden to-O2 -ggdb -fno-omit-frame-pointerjohn-yan commentedon May 8, 2021
I found the issue. It was caused by trampoline pool emission during deopt exit table generation. Deoptimizer expects deopt exits to be continuous. However, trampoline pool breaks this underlining assumption. I will submit a CL to fix this soon.
john-yan commentedon May 8, 2021
https://chromium-review.googlesource.com/c/v8/v8/+/2881918
john-yan commentedon May 13, 2021
CL landed on master and waiting for approval to backport https://bugs.chromium.org/p/v8/issues/detail?id=11764, https://chromium-review.googlesource.com/c/v8/v8/+/2886159, https://chromium-review.googlesource.com/c/v8/v8/+/2888088
gyakovlev commentedon May 13, 2021
thanks, confirm it builds chromium/qtwebengine typescript fine now, I've backported patch to 16.1.0 in gentoo: https://bugs.gentoo.org/785751
targos commentedon Jun 14, 2021
Should be fixed in v16.4.0