Skip to content

Commit 8758ebc

Browse files
committed
Fix memory stress stop crash
1 parent e07ddc5 commit 8758ebc

5 files changed

Lines changed: 21 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 1.0.3 - 2026-04-19
4+
5+
### Fixed
6+
7+
- Fixed a packaged desktop crash when stopping memory stress after the worker IPC channel had already closed.
8+
- Memory stress shutdown now uses the same safe child-process cleanup path as CPU stress.
9+
310
## 1.0.2 - 2026-04-18
411

512
### Fixed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</p>
1212

1313
<p align="center">
14-
<a href="https://github.com/FaulMit/rigscope/releases/latest"><img alt="Latest release" src="https://img.shields.io/badge/release-v1.0.2-54d6ff?style=for-the-badge"></a>
14+
<a href="https://github.com/FaulMit/rigscope/releases/latest"><img alt="Latest release" src="https://img.shields.io/badge/release-v1.0.3-54d6ff?style=for-the-badge"></a>
1515
<a href="https://github.com/FaulMit/rigscope/actions/workflows/release.yml"><img alt="Release builds" src="https://img.shields.io/badge/builds-passing-8dff9f?style=for-the-badge"></a>
1616
<img alt="Platforms" src="https://img.shields.io/badge/Windows%20%7C%20Linux%20%7C%20macOS-111?style=for-the-badge">
1717
<img alt="Local first" src="https://img.shields.io/badge/local--first-127.0.0.1-54d6ff?style=for-the-badge">

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rigscope",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"private": true,
55
"description": "Cross-platform local hardware inventory, diagnostics, benchmark, and stress-test dashboard.",
66
"main": "electron/main.js",

server.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,15 +1157,14 @@ function stopMemoryStress(reason = "stopped") {
11571157
}
11581158
memoryStress.active = false;
11591159
clearTimeout(memoryStress.timer);
1160-
if (memoryStress.child) {
1161-
try { memoryStress.child.send("stop"); } catch {}
1160+
const child = memoryStress.child;
1161+
memoryStress.child = null;
1162+
if (child) {
1163+
safeSendChildMessage(child, "stop");
11621164
setTimeout(() => {
1163-
if (memoryStress.child && !memoryStress.child.killed) {
1164-
try { memoryStress.child.kill(); } catch {}
1165-
}
1165+
safeKillChild(child);
11661166
}, 500).unref();
11671167
}
1168-
memoryStress.child = null;
11691168
return memoryStressStatus(reason);
11701169
}
11711170

@@ -1201,6 +1200,11 @@ function startMemoryStress({ durationSec = 60, targetMb } = {}) {
12011200
});
12021201
child.on("exit", () => {
12031202
if (memoryStress.active) memoryStress.active = false;
1203+
if (memoryStress.child === child) memoryStress.child = null;
1204+
});
1205+
child.on("error", () => {
1206+
if (memoryStress.active) memoryStress.active = false;
1207+
if (memoryStress.child === child) memoryStress.child = null;
12041208
});
12051209
memoryStress.timer = setTimeout(() => stopMemoryStress("completed"), memoryStress.durationMs);
12061210
memoryStress.timer.unref();

0 commit comments

Comments
 (0)