php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24457 Segfault when executing a script
Submitted: 2003-07-02 06:38 UTC Modified: 2003-07-28 05:33 UTC
Votes:4
Avg. Score:4.8 ± 0.4
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:2 (66.7%)
From: s dot vanvelthem at ibelgique dot com Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 4.3.3RC1 OS: Sco OpenServer 5.05
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: s dot vanvelthem at ibelgique dot com
New email:
PHP Version: OS:

 

 [2003-07-02 06:38 UTC] s dot vanvelthem at ibelgique dot com
Description:
------------
when I try to execute a script with PHP4.3.3RC1/OpenServer, I've got a Segmentation fault if I don't specifiy the entire pathname before the script file


ex :

* ./my_script.php gives me a segmentation fault
* /home/seb/my_script.php is OK

see also php_scandir.c error at compile time, is this useful?

  
I'm using :
 
 SCO OpenServer 5.05
 Gcc 2.95.2pl1
 UDK 7.1.1

ERRORS AND WARNING NOTES

./configure --enable-cli --disable-cgi

-> warning : you will need bison 1.28
-> warning : you will need bison 1.28 if you want to regenerate the Zend
parser (found 1.25)

gmake 

->/seb/php4-STABLE-200307020930/ext/standard/exec.c: In function
`proc_open_rsrc_dtor':
->/seb/php4-STABLE-200307020930/ext/standard/exec.c:578: warning: cast
from pointer to integer of different size
->/seb/php4-STABLE-200307020930/ext/standard/exec.c: In function
`zif_proc_open':
->seb/php4-STABLE-200307020930/ext/standard/exec.c:993: warning: cast to
pointer from integer of different size
->/seb/php4-STABLE-200307020930/ext/standard/var_unserializer.c: In
function `php_var_unserialize':
->/seb/php4-STABLE-200307020930/ext/standard/var_unserializer.c:308:
warning: comparison is always false due to limited range of data type
->seb/php4-STABLE-200307020930/main/php_scandir.c: In function
`php_scandir':
->/seb/php4-STABLE-200307020930/main/php_scandir.c:116: warning: passing
arg 4 of `qsort' from incompatible pointer type



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-02 06:54 UTC] derick@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2003-07-03 04:51 UTC] s dot vanvelthem at ibelgique dot com
Here's the trace (with the latest STABLE release php4-STABLE-200307030930.tar.gz)

bash-2.03# /opt/K/SKUNK2000/Gdb/5.0/usr/local/bin/gdb /usr/local/bin/php /u/too
ls/printps/core
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-pc-sco3.2v5.0.5"...
Core was generated by `printps.php'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libsocket.so.1...done.
Loaded symbols for /usr/lib/libsocket.so.1
Reading symbols from /usr/lib/libc.so.1...done.
Loaded symbols for /usr/lib/libc.so.1
#0  0x80021602 in getcwd () from /usr/lib/libc.so.1
(gdb)bt
#0  0x80021602 in getcwd () from /usr/lib/libc.so.1
#1  0x8007ffe0 in pathcanon () from /usr/lib/libsocket.so.1
#2  0x800802c0 in realpath () from /usr/lib/libsocket.so.1
#3  0x8129570 in php_execute_script (primary_file=0x8047c54)
    at /seb/php4-STABLE-200307030930/main/main.c:1652
#4  0x817570f in main (argc=2, argv=0x8047c90)
    at /seb/php4-STABLE-200307030930/sapi/cli/php_cli.c:818
#5  0x805ff5b in _start ()
(gdb) 

Thanks
 [2003-07-21 17:04 UTC] iliaa@php.net
Could you please compile your PHP with --enable-debug, this should result in a more detailed backtrace.
 [2003-07-22 03:07 UTC] s dot vanvelthem at ibelgique dot com
That's what I've done (???). I followed the 
(http://bugs.php.net/bugs-generating-backtrace.php) document. Maybe I'm doing wrong? 

How to call gdb?

I typed 

gdb /usr/local/bin/php ./core

Is this correct for CLI usage? The better thing to do is to document it in bugs-generating-backtrace.php (all options...). But i'll try to re-compile it with --enable-cli to be sure.
 [2003-07-23 12:16 UTC] iliaa@php.net
According to avaliable documentation, the problem is a result of a bug in SCO OpenServer 5.05. Below is a url to a patch that is hopefuly a work around this bug, please try it and reply with the result.
http://bb.prohost.org/sco.txt
 [2003-07-28 05:33 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2003-08-26 05:45 UTC] dm at zamang dot co dot uk
Just tried PHP 4.3.3RC4 without the patch and the problem still occured.

I applied the patch manually, did a make distclean and recompiled. I didn't include the 'ifdef SCO' commands as I'm only ever going to compile on SCO - and wanted to be 100% certain that the other changes took effect. 

The patch worked and fixed the problem. It also fixed the problem I was having with PHP segfaulting when _no_ script was passed to it.
 [2004-01-02 11:00 UTC] putnamk at discoverdhs dot com
Please include this patch in later versions (e.g. PHP5)! I experienced the same problem, and also #ifdef SCO does not work properly, bug still occurs. When I remove the #ifdef line, the bug is fixed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC