Operating System - HP-UX
1833589 Members
3792 Online
110061 Solutions
New Discussion

Segmentation fault & Core-dump

 
SOLVED
Go to solution
KapilRaj
Honored Contributor

Segmentation fault & Core-dump

Guys,

Can anybody give me an explanation to segmentation fault and core dump ?. I hope this is an APPS issue. Still to convince the APPS guys !! ??

I think (though not sure) this is a program written in C.

Regds,

Kaps
Nothing is impossible
8 REPLIES 8
Mark Grant
Honored Contributor
Solution

Re: Segmentation fault & Core-dump

This is probably an apps issue. If an application writes data across memory boundaries that it's not allowed to you will get a segmentation violation.

Usually this is the result of pointers waving in the breeze or writing 10k of data to a buffer that has only "malloc'ed" 1k.
Never preceed any demonstration with anything more predictive than "watch this"
KapilRaj
Honored Contributor

Re: Segmentation fault & Core-dump

Thank you ..

These terms .... Malloc pointers ... ohmm .. can u explain little more in detail if u have time please...

Regds,

Kapil
Nothing is impossible
Nicolas Dumeige
Esteemed Contributor

Re: Segmentation fault & Core-dump

If there's a core dump, it can be analyzed with a debugger.
If the apps. is not home made, maybe you can contact the support team.

All different, all Unix
Nicolas Dumeige
Esteemed Contributor

Re: Segmentation fault & Core-dump

A pointer is a reference to the begining of a memory area.
malloc() is the C standard fonction for memory allocation, the opposit function is free().
There is abondant littelrature on this subject on the web.

Good luck
All different, all Unix
Mark Grant
Honored Contributor

Re: Segmentation fault & Core-dump

These are "C" type thingies.

A pointer is a variable that doesn't contain any data itself except the address of something else. For example I might have a chunk of memory, say 1k's worth that I have reserved for my application using the "malloc()" call. malloc() returns a "pointer" to that memory region. I can access this region by reference to this pointer. If I wrote 10k of data, using this pointer, I'd probably get a segmentation violation.

More fun is when you create a pointer to another variable, destroy the variable and then attempt to use the pointer again. This means you are using a pointer that points at nothing. It's rather hard to debug this because your code looks fine.

The fun of "C" eh :)
Never preceed any demonstration with anything more predictive than "watch this"
KapilRaj
Honored Contributor

Re: Segmentation fault & Core-dump

Support admit to be stupids !. Is there any forum / help I can get to analise the coredumps ?

Regds,

Kaps
Nothing is impossible
Naveej.K.A
Honored Contributor

Re: Segmentation fault & Core-dump

hi kapil,

There is a command called adb(absolute debugger) in hpux which is used to analyse core dumps....Dont know how much it is usefull for analysing them.

Hi experts!!! Am i correct.

The man pages says:

The adb command executes a general-purpose debugging program that is sensitive to the underlying architecture of the processor and
operating system on which it runs. It can be used to examine files and provide a controlled environment for executing HP-UX programs.

With best wishes
Naveej
practice makes a man perfect!!!
Nicolas Dumeige
Esteemed Contributor

Re: Segmentation fault & Core-dump

For wich dumb firm does the dumb support works for ?

It would help to know what to look for.

For a segmentation violation, I guess the stack would be of interest since it contain run-time function ans procedure activation records.

Are you able to reproduce the error at will ?
That also the kind of information a support normaly ask for.
All different, all Unix