php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39428 compiling in largefile support causes immediate segfaults
Submitted: 2006-11-08 09:29 UTC Modified: 2006-11-08 13:46 UTC
From: seanius at debian dot org Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 5.2.0 OS: Debian GNU/Linux
Private report: No CVE-ID: None
 [2006-11-08 09:29 UTC] seanius at debian dot org
Description:
------------
following the directions at

http://se2.php.net/filesystem

i'm attempting to introduce largefile support into the debian packages before we release etch.  on my own system (amd64) it seems to work just fine, but on other systems (x86?  maybe some other arches?) the apache children immediately segfault.

there are a couple bugs on this in the Debian BTS:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=397465

note that this also occurs with php 4.4.4 as well

Reproduce code:
---------------
compile with CFLAGS including

-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64

Expected result:
----------------
support for large files

Actual result:
--------------
[Tue Nov 07 16:26:20 2006] [notice] Apache/2.2.3 (Debian) PHP/5.2.0-1 mod_ssl/2.2.3 OpenSSL/0.9.8c configured -- resuming normal operations
[Tue Nov 07 16:26:23 2006] [notice] child pid 4685 exit signal Segmentation fault (11)

backtrace:


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1215985440 (LWP 24081)]
0xb75864a4 in zend_hash_internal_pointer_reset_ex () from
/usr/lib/apache2/modules/libphp5.so
(gdb) bt
#0  0xb75864a4 in zend_hash_internal_pointer_reset_ex ()
   from /usr/lib/apache2/modules/libphp5.so
   #1  0xb7600948 in apply_config () from
   /usr/lib/apache2/modules/libphp5.so
   #2  0xb75ffa5a in php_ap2_register_hook () from
   /usr/lib/apache2/modules/libphp5.so
   #3  0x08074587 in ap_run_handler ()
   #4  0x08077731 in ap_invoke_handler ()
   #5  0x08084728 in ap_process_request ()
   #6  0x080819ce in ap_register_input_filter ()
   #7  0x0807b3c7 in ap_run_process_connection ()
   #8  0x08088704 in ap_graceful_stop_signalled ()
   #9  0x08088964 in ap_graceful_stop_signalled ()
   #10 0x0808972a in ap_mpm_run ()
   #11 0x080621ef in main ()

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-08 13:17 UTC] tony2001@php.net
Of course it will segfault, as those flags change size of the structs used in Apache.
And if Apache was compiled with -D_FILE_OFFSET_BITS=64 and PHP was NOT, you end up with different structures and this apparently won't work.
You need either compile them both with those flags or remove the flags for both.
 [2006-11-08 13:46 UTC] seanius at debian dot org
hi tony,

given that i've followed the directions on your site for doing this, perhaps instead of marking the bug bogus we could  reassign/recategorize it as a documentation bug
for incorrect/incomplete documentation?

for the problem at hand, will php4/php5 automatically derive the file offset size etc from the CFLAGS used to build apache?  or, do i manually have to determine them?  if so, what is your recommended method?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 12:01:27 2024 UTC