[php-src] PHP-8.6: Merge branch 'PHP-8.4' into PHP-8.5
| From: | David Carlier | Date: | Sat, 21 Nov 2026 14:10:54 +0000 |
| Subject: | [php-src] PHP-8.6: Merge branch 'PHP-8.4' into PHP-8.5 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-144003@lists.php.net to get a copy of this message | ||
Author: David Carlier (devnexen)
Date: 2026-11-21T14:09:28Z
Commit: https://github.com/php/php-src/commit/baa3baf65f70ac8b413ae91325bc02bd5721e9df
Raw diff: https://github.com/php/php-src/commit/baa3baf65f70ac8b413ae91325bc02bd5721e9df.diff
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
Zend: Fix stack limit fallback on FreeBSD threads
Changed paths:
M Zend/zend_call_stack.h
Diff:
diff --git a/Zend/zend_call_stack.h b/Zend/zend_call_stack.h
index 58e91694f93f..bea836fdf097 100644
--- a/Zend/zend_call_stack.h
+++ b/Zend/zend_call_stack.h
@@ -27,6 +27,9 @@
#ifdef __APPLE__
# include <pthread.h>
#endif
+#ifdef __FreeBSD__
+# include <pthread_np.h>
+#endif
#ifdef _MSC_VER
#include <intrin.h>
@@ -80,7 +83,14 @@ static inline size_t zend_call_stack_default_size(void)
#ifdef __linux__
return 8 * 1024 * 1024;
#endif
-#if defined(__FreeBSD__) || defined(__NetBSD__)
+#ifdef __FreeBSD__
+ // libthr: THR_STACK_DEFAULT in lib/libthr/thread/thr_private.h
+ if (pthread_main_np() == 0) {
+ return sizeof(void *) / 4 * 1024 * 1024;
+ }
+ return 4 * 1024 * 1024;
+#endif
+#ifdef __NetBSD__
return 4 * 1024 * 1024;
#endif
#if defined(__DragonFly__)