Skip to content

Commit 49ed71f

Browse files
committed
debug: display stack size limit
1 parent 7a4c1ac commit 49ed71f

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
continue-on-error: ${{fromJson(needs.prepare.outputs.push)}}
138138
run: |
139139
ulimit -s
140-
docker run --ulimit stack=$(ulimit -s)000 --platform=${{matrix.platform}} --rm \
140+
docker run --platform=${{matrix.platform}} --rm \
141141
$(jq -r '."builder-${{matrix.variant}}"."containerimage.config.digest"' <<< $METADATA) \
142142
"sh -c 'ulimit -s && frankenphp version && go test ${{matrix.race}} -v ./... && cd caddy && go test ${{matrix.race}} -v ./...'"
143143
env:

frankenphp.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include "frankenphp_arginfo.h"
2222
#include "_cgo_export.h"
2323

24+
#include <sys/resource.h>
25+
2426
#if defined(PHP_WIN32) && defined(ZTS)
2527
ZEND_TSRMLS_CACHE_DEFINE()
2628
#endif
@@ -616,6 +618,11 @@ int frankenphp_init(int num_threads) {
616618
int *num_threads_ptr = calloc(1, sizeof(int));
617619
*num_threads_ptr = num_threads;
618620

621+
struct rlimit r;
622+
getrlimit(RLIMIT_STACK, &r);
623+
624+
fprintf(stderr, "stacklimit(soft: %ju, max: %ju)\n", (intmax_t) r.rlim_cur, (intmax_t) r.rlim_max);
625+
619626
if (pthread_create(&thread, NULL, *manager_thread, (void *) num_threads_ptr) != 0) {
620627
go_shutdown();
621628

0 commit comments

Comments
 (0)