Skip to content

Crash in typescript using nodejs 16 on ppcle #38521

Closed
@Flarna

Description

@Flarna

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 ?? ()

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.ppcIssues and PRs related to the Power architecture.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions