From 6e15c38254a922604788cbffce362d0ce65f3d53 Mon Sep 17 00:00:00 2001 From: Emil Engler Date: Thu, 28 Sep 2023 07:56:44 +0200 Subject: [PATCH 1/2] flake: Remove redundant stack increase This commit removes the setting of `RUST_MIN_STACK` by the Nix development shell, because the tests now set the stack size on their own. See #128 --- flake.nix | 7 ------- 1 file changed, 7 deletions(-) diff --git a/flake.nix b/flake.nix index 7c1fc222..d27d6022 100644 --- a/flake.nix +++ b/flake.nix @@ -157,11 +157,6 @@ ''; }; - # liboqs requires quite a lot of stack memory, thus we adjust - # the default stack size picked for new threads (which is used - # by `cargo test`) to be _big enough_ - RUST_MIN_STACK = 8 * 1024 * 1024; # 8 MiB - # We want to build for a specific target... CARGO_BUILD_TARGET = target; @@ -309,7 +304,6 @@ # devShells.default = pkgs.mkShell { inherit (packages.proof-proverif) CRYPTOVERIF_LIB; - inherit (packages.rosenpass) RUST_MIN_STACK; inputsFrom = [ packages.default ]; nativeBuildInputs = with pkgs; [ cmake # override the fakecmake from the main step above @@ -322,7 +316,6 @@ }; devShells.coverage = pkgs.mkShell { inputsFrom = [ packages.default ]; - inherit (packages.rosenpass) RUST_MIN_STACK; nativeBuildInputs = with pkgs; [ inputs.fenix.packages.${system}.complete.toolchain cargo-llvm-cov ]; }; From f32383996723d5723ae38bb1f4c66afda6a9d415 Mon Sep 17 00:00:00 2001 From: Emil Engler Date: Thu, 28 Sep 2023 07:58:17 +0200 Subject: [PATCH 2/2] test: Fix wrong comment This commit fixes a wrong comment, claiming that the unit tests uses a stack size of 16MB, where in fact it only uses 8MiB. --- src/protocol.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protocol.rs b/src/protocol.rs index 342764c1..092c8ea0 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -1740,7 +1740,7 @@ mod test { // initialize secret and public key for the crypto server let (mut sk, mut pk) = (SSk::zero(), SPk::zero()); - // Guranteed to have 16MB of stack size + // Guranteed to have 8MiB of stack size stacker::grow(8 * 1024 * 1024, || { StaticKEM::keygen(sk.secret_mut(), pk.secret_mut()).expect("unable to generate keys"); });