-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.
Description
- Version: v10.13.0
- Platform: Linux maint-ubuntu 3.13.0-123-generic test: split simple into io/simple, run in parallel #172-Ubuntu SMP Mon Jun 26 18:04:35 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
- Subsystem: Buffer
Working with valgrind to clean a giant networking application I was getting "Conditional jump or move depends on uninitialised value(s)" with js stacks (see below), took a long time but managed to zero in on reason.
==28440== Conditional jump or move depends on uninitialised value(s)
==28440== at 0xA7EBB08780A: ???
==28440== by 0xA7EBB0118D4: ???
==28440== by 0xA7EBB0118D4: ???
==28440== by 0xA7EBB0118D4: ???
==28440== by 0xA7EBB0118D4: ???
==28440== by 0xA7EBB0118D4: ???
==28440== by 0xA7EBB0118D4: ???
==28440== by 0xA7EBB0118D4: ???
==28440== by 0xA7EBB0118D4: ???
==28440== by 0xA7EBB0118D4: ???
==28440== by 0xA7EBB0118D4: ???
==28440== by 0xA7EBB0118D4: ???
Running the following code through valgrind will trigger the error
const alloc = process.env.SAFE ? Buffer.alloc : Buffer.allocUnsafe;
var buf = alloc(20);
buf.writeInt32BE(123, 2);>valgrind --gen-suppressions=yes --leak-check=full /var/lib/nave/global/10.13.0/bin/node a.js
I've managed to trace the cause to lib/internal/buffer.js:checkBounds accessing the buffer that isn't initialized.
Buffer.allocUnsafe used by ws npm module
Shachar
Metadata
Metadata
Assignees
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.