Closed redcapital closed 7 years ago
Hey @redcapital
This is AWESOME I had some other people submit a bug that is probably the same, but couldn't get to the bottom of it because the cases were large (I couldn't get them smaller and reproduce either)
I will look at this tonight after work. thanks
@Sean-Der have you forgot about it?
Here is some extra test data. I pulled it out of the unserialize
for some clarity:
$bad2 = array (
1 =>
array (
'a' => 'x',
),
30 =>
array (
'b' => 'y',
),
2 =>
array (
'c' => 'z',
),
);
$bad2[0]['children'][2] = &$bad2[1];
$p = msgpack_pack($bad2);
$unpacked = msgpack_unpack($p);
this wil segfault in php7, but not in php5.5:
PHP 5.5.9-1ubuntu4.20 (cli) (built: Oct 3 2016 13:00:37)
works
PHP 7.0.12-1+deb.sury.org~xenial+1 (cli) ( NTS )
segmentation fault
Strange thing is, there are a lot of ways to have it not-segfault, for instance:
$bad2 = array (
1 =>
array (
'a' => 'x',
),
2 =>
array (
'b' => 'y',
),
30 =>
array (
'c' => 'z',
),
);
$bad2[0]['children'][2] = &$bad2[1];
$p = msgpack_pack($bad2);
$unpacked = msgpack_unpack($p);
This works in all versions.
Hey @redcapital @mente @NanneHuiges sorry this got dropped, I don't work on PHP daily so hard to find time.
The good news is that @sodabrew contributed a patch that fixes this! Would you mind trying master? The example data in the first comment doesn't cause a segfault anymore.
cool! Do you mean the commit by @mheijkoop above? Because I know for sure that it fixes my issue as she made it specifically for the same core-problem we had! :D
We're currently running our own compiled version with that patch ( https://github.com/msgpack/msgpack-php/commit/e93208843dbd7d07e8009e496b218f039f78e5d2 ) and it is performing very well for us.
Yep! My mistake it was @mheijkoop who fixed it, I was trying to close tickets quickly last night and just grabbing anything that worked out of my clipring
:+1: then this is considered fixed for us
Segfault when using PHP references. This is the test case which I tried to reduce as much as possible:
Works in PHP 5.4 and possibly in any other PHP 5