Bug 1048071 - php dies on chained assignment
Summary: php dies on chained assignment
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: php
Version: 20
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-03 04:48 UTC by K H
Modified: 2014-01-24 07:48 UTC (History)
4 users (show)

Fixed In Version: php-5.5.8-1.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-24 07:39:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Sample script (236 bytes, application/x-php)
2014-01-03 04:48 UTC, K H
no flags Details
Correct version of test script (279 bytes, application/x-php)
2014-01-03 15:16 UTC, K H
no flags Details
Sample script version 3 (278 bytes, application/x-php)
2014-01-03 15:21 UTC, K H
no flags Details


Links
System ID Private Priority Status Summary Last Updated
PHP Bug Tracker 66041 0 None None None Never

Description K H 2014-01-03 04:48:30 UTC
Created attachment 844832 [details]
Sample script

Description of problem:
apache dies with SEGV in php script doing chained assignment in an object method.


Version-Release number of selected component (if applicable):
php-5.5.7-1.fc20.x86_64

How reproducible:
reproducible

Steps to Reproduce:
1. Put the attached php file in a directory that apache can fine
2. Point your browser to the script
3.

Actual results:
Apache dies with
[Thu Jan 02 22:39:03.503911 2014] [core:notice] [pid 9839] AH00052: child pid 9850 exit signal Segmentation fault (11)


Expected results:
It should run

Additional info:
In the Controller::run method, the chained assignment is where it dies.  Specifically, it seems like chaining to a list() is the critical component.

I can change list($a) = $b = $c;   to
$b = $c;
list($a) = $b;  

and it works fine,

Additionally, if I run it from the php command line, it doesn't fail but assigns an incorrect value to $a.

Comment 1 Remi Collet 2014-01-03 05:30:53 UTC
list($a) = $value; only work is $value is an array.

so
list($a)=1; => don't work
list($a)=[1]; => works.

See: http://php.net/manual/en/function.list.php

Comment 2 Remi Collet 2014-01-03 05:39:21 UTC
Even if the syntax is badly used, php should not segfault.
I cannot reproduce any segfault with the provided example (php 5.5.8RC1).
(display "r" which is the first element of the string considered as an array)

It seems it could have be fixed in 5.5.8, with the fix for bug #66041 related to list().

I'll keep this bug open until 5.5.8 is released (next week)

Please confirm that the bug is fixed or still present.

Comment 3 K H 2014-01-03 15:16:02 UTC
Created attachment 844980 [details]
Correct version of test script

Comment 4 K H 2014-01-03 15:20:06 UTC
I uploaded the wrong sample script and am adding the correct one.  The rhs to list() is indeed an array.   Please note that the SEGV seems to be related to the chained assignment being run inside a class member function and the intermediate result being assigned to a class member variable.

Comment 5 K H 2014-01-03 15:21:15 UTC
Created attachment 844981 [details]
Sample script version 3

Put everything in test case back to normal.

Comment 6 Remi Collet 2014-01-03 16:09:49 UTC
Ok, with this test script I can reproduce the segfault, with PHP 5.5.7.

Using PHP 5.5.8RC1, no more segfault.
So this will be fixed with next week update.

Comment 7 Fedora Update System 2014-01-09 09:59:19 UTC
php-5.5.8-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/php-5.5.8-1.fc20

Comment 8 Fedora Update System 2014-01-09 09:59:34 UTC
php-5.5.8-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/php-5.5.8-1.fc19

Comment 9 Fedora Update System 2014-01-10 08:01:37 UTC
Package php-5.5.8-1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing php-5.5.8-1.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-0581/php-5.5.8-1.fc19
then log in and leave karma (feedback).

Comment 10 K H 2014-01-10 14:29:42 UTC
Tested with php-5.5.8-1.fc20 and my test case and real code (HTML_QuickForm_Controller from pear) both work correctly.

Comment 11 Remi Collet 2014-01-10 14:31:01 UTC
Thanks for the feedback (you can also add karma to the update)

Comment 12 Fedora Update System 2014-01-24 07:39:30 UTC
php-5.5.8-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2014-01-24 07:48:40 UTC
php-5.5.8-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.