support using SIGALARM instead of SIGPROF for Go compatibility#9738
support using SIGALARM instead of SIGPROF for Go compatibility#9738dunglas wants to merge 1 commit intophp:masterfrom
Conversation
|
Is it going to be normal for the PHP build that your program interacts with to be compiled with special options that make it compatible, or is it the case that your go program needs to interact with php builds it finds in the wild ? I expect the latter is true, and that makes me question the usefulness of this patch ? |
|
@krakjoe in my case, I use a custom build of PHP and I embed it in the binary produced by Go (static compilation), so special options are ok for this use case. That being said, I think that a better fix would be to ensure that signal handlers do nothing if executed on threads not owned by PHP (as Go does for the threads it doesn't own). #9649 (comment) |
|
This patch is no longer relevant, #10141 (which uses real-time signals) fixes this interoperability issue with Go. |
Go uses
SIGPROFfor internal purposes and can send this signal to the C code. PHP also uses it for the timeout system. This causes issues when embedding PHP in Go programs.For some platforms, when
SIGPROFisn't available, PHP already usesSIGALARMinstead. This patch adds a new compilation flag to force usingSIGALARM. This fixes issues with Go.Related: #9597, #9672.