Bug #67375 [Opn]: JIT enabled sometimes breaks filters

From: Date: Wed, 04 Jun 2014 01:35:51 +0000
Subject: Bug #67375 [Opn]: JIT enabled sometimes breaks filters
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186042@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67375&edit=1 ID: 67375 Updated by: tyrael@php.net Reported by: garyamort at gmail dot com Summary: JIT enabled sometimes breaks filters Status: Open Type: Bug Package: Filter related Operating System: Arch Linux 64bit PHP Version: 5.5.13 Block user comment: N Private report: N New Comment: https://bugs.php.net/bug.php?id=67296 is a possible duplicate for this one. Previous Comments: ------------------------------------------------------------------------ [2014-06-03 17:26:53] garyamort at gmail dot com Note: I am not able to recreate this error at this time. I am running under Arch Linux which as an extremely odd PHP package - virtually every module is installed as a shared library rather - even rather basic libraries such as sockets. Since discovering this error, I created my own package and recompiled moving most shared php module libraries to static and the problem went away. This leads me to think that either the problem is that there is no 'safety net' definitions for PARSE_GET, PARSE_POST, and PARSE_COOKIE here https://github.com/php/php-src/blob/master/ext/filter/filter.c#L68 OR that I simply messed up something when I was testing ------------------------------------------------------------------------ [2014-06-03 17:21:37] garyamort at gmail dot com Description: ------------ In some situations, if you have auto_globals_jit enables then not only are super global variables not initialized unless they are called, the underlying data storage for the original data[used by filter_input] will not be populated. As I read filter.c, there seems to be a weird schism on how it deals with this. https://github.com/php/php-src/blob/master/ext/filter/filter.c#L526 For INPUT_SERVER and INPUT_ENV it seems as if filter will make sure to initialize the data, example: if (PG(auto_globals_jit)) { zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC); } For INPUT_POST, INPUT_GET, and INPUT_COOKIE however there is no safety net. Test script: --------------- <?php // execute from web browser as http://domain/filename.php?test=123 $before = filter_input(INPUT_GET, 'test'); // $before = null $var = $_GET('test'); // $var = 'test' $after = filter_input(INPUT_GET, 'test'); // $after = 'test' if ($before !== $after) { echo 'Raw input failed to load'; } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67375&edit=1

« previous php.bugs (#186042) next »