liip / php-osx

DEPRECATED: See https://php-osx.liip.ch/ for details. The uploader and website for the PHP 5 package for OS X 10.6 built with https://github.com/liip/build-entropy-php
http://php-osx.liip.ch
Other
328 stars 30 forks source link

calls to gmp_mul segfault #239

Closed sinclairday closed 3 years ago

sinclairday commented 6 years ago

We're using a math package that detects and uses the GMP extension. With both php5-7.1.4-20170506-100436 and php5-7.1.9-20170914-100859, calls to gmp_mul() are crashing PHP hard.

The simplest case is:

<?php

gmp_mul("100", "10");

?>

Or another test:

<?php

function fact($x)
{
   $return = 1;
   for ($i=2; $i < $x; $i++) {
       $return = gmp_mul($return, $i);
   }
   return $return;
}

if (extension_loaded('gmp')) {
    echo "gmp is loaded\n";
        echo gmp_strval(fact(1000)) . "\n";
} else {
    echo "gmp is not loaded\n";
}

?>

As a work around for now, I have commented out /usr/local/php5/php.d/50-extension-gmp.ini to force the package to use bcmath.

#extension=gmp.so

chregu commented 6 years ago

We had similar reports. Updated gmp to latest version, don't know right now what else to do

https://twitter.com/moopa/status/905811583292583936

chregu commented 6 years ago

But your example works fine on my php 7.1.9 installation locally

sinclairday commented 6 years ago

I don't know what to say. It does the same thing on a colleague's Mac. On FreeBSD, all is good.

Attaching crash log...

php-crash.txt

chregu commented 3 years ago

This project is now deprecated and won't get any more updates (since quite some time, but we made it official now).

The binaries and scripts will still be available for the foreseeable future.

We recommend using a homebrew based setup for an up-to-date local and native PHP experience.

See https://php-osx.liip.ch/ for more details.