[Webinar] Streamline your web hosting managementRegister Today


Segemntation fault

Posted on 2010-08-17
Medium Priority
Last Modified: 2013-11-25
I am running a script which calls the COBOL program on AIX but it throws an error saying "segmentation fault"..When I compile and link the COBOL program seperately it links fine but when I run it thorugh script it throws "segmentation fault eror"

1) Any idea on how to fix it?
2) As per my knowledge when there is a core dump..it creates a core file..But I could not see the core file as well.
Question by:r4ranjor

Accepted Solution

uscshaggy earned 2000 total points
ID: 33461552
Segmentation fault means your program is trying to follow a NULL pointer. Since it fails in the script, but not standalone, I would check the environment inside the script versus when you launch it manually.  Maybe some needed variable is not set in the script's environment.

There should be a core file created, though, as you expected.  You should search the whole system for core files in case it got put in an unexpected directory (working directory in the script might be different than yours).  Or check your ulimits to make sure the core file is allowed to be written out and is not hitting a size limit.
LVL 25

Expert Comment

ID: 33461598
try looking at ulimit and filesystesm
LVL 10

Expert Comment

ID: 33463333
For core dump check "ulimit -a" to see if the core file size is set to 0.
If so you can set it to something large like "ulimit -c 1000000000"

It is possible that you might have an uninitialised variable or pointer which is 0 or NULL when run from a shell but picks up some random value from memory when run in a different way.
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

LVL 25

Expert Comment

ID: 33463405
try increasing ulimit to unlimited but on the other hand IMO its strange for an program/software  to set this limit to unlimited

Author Comment

ID: 33470992

I still could not find out the solution for this..Even I cannot see the coredump file as the coredump size is set to zero...

Any help in resolving this would be highly appreciated..
LVL 25

Expert Comment

ID: 33472109

Expert Comment

ID: 33472266
Can you increase the core file size limiit to unlimited or some large size to allow it to generate?

Remember to check/set both soft and hard ulimits:

ulimit -Hc unlimited
ulimit -c unlimited

Expert Comment

ID: 33473410
Please check the path where the core file will be generated.

you can get the path using syscorepath -g  

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question