From f5e97728bbcb4753f4e34825637684fe72ee9fd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garci=CC=81a?= Date: Tue, 1 Oct 2024 11:51:22 +0200 Subject: [PATCH] Fix panic during memory testing --- crates/memory-testing/cases.json | 8 ++++---- crates/memory-testing/src/bin/capture-dumps.rs | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/crates/memory-testing/cases.json b/crates/memory-testing/cases.json index 4205e3dce..5223d3671 100644 --- a/crates/memory-testing/cases.json +++ b/crates/memory-testing/cases.json @@ -72,7 +72,7 @@ "kdf": { "argon2id": { "iterations": 3, - "memory": 4, + "memory": 16, "parallelism": 1 } } @@ -80,15 +80,15 @@ "memory_lookups": [ { "name": "Key", - "hex": "3bc0520a0abff0097d521ce0ee5e5b1cee301939a84742623c0c1697d7a4bd46" + "hex": "59079cd7134409c6882c2701de8357a3d8aabb2dad2da19eea5f1b8081dfb51c" }, { "name": "Hash B64", - "string": "lHkprdORlICVJ4Umwi94Uz/nATK6Y7If7e+iFoabzh0=" + "string": "P1ZT6T80zOfEqXj/kPbtON3yszf7xLNGCxWjdO2xfjU=" }, { "name": "Hash bytes", - "hex": "947929add391948095278526c22f78533fe70132ba63b21fedefa216869bce1d" + "hex": "3f5653e93f34cce7c4a978ff90f6ed38ddf2b337fbc4b3460b15a374edb17e35" } ] }, diff --git a/crates/memory-testing/src/bin/capture-dumps.rs b/crates/memory-testing/src/bin/capture-dumps.rs index 1fe4eead1..5dddd7622 100644 --- a/crates/memory-testing/src/bin/capture-dumps.rs +++ b/crates/memory-testing/src/bin/capture-dumps.rs @@ -37,6 +37,11 @@ fn wait_dump_and_continue( loop { let mut buf = [0u8; 1024]; let read = stdout.read(&mut buf).unwrap(); + + if read == 0 { + panic!("Process exited unexpectedly"); + } + let buf_str = std::str::from_utf8(&buf[..read]).unwrap(); if buf_str.contains("Waiting for dump...") { break;