Bug #14497 Updated: PHP causes segfault when session handler=user

From: Date: Fri, 14 Dec 2001 14:01:17 +0000
Subject: Bug #14497 Updated: PHP causes segfault when session handler=user
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-73739@lists.php.net to get a copy of this message
ID: 14497
User updated by: jbozza@thinkburst.com
Reported By: jbozza@thinkburst.com
Old Status: Feedback
Status: Open
Bug Type: Reproducible crash
Operating System: FreeBSD 4.4-Stable
PHP Version: 4.1.0
New Comment:

The bus error would only happen maybe one out of 50 times or so, but looking at my error logs for
the last 3 months, I haven't had EITHER error on any of my web servers.

From what I can gather, a bus error can still be an attempt to access memory that is nonexistent. 
I've tried to reproduce the sig10 error in gdb but have been unable to thus far.  I think the 2
(3) backtraces I've already given are a good start though.

I do have an SSL server, but the backtraces I sent you were from Apache 1.3.20 along PHP 4.1.0 or
200112131200.  I did not see any errors in my logs for the SSL server, but that's not
surprising since I hadn't upgraded my SSL server until AFTER I built my temporary workaround. 
(Which, btw, is compiling PHP without session support and including my own session.php code which
duplicates all the built-in session code.  The only thing I don't have is the global $_SESSION
that can be used without a global statement.  I think I can deal with that.)

I don't have Java on any of the systems.   Base Apache with no other modules except PHP.  I
cannot reproduce the problem under 4.0.6.  As soon as I upgraded to 4.1.0 I started having the
problems.  (Without changing anything else)

Regardless, whether or not it's a session problem (From the backtraces it looks like its closer
to something in the Zend internals, but I don't know enough about the code to offer a
suggestion of the type), the problem only comes out when I have the session code enabled in PHP.  So
far I have not had a single problem once I removed session support (--disable-session) from PHP and
started using my own code.

Since I wrote my session code to duplicate the internal support, it'll be easy enough for my to
recompile PHP with session support and not have to change anything in my code itself.  (I use a
conditional include based on whether or not session_start() exists as a function)



Previous Comments:
------------------------------------------------------------------------

[2001-12-14 01:30:55] yohgaki@php.net

I mean provide backtrace with SIGBUS, if you can. (I'm not sure if you can take the backtrace
or not)
See "man 7 signal" for signals.


------------------------------------------------------------------------

[2001-12-14 01:24:22] yohgaki@php.net

Errors from Apache:
[Thu Dec 13 14:24:54 2001] [notice] child pid 93032 exit signal Bus error (10)
[Thu Dec 13 14:24:54 2001] [notice] child pid 93008 exit signal Segmentation fault (11)

SIGBUS  shouldn't happen....
Do you use SSL, Java? It seems bus error could heppen for some configuration even without PHP with
FreeBSD.

http://www.mail-archive.com/openssl-dev%40openssl.org/msg09701.html
http://www.phpbuilder.com/mail/php-general/2001072/2008.php

There may be other causes. You'll find more if you search.
You should also search Apache and/or ModSSL bug database see if there is similar problem is
reported.

We can not tell if this is PHP's fault or not, unless you provide backtrace. 

[This is not related to session after all. Changed status = Reproducible crash]



------------------------------------------------------------------------

[2001-12-13 23:12:56] jbozza@thinkburst.com

PostgreSQL 7.1.3 (latest FreeBSD port - downloaded from PostgreSQL website on Monday)

Errors from Apache:
[Thu Dec 13 14:24:54 2001] [notice] child pid 93032 exit signal Bus error (10)
[Thu Dec 13 14:24:54 2001] [notice] child pid 93008 exit signal Segmentation fault (11)

Errors from PHP: None

Messages in PostgreSQL error log:
pq_recvbuf: unexpected EOF on client connection


FWIW, there have been a couple other people with similar problems, one mentioned he was using MySQL,
so I don't think it's a PostgreSQL problem, but something to do with cleanup.  I
don't have any problems whatsoever with 4.0.6 under the same configurations.



------------------------------------------------------------------------

[2001-12-13 20:59:21] yohgaki@php.net

Next time, could you write your PostgreSQL server(backend) version AND libpq version that you use?

------------------------------------------------------------------------

[2001-12-13 20:56:43] yohgaki@php.net

That's strange. I guess you are using session handler written by me.
I don't have such problem at all.

Do you get any error messages in your apache/php/postgresl error logs?
If there is, please provide error messages.

------------------------------------------------------------------------

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/?id=14497


Edit this bug report at http://bugs.php.net/?id=14497&edit=1



Thread (22 messages)

« previous php.dev (#73739) next »