php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73880 bus error while generating phar.phar
Submitted: 2017-01-06 12:27 UTC Modified: 2021-02-03 15:48 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: joern dot clausen at uni-bielefeld dot de Assigned: cmb (profile)
Status: Not a bug Package: Compile Failure
PHP Version: 7.1.0 OS: Solaris 11.2/sparc
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: joern dot clausen at uni-bielefeld dot de
New email:
PHP Version: OS:

 

 [2017-01-06 12:27 UTC] joern dot clausen at uni-bielefeld dot de
Description:
------------
Building PHP 7.1 inside the pkgsrc framework on Solaris 11.2/sparc using GCC 4.8.5, the step "Generating phar.phar" fails with

Generating phar.phar
PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.
gmake: *** [ext/phar/phar.phar] Bus Error (core dumped)
*** Error code 2

The failing binary is the php interpreter build in the preceding steps. The stack trace looks like this

#0  0x00000001001032a4 in sljit_emit_jump ()
#1  0x00000001001096f4 in mainloop_entry ()
#2  0x000000010011e58c in _pcre_jit_compile ()
#3  0x00000001000fb07c in php_pcre_study ()
#4  0x0000000100122dd0 in pcre_get_compiled_regex_cache ()
#5  0x0000000100260674 in spl_dual_it_construct.isra ()
#6  0x00000001004484fc in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER ()
#7  0x00000001003df9d4 in execute_ex ()
#8  0x000000010044a9a4 in zend_execute ()
#9  0x00000001003925e8 in zend_execute_scripts ()
#10 0x0000000100327ad4 in php_execute_script ()
#11 0x000000010044cf64 in do_cli ()
#12 0x000000010045fc90 in main ()

The same code compiles without problems on Solaris 11.2/i86 and the same GCC version.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-06 15:34 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2017-01-06 15:34 UTC] cmb@php.net
Please try again after doing

  ./config.nice --without-pcre-jit

Also, which PCRE version do you use?
 [2017-01-06 16:11 UTC] joern dot clausen at uni-bielefeld dot de
-Status: Feedback +Status: Assigned
 [2017-01-06 16:11 UTC] joern dot clausen at uni-bielefeld dot de
Without PCRE-JIT, the package builds successfully. I use the PCRE that comes bundled with PHP 7.1.0.

pkgsrc currently provides PCRE 8.39 and PCRE2 10.22, in case those are more recent versions than the bundled one.
 [2017-01-06 17:12 UTC] cmb@php.net
-Status: Assigned +Status: Open -Assigned To: cmb +Assigned To:
 [2017-01-06 17:12 UTC] cmb@php.net
> Without PCRE-JIT, the package builds successfully.

So this is apparently a PCRE-JIT based issue.

> pkgsrc currently provides PCRE 8.39 and PCRE2 10.22, in case
> those are more recent versions than the bundled one.

PHP 7 ships PCRE 8.38, because there have been issues with
8.39[1]. PCRE2 is not yet supported.

[1] <https://github.com/php/php-src/commit/5f9df47e>
 [2017-05-02 03:48 UTC] coypu at sdf dot org
I have been told elsewhere by someone who knows SLJIT:
"It crashes while emitting, not when running jit code. My bet is that pcre emits a jump to a dead label"
 [2018-01-29 10:39 UTC] ivan dot prikhodko at pixelpark dot com
My current workaround consists of:
 $ cd ext/pcre
 $ wget https://netix.dl.sourceforge.net/project/pcre/pcre/8.40/pcre-8.40.tar.gz
 edit upgrade-pcre.php replacing 'tar' command with 'gtar'
 running $ php upgrade-pcre.php

Afterwards building with gmake finishes successfully 

I would also suggest reviewing Makefile after running ./configure script
Since Solaris supports 32/64 bit simultaneously, sometimes you see Paths to 32-bit shared libraries while compiling 64 bit php

Here is my patch Script for compiling on T5 Server (sparcv9):

perl -pi.back -e 's/-[LR]( ){0,1}\/opt\/csw\/lib\/gcc\/sparc-sun-solaris2.10\/4.9.2/-avoid-version -module/g;' Makefile
perl -pi.back -e 's/\/opt\/csw\/lib$/\/opt\/csw\/lib\/64/g;' Makefile
perl -pi.back -e 's/usr\/ucblib/usr\/ucblib\/sparcv9/g;' Makefile
 [2021-02-03 15:48 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2021-02-03 15:48 UTC] cmb@php.net
As of PHP 7.3.0, PCRE2 is required.  I'm not sure whether similar
issues exist there regarding Solaris, but this would obviously be
an upstream issue.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 13:01:29 2024 UTC