We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83cd1c2 commit 2269c06Copy full SHA for 2269c06
Zend/zend_call_stack.c
@@ -71,6 +71,10 @@ typedef int boolean_t;
71
#include <thread.h>
72
#endif
73
74
+#ifdef HAVE_VALGRIND
75
+# include <valgrind/valgrind.h>
76
+#endif
77
+
78
#ifdef ZEND_CHECK_STACK_LIMIT
79
80
/* Called once per process or thread */
@@ -238,6 +242,13 @@ static bool zend_call_stack_get_linux_proc_maps(zend_call_stack *stack)
238
242
239
243
max_size = rlim.rlim_cur;
240
244
245
246
+ /* Under Valgrind, the last page is not useable */
247
+ if (RUNNING_ON_VALGRIND) {
248
+ max_size -= zend_get_page_size();
249
+ }
250
251
241
252
/* Previous mapping may prevent the stack from growing */
253
if (end - max_size < prev_end) {
254
max_size = prev_end - end;
0 commit comments