Bug #66474 [Com]: end of script before headers = error 500

From: Date: Wed, 15 Jan 2014 22:01:13 +0000
Subject: Bug #66474 [Com]: end of script before headers = error 500
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183819@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66474&edit=1

 ID:                 66474
 Comment by:         spam2 at rhsoft dot net
 Reported by:        phpdev at ehrhardt dot nl
 Summary:            end of script before headers = error 500
 Status:             Closed
 Type:               Bug
 Package:            opcache
 Operating System:   Any
 PHP Version:        5.5.8
 Block user comment: N
 Private report:     N

 New Comment:

https://github.com/zendtech/ZendOptimizerPlus/archive/master.zip
solves *nothing*
the same segfaults as https://bugs.php.net/bug.php?id=66460

the only solution currently is take the "opcache" folder from 5.5.6
and replace the one from 5.5.7/5.5.8, i tried the master above
a few minutes ago

[Wed Jan 15 22:57:48.019059 2014] [core:notice] [pid 28817] AH00052: child pid 28820 exit signal
Segmentation fault (11)
[Wed Jan 15 22:57:49.020977 2014] [core:notice] [pid 28817] AH00052: child pid 28841 exit signal
Segmentation fault (11)


Previous Comments:
------------------------------------------------------------------------
[2014-01-13 11:36:13] ab@php.net

Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=fcd75690fe68c11ff9a327ee2e1ce3646b032431
Log: Fixed bug #66474 (Optimizer bug in constant string to boolean conversion)

------------------------------------------------------------------------
[2014-01-13 09:46:27] phpdev at ehrhardt dot nl

Solved by this patch:
https://github.com/zendtech/ZendOptimizerPlus/archive/master.zip

------------------------------------------------------------------------
[2014-01-13 08:08:35] dmitry@php.net

Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=fcd75690fe68c11ff9a327ee2e1ce3646b032431
Log: Fixed bug #66474 (Optimizer bug in constant string to boolean conversion)

------------------------------------------------------------------------
[2014-01-13 07:22:53] phpdev at ehrhardt dot nl

It is quite incomprehensible for me, but I see some code like that in superfish.module and
apparently you found out that that code triggers this issue.

Let me know when you have a patch and I will test it.

------------------------------------------------------------------------
[2014-01-13 06:41:32] dmitry@php.net

The minimal script that triggers the problem:

<?php
function foo() {
	$speed = 'slow' || 'fast';
}
foo();
?>

It doesn't crash, but valgrind shows the source of the error

==12278== Invalid read of size 1
==12278==    at 0x4C1E335: accel_new_interned_string (zend_hash.h:282)
==12278==    by 0x4C252AD: zend_persist_zval_calc (zend_persist_calc.c:107)
==12278==    by 0x4C258F9: zend_persist_op_array_calc.part.2 (zend_persist_calc.c:148)
==12278==    by 0x4C250D2: zend_hash_persist_calc (zend_persist_calc.c:79)
==12278==    by 0x4C25971: zend_accel_script_persist_calc (zend_persist_calc.c:337)
==12278==    by 0x4C1F78B: compile_and_cache_file.constprop.19 (ZendAccelerator.c:1167)
==12278==    by 0x4C20291: persistent_compile_file (ZendAccelerator.c:1634)
==12278==    by 0x838B57C: zend_execute_scripts (zend.c:1308)
==12278==    by 0x832CAAA: php_execute_script (main.c:2506)
==12278==    by 0x8434E46: do_cli (php_cli.c:994)
==12278==    by 0x806F91C: main (php_cli.c:1378)
==12278==  Address 0x4d04c30 is 0 bytes inside a block of size 5 free'd
==12278==    at 0x4007B21: free (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==12278==    by 0x8381407: convert_to_boolean (zend_operators.c:543)
==12278==    by 0x4C2B252: zend_optimize_block (block_pass.c:1059)
==12278==    by 0x4C2F5EC: zend_optimizer (block_pass.c:2060)
==12278==    by 0x837F033: zend_llist_apply_with_argument (zend_llist.c:234)
==12278==    by 0x8380307: pass_two (zend_opcode.c:670)
==12278==    by 0x8373FEA: zend_do_end_function_declaration (zend_compile.c:1811)
==12278==    by 0x83550C5: zendparse (zend_language_parser.y:382)
==12278==    by 0x8356149: compile_file (zend_language_scanner.l:588)
==12278==    by 0x82347BC: phar_compile_file (phar.c:3383)
==12278==    by 0x4C1F5A4: compile_and_cache_file.constprop.19 (ZendAccelerator.c:1388)
==12278==    by 0x4C20291: persistent_compile_file (ZendAccelerator.c:1634)

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=66474


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=66474&edit=1


Thread (13 messages)

« previous php.bugs (#183819) next »