php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24576 Segmentation fault on sapi_initialize_empty_request
Submitted: 2003-07-10 02:34 UTC Modified: 2003-07-12 09:44 UTC
From: druid at mail dot cz Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 4.3.2 OS: Linux 2.4.20
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: druid at mail dot cz
New email:
PHP Version: OS:

 

 [2003-07-10 02:34 UTC] druid at mail dot cz
Description:
------------
Php always crashes at start. I've tested it with sapi.
I've got the latest gcc and glibc:

Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3/specs
Configured with: ../gcc-3.3/configure --prefix=/usr --enable-shared --enable-threads=posix --with-slibdir=/lib --enable-__cxa_atexit --enable-clocale=gnu --enable-__vt_8iostream
Thread model: posix
gcc version 3.3

./configure --with-apxs2=/usr/local/apache/bin/apxs \
--with-zlib --enable-bcmath --with-bz2=shared --enable-calendar \
--enable-exif --enable-ftp --with-ttf --with-gettext \
--with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir \
--with-mysql --with-mysql-sock --with-recode=shared \
--with-imap --with-imap-ssl=/usr/local/ssl \
--enable-debug

glibc-2.3.2

Reproduce code:
---------------
SAPI_API void sapi_initialize_empty_request(TSRMLS_D)
{
        SG(server_context) = NULL;
        SG(request_info).request_method = NULL;
        SG(request_info).auth_user = SG(request_info).auth_password = NULL;
        SG(request_info).content_type_dup = NULL;
}

The last line is the problem.

Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.
sapi_initialize_empty_request () at /usr/src/php-4.3.2/main/SAPI.c:437
437             SG(request_info).content_type_dup = NULL;
(gdb) bt
#0  sapi_initialize_empty_request () at /usr/src/php-4.3.2/main/SAPI.c:437
#1  0x081841d7 in php_module_startup (sf=0x82e02e0,
    additional_modules=0x82e02e0, num_additional_modules=137240573)
    at /usr/src/php-4.3.2/main/main.c:1083
#2  0x6e690078 in ?? ()


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-10 03:03 UTC] druid at mail dot cz
I tried php-5b1 and it is nearly the same, except the gdb output:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 22382)]
0x081b1e50 in sapi_initialize_empty_request ()
(gdb) bt
#0  0x081b1e50 in sapi_initialize_empty_request ()
#1  0x081ac114 in php_module_startup ()
#2  0x40395ca6 in __libc_start_main () from /lib/libc.so.6
 [2003-07-10 11:51 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

(Make sure the build time is later than Jul 10, 2003 15:30.)

Which apache2 version? 
How was it configured?
How do you start it?
What other modules are enabled in it?

 [2003-07-12 06:11 UTC] druid at mail dot cz
There's no apache. I'm talking about the php binary. The sapi.

Fyi, I switched back to gcc 3.2.1 and everything's ok.
 [2003-07-12 09:11 UTC] sniper@php.net
Some gcc bug then.

 [2003-07-12 09:44 UTC] druid at mail dot cz
Only some incompatibility. I'm not saying that gcc 3.3 isn't crap but it was stable version so we can expect that it will be included in some distros... At least I wouldn't underestimate it.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 26 05:01:31 2024 UTC