Bug #62129 [Opn]: rfc1867 crashes php even though turned off
Edit report at https://bugs.php.net/bug.php?id=62129&edit=1
ID: 62129
Updated by: laruence@php.net
Reported by: truth at proposaltech dot com
Summary: rfc1867 crashes php even though turned off
Status: Open
Type: Bug
Package: Session related
Operating System: CentOS
PHP Version: 5.4.3
Block user comment: N
Private report: N
New Comment:
yes, the codes seems suspicious, maybe iliaa can look into this :)
diff --git a/ext/session/session.c b/ext/session/session.c
index 7a8199d..851e4ea 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -2384,13 +2384,14 @@ static int php_session_rfc1867_callback(unsigned int
event, void *event_data, vo
php_session_rfc1867_progress *progress;
int retval = SUCCESS;
- if (php_session_rfc1867_orig_callback) {
- retval = php_session_rfc1867_orig_callback(event, event_data,
extra TSRMLS_CC);
- }
if (!PS(rfc1867_enabled)) {
return retval;
}
+ if (php_session_rfc1867_orig_callback) {
+ retval = php_session_rfc1867_orig_callback(event, event_data,
extra TSRMLS_CC);
+ }
+
progress = PS(rfc1867_progress);
switch(event) {
Previous Comments:
------------------------------------------------------------------------
[2012-05-23 18:16:01] truth at proposaltech dot com
Description:
------------
php_session_rfc1867_callback() tries to call php_session_rfc1867_orig_callback() even if the rfc1867
feature is not enabled. Switching the order of the opening "if" blocks fixes the problem.
(The second "if" block immediately returns success if the feature isn't enabled and
the first "if" block tries to call the callback. This is all around line 2388 of
session.c.)
I upgraded from 5.3.3 to 5.4.3 and apache was segfaulting. I produced a core and the debugger
showed infinite recursion in php_session_rfc1867_callback(). There are probably deeper problems
here, but at the least the feature shouldn't cause problems if it is turned off.
In any case, even if something about my configuration is less than ideal, seg faults are Bad Thing.
Test script:
---------------
Apparently, my code wasn't executed. I tried using Xdebug, but it didn't report anything.
dump_bt didn't return anything in the debugger.
Expected result:
----------------
I expected my code to be executed normally.
Actual result:
--------------
apache seg faulted
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62129&edit=1
Thread (10 messages)