File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / session / tests / bug60634_error_2.phpt
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Sun Jun 15 20:03:55 2014 UTC (10 years ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29, HEAD
php 5.4.29

    1: --TEST--
    2: Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - exception in write during exec
    3: --INI--
    4: session.save_path=
    5: session.name=PHPSESSID
    6: --SKIPIF--
    7: <?php include('skipif.inc'); ?>
    8: --FILE--
    9: <?php
   10: 
   11: ob_start();
   12: 
   13: function open($save_path, $session_name) {
   14:     return true;
   15: }
   16: 
   17: function close() {
   18: 	echo "close: goodbye cruel world\n";
   19: }
   20: 
   21: function read($id) {
   22: 	return '';
   23: }
   24: 
   25: function write($id, $session_data) {
   26: 	echo "write: goodbye cruel world\n";
   27: 	throw new Exception;
   28: }
   29: 
   30: function destroy($id) {
   31:     return true;
   32: }
   33: 
   34: function gc($maxlifetime) {
   35:     return true;
   36: }
   37: 
   38: session_set_save_handler('open', 'close', 'read', 'write', 'destroy', 'gc');
   39: session_start();
   40: session_write_close();
   41: echo "um, hi\n";
   42: 
   43: ?>
   44: --EXPECTF--
   45: write: goodbye cruel world
   46: 
   47: Fatal error: Uncaught exception 'Exception' in %s
   48: Stack trace:
   49: #0 [internal function]: write('%s', '')
   50: #1 %s(%d): session_write_close()
   51: #2 {main}
   52:   thrown in %s on line %d

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>