Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Segemntation fault

Posted on 2010-08-17
8
Medium Priority
?
1,040 Views
Last Modified: 2013-11-25
Hi,
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.
0
Comment
Question by:r4ranjor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 2

Accepted Solution

by:
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.
0
 
LVL 25

Expert Comment

by:madunix
ID: 33461598
try looking at ulimit and filesystesm
0
 
LVL 10

Expert Comment

by:Martin_J_Parker
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.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 25

Expert Comment

by:madunix
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
0
 

Author Comment

by:r4ranjor
ID: 33470992
HI,

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..
0
 
LVL 25

Expert Comment

by:madunix
ID: 33472109
0
 
LVL 2

Expert Comment

by:uscshaggy
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
0
 
LVL 5

Expert Comment

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

you can get the path using syscorepath -g  
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

721 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