From 0468bb139555cf879506ffaea3cb26bde14af8f1 Mon Sep 17 00:00:00 2001 From: Shiz Date: Thu, 17 Aug 2017 14:32:29 +0200 Subject: testing/py-ujson: fix stack usage issue and add tests --- testing/py-ujson/lower-stack-usage.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 testing/py-ujson/lower-stack-usage.patch (limited to 'testing/py-ujson/lower-stack-usage.patch') diff --git a/testing/py-ujson/lower-stack-usage.patch b/testing/py-ujson/lower-stack-usage.patch new file mode 100644 index 0000000000..de3258cfde --- /dev/null +++ b/testing/py-ujson/lower-stack-usage.patch @@ -0,0 +1,19 @@ +From: Shiz +Bug-Report: https://github.com/esnme/ultrajson/issues/254 + +musl default thread size is 80 kiB, so using 128 kiB by default will +overflow the stack and cause segmentation faults. + +Allocating 128 kiB on the stack is a rather bad idea anyway, so we'll +lower it to 8 kiB. +--- ultrajson-1.35/lib/ultrajson.h ++++ ultrajson-1.35-patched/lib/ultrajson.h +@@ -77,7 +77,7 @@ + /* + Dictates and limits how much stack space for buffers UltraJSON will use before resorting to provided heap functions */ + #ifndef JSON_MAX_STACK_BUFFER_SIZE +-#define JSON_MAX_STACK_BUFFER_SIZE 131072 ++#define JSON_MAX_STACK_BUFFER_SIZE 8192 + #endif + + #ifdef _WIN32 -- cgit v1.2.3