Skip to content

Process.title gets corrupted in case process.argv[2] is too long #31631

@Mitko-Kerezov

Description

@Mitko-Kerezov
  • Version: v10.15.1
  • Platform: Ubuntu 18.04

Please see the script below:

const printTitle = () => {
    console.log(`Process version ${process.version}`);
    console.log(`Process title ${process.title}`);
};

printTitle();
printTitle();

I am executing this script in the terminal with node script-name.js

The output is as follows:

  • With no additional command line arguments:

Process version v10.15.1
Process title node
Process version v10.15.1
Process title node

  • With a command line argument of length 700

Process version v10.15.1
Process title
Process version v10.15.1
Process title �PP��

It appears that process.title (and only process.title as far as I can tell) gets corrupted in case provess,argv[2] is of substantial length. Note that each time the second print of process.title yields a different result.

I have read the docs regarding process.title and as far as I can tell there is only an issue with assigning a large string to process.title.

Metadata

Metadata

Assignees

No one assigned

    Labels

    processIssues and PRs related to the process subsystem.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions