Skip to content

Invalid --experimental-modules CLI flag parsing (core dumped) #21937

@demurgos

Description

@demurgos
  • Version:

    $ node -v
    v10.6.0
    
  • Platform:

    $ uname -a
    Linux red 4.17.4-1-ARCH #1 SMP PREEMPT Tue Jul 3 15:45:09 UTC 2018 x86_64 GNU/Linux
    
  • Subsystem: cli

While experimenting with building NODE_OPTIONS by concatenating additional options, I found the following two combinations causing a core dump (exit code 134):

$ NODE_OPTIONS="--abort-on-uncaught-exception --experimental-modules" node
munmap_chunk(): invalid pointer
Aborted (core dumped)
$ NODE_OPTIONS="--experimental-modules --experimental-modules" node
free(): invalid size
Aborted (core dumped)

Node should either run successfully or gracefully terminate. The current behavior seems to indicate some unreliable handling of the memory.
The crashes above happen every time I executed the command with these options. It's maybe not just related to experimental-module, the following command runs successfully: NODE_OPTIONS="--trace-sync-io --experimental-modules" node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++Issues and PRs that require attention from people who are familiar with C++.cliIssues and PRs related to the Node.js command line interface.confirmed-bugIssues with confirmed bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions