[MacPorts] #16340: PHP throwing fork()ing error
#16340: PHP throwing fork()ing error ----------------------------------+----------------------------------------- Reporter: cabanela@mnstate.edu | Owner: macports-tickets@lists.macosforge.org Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.6.0 Keywords: | ----------------------------------+----------------------------------------- Honestly, I think this error is in the OS (or its origin is), but I am sitting here pulling my hair out. I have several PHP scripts that call a PHP package called JpGraph to generate graphs. I should not I had been using Apple's built-in PHP and APache servers. Since upgrading to Leopard, the following error is recorded in the Apache2 error_log {{{ The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec(). Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug. }}} I discovered that the PDFLIb folks have documented this problem a little better, copying from their documentation here == http://www.pdflib.com/fileadmin/pdflib/pdf/support/PDFlib-in-PHP- HowTo.pdf == ''Apple’s PHP version which is bundled with Mac OS X does not work with PDFlib DSOs. To use PHP with PDFlib on Mac OS X you need third-party PHP packages such as MAMP, XAMP[P] for Mac, or Marc Liyanage’s version from www.entropy.ch. Mac OS X 10.5 (Leopard) adds new complications. As described in developer.apple.com/releasenotes/CoreFoundation/CoreFoundation.html it is no longer possible to use CoreFoundation functions after a call to fork( ) without exec( ). However, CoreFoundation functions are required for PDFlib’s host font feature, and the critical sequence above is used in the combination of Apache and PHP.'' I went ahead and installed Apache2 and PHP5 via MacPorts and configured them properly and discovered to my joy that my old graphics generating scripts were working... for 48 hours. My Mac locked up over the weekend (not sure why, it was the first time, maybe related), and when I reboot, I discovered now that the MacPorts PHP installation is now tossing the same errors. This has really confused me: 1. Can someone explain if the PDFLib folks were correct that you could avoid these errors with a non-Apple PHP installation or is this an unavoidable OS feature (which would make sense, I suppose)? 2. If this is avoidable, can someone with more PHP knowledge than me explain how to configure PHP to avoid "forking" in a manner offensive to Apple? -- Ticket URL: <http://trac.macports.org/ticket/16340> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16340: PHP throwing fork()ing error -----------------------------------+---------------------------------------- Reporter: cabanela@mnstate.edu | Owner: macports-tickets@lists.macosforge.org Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.6.0 Resolution: | Keywords: -----------------------------------+---------------------------------------- Comment (by cabanela@mnstate.edu): I should note I have confirmed the JpGraph PHP library doesn't call fork(), this is something going on inside the PHP code as near as I can tell. -- Ticket URL: <http://trac.macports.org/ticket/16340#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16340: PHP throwing fork()ing error -----------------------------------+---------------------------------------- Reporter: cabanela@mnstate.edu | Owner: macports-tickets@lists.macosforge.org Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.6.0 Resolution: | Keywords: -----------------------------------+---------------------------------------- Comment (by cabanela@mnstate.edu): As I just noted on my blog: I've continued investigating and in Apple's Discussion boards I found there was a string of comments about this problem (--http://discussions.apple.com/thread.jspa?messageID=5693097#5961098--) . One user, Bill Eccles, seemed to isolate the problem and his description matches the symptoms I am seeing: Finally, there's a big problem with FreeType. As I discovered, anytime FreeType fonts are used by GD, they apparently make a Carbon API call of some sort. Problem is, Apache2 uses fork() without a corresponding exec() and, upon calling PHP/GD/FreeType, the Carbon call in FreeType causes Apache2 to crash. It shows up in the error_log as The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec(). Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug. Mon Nov 26 12:38:11 2007 notice child pid 304 exit signal Trace/BPT trap (5) and in the system.log as Nov 26 13:12:00 shr-g5 ReportCrash664: Formulating crash report for process httpd659 Nov 26 13:12:02 shr-g5 ReportCrash664: Saved crashreport to /Library/Logs/CrashReporter/httpd_2007-11-26-131145_shr-g5.crash using uid: 0 gid: 0, euid: 0 egid: 0 I didn't discover the cause--I can't take credit for this one. Here's where I discovered the FreeType/Apache2 problem: http://spteam-lists.blogspot.com/2007/11/freetype-digest- vol-35-issue-1.html The followup comment suggests a solution by compiling a replacement to Apple's built-in Freetype to version 2.3.5. Funny thing is I have MacPorts Freetype 2.3.7 installed. Any ideas? -- Ticket URL: <http://trac.macports.org/ticket/16340#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16340: PHP throwing fork()ing error -----------------------------------+---------------------------------------- Reporter: cabanela@mnstate.edu | Owner: ryandesign@macports.org Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: -----------------------------------+---------------------------------------- Changes (by jmr@macports.org): * owner: macports-tickets@lists.macosforge.org => ryandesign@macports.org * milestone: => Port Bugs Comment: Assigning to maintainer (assuming this is about php5?) -- Ticket URL: <http://trac.macports.org/ticket/16340#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16340: PHP throwing fork()ing error -----------------------------------+---------------------------------------- Reporter: cabanela@mnstate.edu | Owner: ryandesign@macports.org Type: defect | Status: new Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: -----------------------------------+---------------------------------------- Comment (by cabanela@mnstate.edu): Replying to [comment:3 jmr@macports.org]:
Assigning to maintainer (assuming this is about php5?)
This actually turns out to be a freetype problem. I have re-filed it under Bug Report 16341 [actually, I am requesting the creation of a freetype variant] (https://trac.macports.org/ticket/16341). This is not a PHP problem. -- Ticket URL: <http://trac.macports.org/ticket/16340#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16340: PHP throwing fork()ing error -----------------------------------+---------------------------------------- Reporter: cabanela@mnstate.edu | Owner: ryandesign@macports.org Type: defect | Status: closed Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: fixed | Keywords: -----------------------------------+---------------------------------------- Changes (by ryandesign@macports.org): * status: new => closed * resolution: => fixed Comment: Duplicate of #15909. -- Ticket URL: <http://trac.macports.org/ticket/16340#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16340: PHP throwing fork()ing error -----------------------------------+---------------------------------------- Reporter: cabanela@mnstate.edu | Owner: ryandesign@macports.org Type: defect | Status: reopened Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: | Keywords: -----------------------------------+---------------------------------------- Changes (by ryandesign@macports.org): * status: closed => reopened * resolution: fixed => -- Ticket URL: <http://trac.macports.org/ticket/16340#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#16340: PHP throwing fork()ing error -----------------------------------+---------------------------------------- Reporter: cabanela@mnstate.edu | Owner: ryandesign@macports.org Type: defect | Status: closed Priority: Normal | Milestone: Port Bugs Component: ports | Version: 1.6.0 Resolution: duplicate | Keywords: -----------------------------------+---------------------------------------- Changes (by ryandesign@macports.org): * status: reopened => closed * resolution: => duplicate -- Ticket URL: <http://trac.macports.org/ticket/16340#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts