aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorRobert Hensing <roberth@users.noreply.github.com>2022-01-21 17:25:37 +0100
committerGitHub <noreply@github.com>2022-01-21 17:25:37 +0100
commit0407436b0f15900399d11da43178cd09fddba0af (patch)
tree637822370a21e1622dc29306807f899821402afa /src/libstore
parentdec774811922d7ee220bb8e2488bc2f7abf61844 (diff)
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 <edolstra@gmail.com>
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/derivations.cc10
1 files changed, 1 insertions, 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<char, stack_protection_size - play> buffer;
+ boost::container::small_vector<char, 64 * 1024> buffer;
buffer.reserve(s.size() * 2 + 2);
char * buf = buffer.data();
char * p = buf;