Reputation: 8990
I’m trying to simulate a segfault so I can see some of the conditions that would happen when one exists for debugging a much more complex script that is segfaulting. The code is run via CLI (cron).
Since this app is written in PHP, does anyone have code that will cause a segfault in PHP? The servers are using PHP 5.3, but I’m running 5.5 and 5.6 on two other servers, so code that creates a segfault in any version would work.
Upvotes: 0
Views: 1007
Reputation: 28939
It is as @Marc B says in comment
kill -11 $pid
or
kill -SIGSEGV $pid
where $pid
is the pid of the interpreter running your script. Any script would do, one convenient possibility would be just sleep(60)
, which gives you 60 seconds to send it a SIGSEGV before it exits cleanly on its own.
Upvotes: 1