[MacPorts] #58598: PHP 7.3.6 can throw a known bus error on freebsd flavored OS if using ifuncs, can fix in configure.ac

MacPorts noreply at macports.org
Fri Jun 14 06:25:51 UTC 2019


#58598: PHP 7.3.6 can throw a known bus error on freebsd flavored OS if using
ifuncs, can fix in configure.ac
---------------------+----------------------------
 Reporter:  johnww2  |      Owner:  (none)
     Type:  defect   |     Status:  new
 Priority:  Normal   |  Milestone:  MacPorts 2.6.0
Component:  ports    |    Version:  2.5.4
 Keywords:           |       Port:  php73
---------------------+----------------------------
 PHP 7.3.6 apparently has this known issue with ifunc usage on freebsd
 flavored platforms fixed in later version than available on MacPorts per
 this;

 I'm no expert on that but I can follow along in the home game by
 understanding the basic fix...

 https://github.com/php/php-
 src/commit/291589114aa9be899cf7d5d874c3b5bbdb35f336#diff-
 67e997bcfdac55191033d57a16d1408a

 I encountered this php issue in the course of using laravel

 STEPS TO REPRODUCE

 0) Mojave 10.14.5
 1) MacPorts clean install with requested per below
 2) install laravel (https://laravel.com)
 3) set up laravel and make a new site per laravel docs (implying apache,
 openssl, database backend etc.)
 4) access the site (fails to load) (I'm using localhost as my domain)
 5) see log files per below indicating bus error / problem in mod_php73.so
 6) per above github commit, create a patch for php's config.ac file adding
 darwin to list of hosts that will not use itunes

 CONFIRMED FIXED by making patch, and reinstalling php77 from customized
 php local port per

 https://trac.macports.org/wiki/howto/PatchLocal

 patch assembled per github fix reference above (adding darwin) ....

 --------------------------------------------------------------------

 --- a/configure.ac.orig 2019-06-14 14:32:23.000000000 +0900
 +++ b/configure.ac      2019-06-14 14:29:02.000000000 +0900
 @@ -606,7 +606,7 @@
  dnl
  dnl At least some versions of FreeBSD seem to have buggy ifunc support,
 see
  dnl bug #77284. Conservatively don't use ifuncs on FreeBSD.
 -AS_CASE([$host_alias], [*-*-*android*|*-*-*uclibc*|*-*-*musl*|*freebsd*],
 [true], [
 +AS_CASE([$host_alias],
 [*-*-*android*|*-*-*uclibc*|*-*-*musl*|*freebsd*][*-*-darwin*], [true], [
    AX_GCC_FUNC_ATTRIBUTE([ifunc])
    AX_GCC_FUNC_ATTRIBUTE([target])
  ])

 --------------------------------------------------------------------

 additional config info when issue encountered...


 ports requested...

 apache2                        @2.4.39_0+preforkmpm
 mariadb-server                 @5.5.64_0
 mod_python                     @3.5.0_0
 mod_wsgi                       @4.6.5_0
 openssl                        @1.0.2s_0
 php73                          @7.3.6_0+libedit
 php73-apache2handler           @7.3.6_0
 php73-curl                     @7.3.6_0
 php73-iconv                    @7.3.6_0
 php73-imap                     @7.3.6_0
 php73-mbstring                 @7.3.6_0
 php73-mcrypt                   @1.0.2_0
 php73-memcached                @3.0.4_0
 php73-mysql                    @7.3.6_0+mysqlnd
 php73-opcache                  @7.3.6_0
 php73-openssl                  @7.3.6_0
 php73-redis                    @4.2.0_0
 php73-sqlite                   @7.3.6_0
 py36-tz                        @2018.9_0
 py37-pip                       @19.1.1_0
 py37-tkinter                   @3.7.3_0
 python36                       @3.6.8_0
 python37                       @3.7.3_0
 redis                          @5.0.5_0

 crash...

 sudo tail -50 /opt/local/var/log/apache2/error_log

 [Fri Jun 14 13:11:23.663560 2019] [core:notice] [pid 55208] AH00052: child
 pid 82569 exit signal Bus error (10)
 [Fri Jun 14 13:11:23.664173 2019] [core:notice] [pid 55208] AH00052: child
 pid 82568 exit signal Bus error (10)
 [Fri Jun 14 13:11:23.664201 2019] [core:notice] [pid 55208] AH00052: child
 pid 82565 exit signal Bus error (10)
 [Fri Jun 14 13:11:24.665747 2019] [core:notice] [pid 55208] AH00052: child
 pid 82571 exit signal Bus error (10)
 [Fri Jun 14 13:11:24.666209 2019] [core:notice] [pid 55208] AH00052: child
 pid 82567 exit signal Bus error (10)
 [Fri Jun 14 13:11:24.666230 2019] [core:notice] [pid 55208] AH00052: child
 pid 82566 exit signal Bus error (10)

 looking in Console.app at system reports for http...

 Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
 0   ???                                 0x000000010cf20700
 php_base64_encode + 0
 1   mod_php73.so                        0x000000010c82dee3
 ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER + 80
 2   mod_php73.so                        0x000000010c7e6388 execute_ex + 98
 3   mod_php73.so                        0x000000010c7e6504 zend_execute +
 318
 4   mod_php73.so                        0x000000010c7aaf86
 zend_execute_scripts + 277
 5   mod_php73.so                        0x000000010c75647d
 php_execute_script + 655
 6   mod_php73.so                        0x000000010c8550a8 php_handler +
 1045
 7   httpd                               0x000000010bc229ef ap_run_handler
 + 51
 8   httpd                               0x000000010bc22fa9
 ap_invoke_handler + 240
 9   httpd                               0x000000010bc5816a
 ap_process_async_request + 859
 10  httpd                               0x000000010bc58201
 ap_process_request + 20
 11  httpd                               0x000000010bc54e9b
 ap_process_http_connection + 301
 12  httpd                               0x000000010bc3304a
 ap_run_process_connection + 51
 13  httpd                               0x000000010bc5f80e child_main +
 1088
 14  httpd                               0x000000010bc5f2ca make_child +
 409
 15  httpd                               0x000000010bc5ecda prefork_run +
 2120
 16  httpd                               0x000000010bc353bc ap_run_mpm + 64
 17  httpd                               0x000000010bc29e24 main + 2104
 18  libdyld.dylib                       0x00007fff7dbf53d5 start + 1

-- 
Ticket URL: <https://trac.macports.org/ticket/58598>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list