472,989 Members | 3,093 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,989 software developers and data experts.

segmentation fault at the end of script

Hi,

I'm writing a php script which deals with 3 ORACLE databases.
This script is launch by a script shell on an linux machine like this :
/../php/bin/php ./MySript.php (PHP 4.3.3)

My script works fine and do all what I need.
But at the end of the execution, I can read "Segmentation Fault".

The segmentation fault appear at the end of my script execution,
no line code is responsible of this. Somebody has been confronted
with this problem ?

Best regards

Jérôme
Jul 17 '05 #1
2 6743
On 3 Nov 2003 02:36:34 -0800, js*******@ifrance.com (sivignon) wrote:
I'm writing a php script which deals with 3 ORACLE databases.
This script is launch by a script shell on an linux machine like this :
/../php/bin/php ./MySript.php (PHP 4.3.3)

My script works fine and do all what I need.
But at the end of the execution, I can read "Segmentation Fault".

The segmentation fault appear at the end of my script execution,
no line code is responsible of this. Somebody has been confronted
with this problem ?


What distribution of Linux, and what version(s) of Oracle? (Oracle's only
officially certified on a few commercial Linux distributions e.g. RedHat
Advanced Server - but it works on many others, if you set it up right. It has
more trouble on some distributions than others ... )

What's in the code? Have you tried examining the core dump with gdb to give
you some idea where the segfault happened?

For example, using a program that'll deliberately crash:

andyh@server:~/tmp$ cat dumpy.c
int crash() {
char* crashycrashy = 12345;
*crashycrashy = 100;
}

int main() {
crash();
}
andyh@server:~/tmp$ gcc -o dumpy dumpy.c
dumpy.c: In function `crash':
dumpy.c:2: warning: initialization makes pointer from integer without a cast
andyh@server:~/tmp$ ./dumpy
Segmentation fault (core dumped)

OK - so it's crashed, and dumped out a 'core' file.

You can use gdb (the debugger) to load up the program and the core file, and
it'll be able to give clues as to what happened at the time of the crash:

andyh@server:~/tmp$ gdb dumpy core
GNU gdb 5.2
Copyright 2002 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-slackware-linux"...
Core was generated by `./dumpy'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0 0x080483d0 in crash ()
(gdb)
Here it's saying that the crash happened in the crash() function. (If it were
compiled with debugging options it'd give even more information).

You can use the 'bt' (backtrace) command to get the stack of calls that lead
up to the crash:

(gdb) bt
#0 0x080483d0 in crash ()
#1 0x080483e3 in main ()
#2 0x4003317d in __libc_start_main () from /lib/libc.so.6

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #2
> What distribution of Linux, and what version(s) of Oracle? (Oracle's only
officially certified on a few commercial Linux distributions e.g. RedHat
Advanced Server - but it works on many others, if you set it up right. It has
more trouble on some distributions than others ... )
It's a Red Hat 9 distribution with ORACLE 8.1.6 client-side.
This web-server is used for a big application in php/ORACLE, and works
well, without crash.


What's in the code? Have you tried examining the core dump with gdb to give
you some idea where the segfault happened?


No core dump are created ! the application works fine, the commit
action is done on the database. Really, except the message
"segmentation fault" all is OK. I think it's only where php programm
free the memory at the end that this message gone.

Yes, this bug is not critical for my application, but the end-users
said each time "WOHH, a bug ! your programm doesn't work !"

At the beginning, I Saw that I have forgotten to close 1 cursor, and since
I close this cursor, the application doesn't crash all the the time, but in
some cases , BOUMM, the message appear.

I have read many times the program source to find a database cursor not close
or a database connexion not close, nothing.
strange no ?

thank you for your response, and I offer one's apologies for my english !
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: jerrygarciuh | last post by:
Hello, I have a script running in the wee hours via cron job. When I access the script via browser it works like a charm. I noticed it was not succeeding and ran it manually from the command...
2
by: Ron Kneusel | last post by:
I've installed Python 2.3.4 on Red Hat 9 and everything seems to be working fine. Tkinter is available and I can run GUI scripts. However, when I try to start Idle I get a segmentation fault. ...
6
by: Jay donnell | last post by:
I have a short multi-threaded script that checks web images to make sure they are still there. I get a segmentation fault everytime I run it and I can't figure out why. Writing threaded scripts is...
3
by: diyanat | last post by:
i am writing a cgi script in C using the CGIC library, the script fails to run, i am using apache on linux error report from apache : internal server error Premature end of script headers:...
5
by: Fra-it | last post by:
Hi everybody, I'm trying to make the following code running properly, but I can't get rid of the "SEGMENTATION FAULT" error message when executing. Reading some messages posted earlier, I...
18
by: Digital Puer | last post by:
Hi, I'm coming over from Java to C++, so please bear with me. In C++, is there a way for me to use exceptions to catch segmentation faults (e.g. when I access a location off the end of an array)?...
27
by: Paminu | last post by:
I have a wierd problem. In my main function I print "test" as the first thing. But if I run the call to node_alloc AFTER the printf call I get a segmentation fault and test is not printed! ...
7
by: pycraze | last post by:
I would like to ask a question. How do one handle the exception due to Segmentation fault due to Python ? Our bit operations and arithmetic manipulations are written in C and to some of our...
3
by: madunix | last post by:
My Server is suffering bad lag (High Utlization) I am running on that server Oracle10g with apache_1.3.35/ php-4.4.2 Web visitors retrieve data from the web by php calls through oci cobnnection...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.