Operating System - Linux
1753529 Members
5397 Online
108795 Solutions
New Discussion юеВ

Re: Segmentation fault Error

 
Sridhar SASTRA
Occasional Contributor

Segmentation fault Error

We are running a programm in HP UNIX 11i. It is giving the following error message. Please give the solution for this.

sastra 18: ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 1048576
stack(kbytes) 131072
memory(kbytes) unlimited
coredump(blocks) unlimited
nofiles(descriptors) 60
sastra 19: autodock4 -p ata.dpf -l ata.dlg
Segmentation fault (core dumped)
4 REPLIES 4
Dennis Handly
Acclaimed Contributor

Re: Segmentation fault Error

You need to make sure you have the latest gdb and get a stack trace:
$ gdb autodock4 core
(gdb) bt
(gdb) q

Of course it would help if autodock 4 was compiled with -g.
Sridhar SASTRA
Occasional Contributor

Re: Segmentation fault Error

Yes autodock4 was compiled with with g++ and we are getting this message after this.

sastra 17: gdb autodock4 core
HP gdb 3.0 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 3.0 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
Detected 64-bit executable.
Invoking /opt/langtools/bin/gdb64.
Use "run" to continue execution.
(gdb) run
Starting program: /wisconsin/savani/biotool/autodocksuite-4.0.1/src/autodock-4.0
.1/autodock4
warning: Unable to find __d_pid symbol in object file.
warning: Suggest linking with /opt/langtools/lib/end.o.

Program received signal SIGSEGV, Segmentation fault.
0x400000000000d990 in main ()
Dennis Handly
Acclaimed Contributor

Re: Segmentation fault Error

>Yes autodock4 was compiled with with g++

Did you compile with -g for debug info?

>sastra 17: gdb autodock4 core
HP gdb 3.0 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00.

The latest is 5.7. Download it from:
http://www.hp.com/go/wdb
Andrew Merritt_2
Honored Contributor

Re: Segmentation fault Error

Hi Sridhar,
The basic problem is that you have a bug in your program, which is causing the segmentation fault, leading to a core dump.

You will need to find out where in the code this is happening (and the information Dennis has given is the first steps towards this), and fix it.

Is it your program, or a third party application? Are there any errors given by the compiler, or by lint? Are you compiling with '-g' argument to your compiler (g++), as Dennis asks? Without that, you won't see symbols in the debugger, so will not find it easy to find where the code is failing. Another strategy is to put in trace statements, typically printf(), so you know how far the program gets before failing.

Andrew

(C joke; what's the difference between g++ and -g? 2g+1.)