php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18501 using suns CC with option '-fast' segfaults php.
Submitted: 2002-07-23 12:41 UTC Modified: 2002-10-28 11:09 UTC
From: berland at math dot ntnu dot no Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 4.2.2 OS: Solaris 8
Private report: No CVE-ID: None
 [2002-07-23 12:41 UTC] berland at math dot ntnu dot no
I have been trying to compile php on a ultrasparc-II machine with Suns compiler: Sun WorkShop 6 2000/04/07 C 5.1

I have set CFLAGS="-fast" to ensure native fast compilation. This is what causes problems, I have no problems if -fast is not set.

Both the command line executable and the libphp4.so segfaults.

Here are two minimal files which reproduce the segfault here:
----bugtest.php----
<? include("buginclude.php");
stdheader("foobar");
?>
----/bugtest.php----
----buginclude.php----
<?
function stdheader ($title) {
}
?>
----/buginclude.php----

If the function stdheader is defined in bugtest.php, I receive no segfault.

The last lines of truss-output follows:
-----trussoutput-----
resolvepath("/home/lastebil/e/berland/public_html/./buginclude.php", "/home/lastebil/e/berland/public_html/buginclude.php", 1024) = 51
ioctl(7, TCGETA, 0xFFBEE23C)                    Err#25 ENOTTY
fstat64(7, 0xFFBEC990)                          = 0
ioctl(7, TCGETA, 0xFFBEC91C)                    Err#25 ENOTTY
read(7, " < ?\n f u n c t i o n  ".., 8192)     = 38
read(7, 0x00309AC4, 8192)                       = 0
ioctl(7, TCGETA, 0xFFBECAD4)                    Err#25 ENOTTY
llseek(7, 0, SEEK_CUR)                          = 38
close(7)                                        = 0
    Incurred fault #6, FLTBOUNDS  %pc = 0x00137E5C
      siginfo: SIGSEGV SEGV_MAPERR addr=0x00000000
    Received signal #11, SIGSEGV [default]
      siginfo: SIGSEGV SEGV_MAPERR addr=0x00000000
        *** process killed ***
----trussoutput-----

Take contact if entire truss output is needed.

We do manage without the option -fast, but it would be
nice as we have noticed a significant speedup for some 
applications.

gdb-backtrace: I am not sure whether this was successful, as it complains heavily about missing debug symbols, even when I compiled with --enable-debug, but here it is:

GDB 4.16 (sparc-sun-solaris2.3), 
Copyright 1996 Free Software Foundation, Inc...(no debugging symbols found)...
(gdb) set args ~berland/public_html/bugtest.php
(gdb) run
Starting program: /local/src/webserver/php-4.2.2/./php ~berland/public_html/bugtest.php
warning: Unable to find dynamic linker breakpoint function.
warning: GDB will be unable to debug shared library initializers
warning: and track explicitly loaded dynamic code.
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x137e5c in execute ()
(gdb) bt
#0  0x137e5c in execute ()
#1  0x137a98 in execute ()
#2  0x109c6c in zend_execute_scripts ()
#3  0x334e4 in php_execute_script ()
#4  0x30060 in main ()
(gdb) 

So, there you've got it, now you great volunteers may have a look at it if it makes any sense! Keep up the good work!

--
H?vard Berland
System Administrator and PhD-student
Department of Mathematical Sciences
Norwegian University of Science and Technology



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-23 12:43 UTC] berland at math dot ntnu dot no
changed category from compile issue to reproducible crash.
 [2002-10-28 11:09 UTC] sterling@php.net
don't use the "-fast" option, enabling compiler optimizations is risky, especially when the code is not written for your native system...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 18:01:28 2024 UTC