[svlug] How to debug this error - help please -.

Seth David Schoen schoen at uclink4.berkeley.edu
Sun Apr 11 15:22:23 PDT 1999


Mike Rushford writes:

> What happens is one part of this app called sfmike is
> "Segmentation Fault" causing a core file dump.
> 
> Like this;
> 
> [root at rscope /root]# sfmike -pecho.fourmilab.ch:2074
> Segmentation fault
> [root at rscope /root]# ls -lF core*
> -rw-------   1 root     root       262144 Apr  8 04:11 core
> 
> My question is how can I figure out what is wrong so I can work on it?
> 
> For starters what can be done with a core file that will help pinpoint
> the issue?

Use gdb, though learning it is a pretty major undertaking.

gdb sfmike core

You can then try "bt" (for "backtrace").

To learn gdb, try "help" in gdb; also "info gdb"; also the O'Reilly book
_Programming with GNU Software_ or the Free Software Foundation's _Debugging
with gdb_.

> Is it a glibc, kernel problem or oss driver problem?
> 
> I think
> a seg fault is due to wrongly used memory as governed by the kernel. Can
> the kernel tell me what was tried and be a little more helpful on what I
> need to change in sfmike to stoop this problem?

The kernel won't tell you that part.  But you can use gdb to get a lot of
information on what sfmike was doing when it crashed.

If you have source code for sfmike and all the libraries it uses handy, you
can also get source-level debugging.  You'll want to compile with "-g".

sfmike is Speak Freely, right?  I forgot the license for that and whether
it has source code.

> Can it tell me oss as
> aposed to glibc calls from sfmike are hte problem?

You can tell (or figure out) what library the crash happened in, yes.

> Can someone point out how a core file gets to disk to begin with and in
> general how can they be used? Since I do a fair bit of tinkering with my
> system I got several of the core dropping in various places on my drive.
> 
> Is there a way to have the core droppings go to a particular dir.?

Not standardly; they appear in the current working directory of the
application that caused them.

> How can I just stop this file from writing to disk?

ulimit (bash) or limit (tcsh); set a default maximum core file size of 0
bytes.  I believe that the kernel default can also be changed at kernel
compile time, and perhaps by some configuration utility that uses an ioctl
or filesystem interface under /proc.  But the most standard way is probably
to use ulimit and limit in your /etc/profile and /etc/cshrc to set the
core size limit to 0.

-- 
              Seth David Schoen / schoen at uclink4.berkeley.edu
He said, "This is what the king who will reign over you will do."  And they
said, "Nay, but we will have a king over us, that we also may be like all the
nations." (1 Sam 8)  http://ishmael.geecs.org/~sigma/   http://www.loyalty.org/

--
echo "unsubscribe svlug" | mail majordomo at svlug.org
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ to unsubscribe
see http://www.svlug.org/mdstuff/lists.shtml for posting guidelines.



More information about the svlug mailing list