Skip to content

segfault with shared builtin #46235

Closed
Closed
@kapouer

Description

@kapouer

Version

20.0.0-pre 15d673d

Platform

linux

Subsystem

builtins

What steps will reproduce the bug?

Build HEAD with --shared-builtin-cjs_module_lexer/lexer-path= pointing to a valid file path.
Run node without options.

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

Always

What is the expected behavior?

No response

What do you see instead?

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff54892f8 in simdutf::utf16_length_from_utf8 (input=0x10005c630 "let source, pos, end;\nlet openTokenDepth,\n  templateDepth,\n  lastTokenPos,\n  lastSlashWasDivision,\n  templateStack,\n  templateStackDepth,\n  openTokenPosStack,\n  openClassPosStack,\n  nextBraceIsClass,\n"..., length=53562) at ../deps/simdutf/simdutf.cpp:4826
4826	  return active_implementation->utf16_length_from_utf8(input, length);
(gdb) bt
#0  0x00007ffff54892f8 in simdutf::utf16_length_from_utf8 (
    input=0x10005c630 "let source, pos, end;\nlet openTokenDepth,\n  templateDepth,\n  lastTokenPos,\n  lastSlashWasDivision,\n  templateStack,\n  templateStackDepth,\n  openTokenPosStack,\n  openClassPosStack,\n  nextBraceIsClass,\n"..., length=53562) at ../deps/simdutf/simdutf.cpp:4826
#1  0x00007ffff519ceb0 in node::builtins::BuiltinLoader::Add (id=0x7ffff74774e0 "internal/deps/cjs-module-lexer/lexer", 
    utf8source="let source, pos, end;\nlet openTokenDepth,\n  templateDepth,\n  lastTokenPos,\n  lastSlashWasDivision,\n  templateStack,\n  templateStackDepth,\n  openTokenPosStack,\n  openClassPosStack,\n  nextBraceIsClass,\n"...) at ../src/node_builtins.cc:271
#2  0x00007ffff519d4d0 in node::builtins::BuiltinLoader::AddExternalizedBuiltin (id=0x7ffff74774e0 "internal/deps/cjs-module-lexer/lexer", 
    filename=0x7ffff74774b0 "/usr/share/nodejs/cjs-module-lexer/lexer.js") at ../src/node_builtins.cc:266
#3  0x00007ffff519d63c in node::builtins::BuiltinLoader::BuiltinLoader (this=0x7ffff7f454f8 <node::builtins::BuiltinLoader::instance_>)
    at ../src/node_builtins.cc:40
#4  0x00007ffff50959c0 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at ../src/node_builtins.cc:35
#5  _GLOBAL__sub_I_node_builtins.cc(void) () at ../src/node_builtins.cc:764

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions