Bug #70876 [NEW]: Segmentation fault when regenerating session id with strict mode

From: Date: Sat, 07 Nov 2015 11:52:40 +0000
Subject: Bug #70876 [NEW]: Segmentation fault when regenerating session id with strict mode
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-197097@lists.php.net to get a copy of this message
From:             guilbaud dot johan at gmail dot com
Operating system: OpenSuse leap 42.1 x86_64
PHP version:      7.0.0RC6
Package:          Session related
Bug Type:         Bug
Bug description:Segmentation fault when regenerating session id with strict mode

Description:
------------
Hello
I got segmentation fault when session.strict_mod is set to true and
regenerate_session_id is called

I've compiled php with RC6 sources
I've got the problem with PHP7RC5 and PHPRC6 RPMs for opensuse too


Test script:
---------------
<?php
ini_set('session.use_strict_mode', true);
session_start();
session_regenerate_id();
echo "ok";

Expected result:
----------------
Ok

Actual result:
--------------
Segmentation fault / browser show connection was reset 

#0  ps_files_path_create (buf=buf@entry=0x7fffffffa370
"\340І\353\377\177", data=0x0, key=0x7fffeb864018
"3a81076e16d071a7f245db1db761e4bf", buflen=4096)
    at /home/johan/php7/php-7.0.0RC6/ext/session/mod_files.c:117
#1  0x00007ffff160d813 in ps_files_key_exists (data=<optimized out>,
key=<optimized out>) at
/home/johan/php7/php-7.0.0RC6/ext/session/mod_files.c:334
#2  0x00007ffff160bbbf in zif_session_regenerate_id
(execute_data=<optimized out>, return_value=0x7fffeb812290) at
/home/johan/php7/php-7.0.0RC6/ext/session/session.c:2081
#3  0x00007ffff176b5dd in ZEND_DO_ICALL_SPEC_HANDLER () at
/home/johan/php7/php-7.0.0RC6/Zend/zend_vm_execute.h:586
#4  0x00007ffff175dd8b in execute_ex (ex=<optimized out>) at
/home/johan/php7/php-7.0.0RC6/Zend/zend_vm_execute.h:414
#5  0x00007ffff17a6df7 in zend_execute (op_array=0x7fffeb874000,
op_array@entry=0x7fffeb89a360,
return_value=return_value@entry=0x7fffeb812030)
    at /home/johan/php7/php-7.0.0RC6/Zend/zend_vm_execute.h:458
#6  0x00007ffff1722d64 in zend_execute_scripts (type=type@entry=8,
retval=0x7fffeb812030, retval@entry=0x0, file_count=file_count@entry=3)
    at /home/johan/php7/php-7.0.0RC6/Zend/zend.c:1428
#7  0x00007ffff16c7c80 in php_execute_script
(primary_file=primary_file@entry=0x7fffffffd720) at
/home/johan/php7/php-7.0.0RC6/main/main.c:2471
#8  0x00007ffff17a86e2 in php_handler (r=<optimized out>) at
/home/johan/php7/php-7.0.0RC6/sapi/apache2handler/sapi_apache2.c:678
#9  0x000055555559f180 in ap_run_handler ()
#10 0x000055555559f6c9 in ap_invoke_handler ()
#11 0x00005555555b39ac in ap_internal_redirect ()
#12 0x00007ffff226716c in ?? () from
/usr/lib64/apache2-prefork/mod_rewrite.so
#13 0x000055555559f180 in ap_run_handler ()
#14 0x000055555559f6c9 in ap_invoke_handler ()
#15 0x00005555555b464a in ?? ()
#16 0x00005555555b4924 in ?? ()
#17 0x00005555555b0c7e in ?? ()
#18 0x00005555555a8d30 in ap_run_process_connection ()
#19 0x00005555555bba9e in ?? ()
#20 0x00005555555bbc98 in ?? ()
#21 0x00005555555bc9b3 in ?? ()
#22 0x0000555555584f9e in ap_run_mpm ()
---Type <return> to continue, or q <return> to quit---
#23 0x000055555557e616 in ?? ()
#24 0x00007ffff6f4cb05 in __libc_start_main () from /lib64/libc.so.6
#25 0x000055555557e74f in _start ()


-- 
Edit bug report at https://bugs.php.net/bug.php?id=70876&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=70876&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=70876&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=70876&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=70876&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=70876&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=70876&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=70876&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=70876&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=70876&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=70876&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=70876&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=70876&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=70876&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70876&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=70876&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=70876&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=70876&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70876&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=70876&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=70876&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#197097) next »