#14529 [Com]: Returning non-string type from session read() segfaults. (User save handler)

From: Date: Mon, 21 Oct 2002 00:03:27 +0000
Subject: #14529 [Com]: Returning non-string type from session read() segfaults. (User save handler)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-22900@lists.php.net to get a copy of this message
ID: 14529 Comment by: shanti@mojo.cc Reported By: jay1@swift-web.com Status: No Feedback Bug Type: Session related Operating System: Linux RH 7.2 PHP Version: 4.3.0-dev New Comment: hi there .. can anyone now give a straight answer how to get rid of this bug .. or a really workaround ?? tnx4reply -c- Previous Comments: ------------------------------------------------------------------------ [2002-09-17 01:00:01] php-bugs@lists.php.net No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ [2002-08-16 22:03:33] rasmus@php.net Ok, so after all that, the summary of this bug is that returning a non-string from the read() function from a custom session handler causes a problem. I tried to reproduce this in current CVS by returning either false, null and random integers/floats and could not get a segfault. Please test a current snapshot and provide a short script that reproduces this. ------------------------------------------------------------------------ [2002-03-26 21:41:50] yohgaki@php.net After all, it's a session bug. I'm sure this is reported, but I couldn't find one. ------------------------------------------------------------------------ [2002-03-26 19:39:54] jay1@swift-web.com I did the same thing a while back and things appeared to work again. My screens were not getting cut off on every page load. But apache still crashed on almost every page viewed. Somehow, IE was able to display the page (I'm thinking though cache but it caught some of the newer info - but not always) but Netscape, Opera and some linux browsers simply displayed an error that they could not connect and eventually even in IE the pages started getting cut off again. It's as if apache crashed anyways for me only crashed sooner if the session read function returned false instead of an empty string. I've cut my program very small and eliminated all include/require statements thinking I'd add them until the problem occured, only as a base program (still fairly complex) the problem still occurs. Yet I've written some very simple pages and they don't crash. It's almost like it's a combination of tasks that cause it. ------------------------------------------------------------------------ [2002-03-26 18:22:30] fabian@ahrberg.se YEAH! IT WORKS! I've solved my problem! It was related to my session_handling and the session_read function. When I forced the function to ALWAYS return a string, even if it was an empty one apache stopped crashing! return (string)$value; Previously I sometimes returned other values such as the boolean false. This didn't make apache crash with 4.0.6 but it does with the later versions. *happy happy happy* The page works like a charm again! No cut off pages! No messed up posted forms! No more weird sessions that doesn't register! I LOVE IT! ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/14529 -- Edit this bug report at http://bugs.php.net/?id=14529&edit=1

« previous php.bugs (#22900) next »