Skip to content

internalModuleStat breaks when invoked too often with path with umlaut #58586

Description

@stefanzugal

Version

22.14.0

Platform

Linux p14s 6.11.0-26-generic #26~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr 17 19:20:47 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

  • Create the following paths:
    • with umlaut: /tmp/söme-päth
    • without umlaut: /tmp/some-path
  • Run the following snippet, passing option --expose-internals to node:
const {internalBinding} = require('internal/test/binding');
const internalFsBinding = internalBinding('fs');
let path = '/tmp/söme-päth';
// path = '/tmp/some-path';

for (let i = 0; i < 10000; i++) {
    const result = internalFsBinding.internalModuleStat(internalFsBinding, path);
    console.log(result);
}

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

Running the snippet, consistently 6265 (+- 5) times 1 is printed (as expected), the remaining time -1 is printed.

What is the expected behavior? Why is that the expected behavior?

As the path exists, the method should consistently return 1.

What do you see instead?

The method internalModuleStat sometimes detects the path, sometimes not.

Additional information

The method internalModuleStat works nicely for paths without umlauts. Also, it seems that debuggin / and or adding additional code changes the results.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions