View Issue Details

IDProjectCategoryView StatusLast Update
0002342XdebugTracingpublic2025-04-27 22:14
Reporterthecrypto Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version3.4.2 
Summary0002342: Segfault in PHP-FPM on Alpine when xdebug.start_with_request=yes and calling StripeClient->subscriptions->all()
Description

Running Xdebug 3.4.2 on PHP 8.4.6-fpm-alpine3.21 (Docker). As soon as xdebug.start_with_request = yes is set, any call to \Stripe\StripeClient->subscriptions->all(...) crashes the FPM worker with SIGSEGV inside Xdebug’s trace_textual.c::add_arguments. Other endpoints (e.g. customers->all()) complete normally. Changing xdebug.start_with_request to no (even with trace still enabled) eliminates the crash.

Steps To Reproduce
  1. Replace placeholder STRIPE_API_SK_TEST in .env with your Stripe test secret key
  2. docker-compose -f docker-compose.yml -p xdebug-alpine-stripe up -d --build
  3. docker exec -it xdebug-alpine-stripe-fpm sh
  4. php fetch.php
  5. Observe:
    === customers ===
    array()
    === subscriptions ===
    Segmentation fault (core dumped)
  6. In z-xdebug-override.ini, set xdebug.start_with_request = no and repeat -> no segfault
Additional Information

• Only subscriptions->all() triggers the crash
• Core dump (/tmp/core.php-fpm.<pid>) shows SIGSEGV in add_arguments() of trace_textual.c
• strace confirms a SIGSEGV right after a buffer/write syscall
• Stripe-PHP SDK is 100% PHP; the bug lives in Xdebug’s tracing logic on musl/Alpine
• Workarounds:
Use xdebug.start_with_request = trigger or no
Switch to a glibc-based PHP image (e.g. php:8.4.6-fpm-bullseye or php:8.4.6-fpm-bookworm)

Tagsalpine, bug, php-fpm, segfault, stripe-php, tracing, xdebug
Operating SystemAlpine 3.21 (Docker)
PHP Version8.4-dev

Activities

thecrypto

2025-04-27 21:26

reporter   ~0007262

Appears as though the sample (zip) files I provided when creating this case, did not attach to the request.

Trying again...

docker-sample.zip (3,780 bytes)

thecrypto

2025-04-27 22:14

reporter   ~0007263

Apologies, please disregard previous zip as it was missing php.ini and an empty vendor folder required for the docker compose file.

Please use this instead to easily reproduce the segmentation fault.

Issue History

Date Modified Username Field Change
2025-04-27 08:30 thecrypto New Issue
2025-04-27 08:30 thecrypto Tag Attached: alpine
2025-04-27 08:30 thecrypto Tag Attached: bug
2025-04-27 08:30 thecrypto Tag Attached: php-fpm
2025-04-27 08:30 thecrypto Tag Attached: segfault
2025-04-27 08:30 thecrypto Tag Attached: stripe-php
2025-04-27 08:30 thecrypto Tag Attached: tracing
2025-04-27 08:30 thecrypto Tag Attached: xdebug
2025-04-27 21:26 thecrypto Note Added: 0007262
2025-04-27 21:26 thecrypto File Added: docker-sample.zip
2025-04-27 22:14 thecrypto Note Added: 0007263
2025-04-27 22:14 thecrypto File Added: docker-sample-250428.zip