php-cli queue:work segfaults (SIGSEGV) on SIGTERM/SIGINT graceful shutdown (v1.12.0-1.12.4)
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 11.3k
- Forks
- 488
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 11
Description
What happens
A long-lived Laravel queue:work launched via frankenphp php-cli crashes with SIGSEGV (exit 139, core dumped) when it receives SIGTERM or SIGINT to shut down gracefully. The crash happens at signal-driven shutdown.
Voluntary exit is clean: Laravel's --max-time makes the worker exit 0 every cycle. Only signal-driven shutdown segfaults. This leaves any systemd-managed worker in failed (Result=core-dump) after systemctl stop.
Reproduction
Inside a Laravel app; the queue can be empty (no job in flight):
frankenphp php-cli artisan queue:work --sleep=3 --tries=3 &
P=$!; sleep 4; kill -TERM $P; wait $P; echo $? # -> 139
Same result with kill -INT.
Versions tested (all segfault)
- v1.12.0 (PHP 8.5.3)
- v1.12.1 (PHP 8.5.3)
- v1.12.4 (PHP 8.5.7, Caddy 2.11.4), static
frankenphp-linux-x86_64— still rc 139 on both TERM and INT
Environment
- Linux x86_64, Ubuntu 24.04, static (musl) binary, systemd unit (non-root user)
- Possibly related to #2342 (
ExecuteScriptCLIsegfaults)
Can provide a core/backtrace if helpful.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the frankenphp php-cli signal-driven shutdown path and reproduce the issue using the provided Laravel queue:work command with SIGTERM and SIGINT. Compare those results with the clean --max-time exit and review the related ExecuteScriptCLI segfault in issue #2342; done means both signals shut down without SIGSEGV or exit 139.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, laravel, php
- Domain
- backend, cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100