Skip to content

[Bug]: Memory leak #41078

Open
Open
@user7230724

Description

Preflight Checklist

Electron Version

v28.1.4

What operating system are you using?

Windows

Operating System Version

10

What arch are you using?

x64

Expected Behavior

MWE:

'use strict';
const crypto = require('crypto');
let hash = Buffer.alloc(0);
while(1) hash = crypto.createHash('sha256').update(hash).digest();

This is expected to run forever.

Actual Behavior

> electron main.js

<--- Last few GCs --->

[11464:0000430400148000]   110602 ms: Scavenge 5.3 (7.9) -> 3.3 (7.9) MB, 4.49 / 3.82 ms  (average mu = 1.000, current mu = 1.000) allocation failure;
[11464:0000430400148000]   110624 ms: Scavenge 5.3 (7.9) -> 3.3 (7.9) MB, 5.09 / 4.43 ms  (average mu = 1.000, current mu = 1.000) allocation failure;
[11464:0000430400148000]   110646 ms: Scavenge 5.3 (7.9) -> 3.3 (7.9) MB, 4.60 / 3.95 ms  (average mu = 1.000, current mu = 1.000) allocation failure;


<--- JS stacktrace --->

FATAL ERROR: ExternalEntityTable::AllocateSegment Allocation failed - process out of memory
 1: 00007FF6ACB03E16 node::SetTracingController+86006
 2: 00007FF6ACB04089 node::OnFatalError+585
 3: 00007FF6AFCCD5E3 v8::Function::NewInstance+835
 4: 00007FF6AFCCD573 v8::Function::NewInstance+723
 5: 00007FF6AE54E857 v8::MicrotasksScope::PerformCheckpoint+1127
 6: 00007FF6AFCD9238 v8::Object::SetAlignedPointerInInternalField+232
 7: 00007FF6AD193B80 uv_fs_statfs+10464
 8: 00007FF6AD9CEBAA uv_getnameinfo+219370
 9: 00007FF6AE565F08 v8::MicrotasksScope::PerformCheckpoint+97048
10: 00007FF6AB576ADD v8::SourceLocation::ToString+25021
11: 00007FF6AEB957BA cppgc::internal::WriteBarrier::DijkstraMarkingBarrierRangeSlow+3110154
12: 00007FF6AEAF9AF9 cppgc::internal::WriteBarrier::DijkstraMarkingBarrierRangeSlow+2472009
13: 00007FF6E00555F5

Additional Information

This is probably a regression. The first electron version we observed the leak in is v25.2.0. The leak is not seen in Node.js v21.5.0.

Activity

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions