Sessions causing segfault

From: Date: Sat, 17 Jun 2000 08:10:53 +0000
Subject: Sessions causing segfault
Groups: php.general 
Request: Send a blank email to php-general+get-2121@lists.php.net to get a copy of this message
Since PHP4, we've had a world of trouble with sessions. First they were causing one of the servers to hang, which was cured by an iffy change to the flock mode used to open session files. Now, I'm finding that after a while pretty much any session transactions cause frequent segfaults on a number of machines. All they have in common is running RedHat 5.1 (basically out-of-the-box). For instance, I compiled PHP 4.0.0 with no configure options (except --enable-track-vars) and linked it statically to Apache 1.3.12. Then I run a fairly complex script (a basic one that just increments an integer stored in a session variable, for instance, will not cause this) and it dies. gdb shows: #0 _zend_is_inconsistent (ht=0x1, file=0x814d800 "zend_hash.c", line=212) at zend_hash.c:88 #1 0x8090e30 in zend_hash_add_or_update (ht=0x1, arKey=0x8220ebc "SESSION_ALIVE", nKeyLength=14, pData=0xbfffd5c8, nDataSize=4, pDest=0x0, flag=1) at zend_hash.c:212 #2 0x808f86b in zend_set_hash_symbol (symbol=0x8220c24, name=0x8220ebc "SESSION_ALIVE", name_length=13, is_ref=0, num_symbol_tables=2) at zend_API.c:922 #3 0x80b3c5a in php_set_session_var (name=0x8220ebc "SESSION_ALIVE", namelen=13, state_val=0x8220d64) at session.c:194 #4 0x80b3fee in _ps_srlzr_decode_php ( val=0x8220e04 "SESSION_ALIVE|i:1;SVC|a:3:{s:2:\"id\";i:1;s:8:\"fullname\";s:3:\"Law\";s:8: \"filename\";s:3:\"law\";}!LOGIN|THISPAGE|s:9:\"index.php\";!TOPLINKS|ZZZ\20 4Ã\217*ZZZZA", vallen=133) at session.c:266 #5 0x80b41fd in _php_session_decode ( val=0x8220e04 "SESSION_ALIVE|i:1;SVC|a:3:{s:2:\"id\";i:1;s:8:\"fullname\";s:3:\"Law\";s:8: \"filename\";s:3:\"law\";}!LOGIN|THISPAGE|s:9:\"index.php\";!TOPLINKS|ZZZ\20 4Ã\217*ZZZZA", vallen=133) at session.c:381 #6 0x80b43f0 in _php_session_initialize () at session.c:437 #7 0x80b4f54 in _php_session_start () at session.c:819 #8 0x80b5fcc in php_if_session_start (ht=0, return_value=0x8220bec, this_ptr=0x0, return_value_used=0) at session.c:1177 #9 0x80ed5bc in execute (op_array=0x82160f8) at ./zend_execute.c:1574 #10 0x80ed78b in execute (op_array=0x820f5d4) at ./zend_execute.c:1614 #11 0x807e2ab in php_execute_script (primary_file=0xbffffb24) at main.c:1200 #12 0x8098e80 in apache_php_module_main (r=0x81f82b4, fd=26, display_source_mode=0) at sapi_apache.c:93 #13 0x807a90c in send_php (r=0x81f82b4, display_source_mode=0, filename=0x81f87e4 "/www/dev/index.php") at mod_php4.c:512 #14 0x807a93f in send_parsed_php (r=0x81f82b4) at mod_php4.c:524 #15 0x8109b23 in ap_invoke_handler () #16 0x811d059 in process_request_internal () #17 0x811d478 in ap_internal_redirect () #18 0x8073f3d in handle_dir () #19 0x8109b23 in ap_invoke_handler () #20 0x811d059 in process_request_internal () #21 0x811d0bc in ap_process_request () #22 0x811495e in child_main () #23 0x8114aec in make_child () #24 0x8114c49 in startup_children () #25 0x8115276 in standalone_main () #26 0x8115a03 in main () #27 0x406681eb in __libc_start_main (main=0x81156bc <main>, argc=2, argv=0xbffffd64, init=0x806191c <_init>, fini=0x8142f9c <_fini>, rtld_fini=0x4000a610 <_dl_fini>, stack_end=0xbffffd5c) at ../sysdeps/generic/libc-start.c:90 I'm wondering whether anyone has had luck using sessions with large projects under PHP4, or if we should just abandon it and roll our own (or use PHPLIB). Thanks for any advice. miguel

« previous php.general (#2121) next »