From 0407436b0f15900399d11da43178cd09fddba0af Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Fri, 21 Jan 2022 17:25:37 +0100 Subject: [PATCH] derivations.cc: Use larger buffer in printString If we want to be careful about hitting the stack protector page, we should use `-fstack-check` instead. Co-authored-by: Eelco Dolstra --- src/libstore/derivations.cc | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc index 5233cfe67..3e3d50144 100644 --- a/src/libstore/derivations.cc +++ b/src/libstore/derivations.cc @@ -273,15 +273,7 @@ Derivation parseDerivation(const Store & store, std::string && s, std::string_vi static void printString(string & res, std::string_view s) { - // Large stack allocations can skip past the stack protection page. - const size_t stack_protection_size = 4096; - // We reduce the max stack allocated buffer by an extra amount to increase - // the chance of hitting it, even when `fun`'s first access is some distance - // into its *further* stack frame, particularly if the call was inlined and - // therefore not writing a frame pointer. - const size_t play = 64 * sizeof(char *); // 512B on 64b archs - - boost::container::small_vector buffer; + boost::container::small_vector buffer; buffer.reserve(s.size() * 2 + 2); char * buf = buffer.data(); char * p = buf;