1 Reply Latest reply on Oct 10, 2012 11:59 AM by MattiasThorslund

    CWP + Apache on OS X - CRASH

    MattiasThorslund

      Title

      CWP + Apache on OS X - CRASH

      Your post

           I get a crash in Apache as my CodeIgniter-based application tries to load the Filemaker PHP API. It's very strange:

           My application works fine on Windows server/IIS.

           I followed the inclusion of files one by one, adding die() statements before and after. When I include /FileMaker/Implementation/FileMakerImpl.php, the Apache process just dies, even if I put a die() on the first line of that file.

           When the process dies, a crash dump is saved to the DiagnosticReports folder. Here's the trace (I'll spare you the binary part unless you need it):

           Process:         httpd [9018]
           Path:            /usr/sbin/httpd
           Identifier:      httpd
           Version:         ??? (???)
           Code Type:       X86-64 (Native)
           Parent Process:  httpd [7101]

           Date/Time:       2012-10-09 17:57:11.216 -0700
           OS Version:      Mac OS X Server 10.6.8 (10K549)
           Report Version:  6

           Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
           Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
           Crashed Thread:  0  Dispatch queue: com.apple.main-thread

           Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
           0   libphp5.so                        0x000000010131fe1c _zend_mm_alloc_int + 924
           1   libphp5.so                        0x0000000101332d4b init_op_array + 113
           2   libphp5.so                        0x0000000101319be7 compile_file + 218
           3   libphp5.so                        0x0000000101196ec1 phar_compile_file + 844
           4   libphp5.so                        0x000000010131923b compile_filename + 190
           5   libphp5.so                        0x000000010136925d ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER + 714
           6   libphp5.so                        0x000000010135f6b9 execute + 585
           7   libphp5.so                        0x0000000101330f7c zend_call_function + 2223
           8   libphp5.so                        0x000000010133199a call_user_function_ex + 76
           9   libphp5.so                        0x000000010133b856 zend_error + 1794
           10  libphp5.so                        0x000000010130e216 zendparse + 8810
           11  libphp5.so                        0x0000000101319bfb compile_file + 238
           12  libphp5.so                        0x0000000101196ec1 phar_compile_file + 844
           13  libphp5.so                        0x00000001013691d8 ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER + 581
           14  libphp5.so                        0x000000010135f6b9 execute + 585
           15  libphp5.so                        0x0000000101330f7c zend_call_function + 2223
           16  libphp5.so                        0x0000000101261feb zif_call_user_func_array + 111
           17  libphp5.so                        0x00000001013600ab zend_do_fcall_common_helper_SPEC + 2401
           18  libphp5.so                        0x000000010135f6b9 execute + 585
           19  libphp5.so                        0x000000010133a8c4 zend_execute_scripts + 376
           20  libphp5.so                        0x00000001012ebf95 php_execute_script + 732
           21  libphp5.so                        0x00000001013b7612 php_handler + 1237
           22  httpd                             0x00000001000012cf ap_run_handler + 90
           23  httpd                             0x0000000100001bc8 ap_invoke_handler + 354
           24  httpd                             0x000000010002ebd0 ap_process_request + 103
           25  httpd                             0x000000010002b3b4 ap_process_http_connection + 116
           26  httpd                             0x00000001000128ac ap_run_process_connection + 90
           27  httpd                             0x0000000100012d7a ap_process_connection + 91
           28  httpd                             0x0000000100035fbe child_main + 1257
           29  httpd                             0x000000010003617d make_child + 329
           30  httpd                             0x0000000100036403 perform_idle_server_maintenance + 498
           31  httpd                             0x000000010003692d ap_mpm_run + 1246
           32  httpd                             0x00000001000098f4 main + 2868
           33  httpd                             0x0000000100000934 start + 52

            

           Any clues about what's going on?

           Thanks.

        • 1. Re: CWP + Apache on OS X - CRASH
          MattiasThorslund

               I think I have isolated the primary issue.

               In the FileMaker PHP API, there is some old syntax. Specifically, the "new"  keyword should no longer be preceded by an ampersand to signify a reference.  PHP will trigger a warning whenever that code is executed. Whenever that warning is triggered, it is supposed to be logged to a file, by default the system log. Instead, the Apache child process that was handling the page request simply dies and nothing is sent to the browser.

               So, I can fix the primary issue by correcting the FileMaker PHP files, and that should make my application run just fine.

               The secondary problem, i.e. why the Apache process dies on such a harmless event as a warning being triggered is something that I will have to continue to work on finding out. That problem is not one that I'm comfortable with having on a production server.