-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Closed
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.regressionIssues related to regressions.Issues related to regressions.v22.xIssues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.Issues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.
Description
Version
v22.7.0
Platform
Darwin moe.fritz.box 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:13:18 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6030 arm64
Subsystem
Buffer
What steps will reproduce the bug?
let i = 0;
for(; i < 1_000_000; i++) {
const ashex = Buffer.from("\x80").toString("hex");
if (ashex === '80')
break;
else if(ashex !== 'c280')
console.log("Unexpected return value", ashex); //this never happened for me
}
if(i<1_000_000) {
console.log("FAILED after %d iterations",i);
process.exit(1);
} else
console.log("PASSED after %d iterations",i);
How often does it reproduce? Is there a required condition?
For me, it will consistently fail somewhere between 7000 to 1200 iterations.
What is the expected behavior? Why is that the expected behavior?
In node 20 this code does not fail , even after 1_000_000 iterations. Buffer.from("\x80").toString("hex")
always returns c280
on node 20
What do you see instead?
Buffer.from("\x80").toString("hex")
incorrectly returns 80
after sufficient iterations
Additional information
No response
mariansimecekYoftahe1, pinkgothic, Nicoowr, theill and mdrobnyert78gb, Nicoowr, vicb and mariansimecek
Metadata
Metadata
Assignees
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.regressionIssues related to regressions.Issues related to regressions.v22.xIssues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.Issues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.