473,408 Members | 1,788 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 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 6780
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.