Segmentation fault in Unix shell (linux OS)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Segmentation fault in Unix shell (linux OS)
# 1  
Old 09-17-2012
Segmentation fault in Unix shell (linux OS)

Hi,

I am trying to run an online downloaded tool but I am having an eror segmentation fault.

Code:
./multicoil test.seq
Config file /home/kmohanas/MULTICOIL/multicoil_config
window length 0 = 28
window length 1 = 28
multi_lib = 3 4 5 
multi_lib = 2 3 4 
pair_lib = 1 2 4 
printfile = /dev/null
log = ~/MULTICOIL/TEST_RUNS/test.seq.log
seq scores = ~/MULTICOIL/TEST_RUNS/test.seq.seq_scores
out = ~/MULTICOIL/TEST_RUNS/test.seq.out
Reading Gen Frequences.
Reading Position Frequences.
Reading Position Frequences.
Segmentation fault

Any help is much appreciated

Thanks
# 2  
Old 09-18-2012
The problem is likely in the data you are giving the tool. I am assuming the tool is well-written, which is not always true.

A segmentation fault occurs when a process tries to access memory beyond or outside of memory the process owns. For example, maybe you have 3 lines of data (100 bytes per line) that do not have newlines. If the code reads that one line into memory expecting 100 bytes it gets 400. (3+1 with a newline) The storage set up to read may only allow for 100 bytes, so when you read the long line, you have tried to write to a "part" of the memory you do not own.
# 3  
Old 09-18-2012
It is not the shell that's segfaulting. The shell is sitting doing nothing waiting for the tool to quit when the segfault happens.
# 4  
Old 09-18-2012
Hi all,

Thanks for the reply. I figured it out where it went wrong. Thanks again.
# 5  
Old 09-18-2012
Quote:
Originally Posted by kaav06
Thanks for the reply. I figured it out where it went wrong. Thanks again.
Then please take a few minutes to share the solution with everyone. It may help someone else in the future.

Regards,
Alister
# 6  
Old 09-18-2012
yes please
# 7  
Old 09-18-2012
While the program was running, I was supposed to press any key for further compilation. When I pressed enter, it resulted in segmentation fault. But when I pressed space or some other key, it worked and problem was solved.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

C. To segmentation fault or not to segmentation fault, that is the question.

Oddities with gcc, 2.95.3 for the AMIGA and 4.2.1 for MY current OSX 10.14.1... I am creating a basic calculator for the AMIGA ADE *NIX emulator in C as it does not have one. Below are two very condensed snippets of which I have added the results inside the each code section. IMPORTANT!... (11 Replies)
Discussion started by: wisecracker
11 Replies

2. Shell Programming and Scripting

Segmentation fault in function call, shell script

I am getting Segmentation fault at below function call in my script: get_x() { sqlplus -s / <<end | grep KEEP | sed 's/KEEP//;s///g' select 'KEEP' ,table_name from all_synonyms where upper(synonym_name)= '$1'; exit end x=$(get_x $1) echo " SQL OUTPUT IS :: $x" } I am getting output of... (1 Reply)
Discussion started by: IB_88
1 Replies

3. Debian

Linux, Debian - Segmentation Fault problem.

Hi guys, first of all apologize for my English... I have a big problem with "Segmentation fault", when running my game server. Console: (gdb) bt full #0 0x0000000000000000 in ?? () No symbol table info available. #1 0x00007ffff702aca4 in std::basic_ostream<char,... (1 Reply)
Discussion started by: Arson.
1 Replies

4. Programming

Segmentation fault

I keep getting this fault on a lot of the codes I write, I'm not exactly sure why so I'd really appreciate it if someone could explain the idea to me. For example this code #include <stdio.h> main() { unsigned long a=0; unsigned long b=0; int z; { printf("Enter two... (2 Replies)
Discussion started by: sizzler786
2 Replies

5. Homework & Coursework Questions

Segmentation Fault

this is a network programming code to run a rock paper scissors in a client and server. I completed it and it was working without any error. After I added the findWinner function to the server code it starts giving me segmentation fault. -the segmentation fault is fixed Current problem -Also... (3 Replies)
Discussion started by: femchi
3 Replies

6. Programming

Using gdb, ignore beginning segmentation fault until reproduce environment segmentation fault

I use a binary name (ie polo) it gets some parameter , so for debugging normally i do this : i wrote script for watchdog my app (polo) and check every second if it's not running then start it , the problem is , if my app , remain in state of segmentation fault for a while (ie 15 ... (6 Replies)
Discussion started by: pooyair
6 Replies

7. Red Hat

Segmentation fault on basic linux commands

Hello out there!!! I have a Red Hat Entreprise Linux 4 server and I am encountering this error # grep Segmentation Fault I know it is not the right use of grep command, but I did that just for testing purpose,then I did # which grep /bin/grep # ls -l /bin/grep -rwxr-xr-x 1 root... (4 Replies)
Discussion started by: inhaki
4 Replies

8. Programming

segmentation fault

If I do this. Assume struct life { char *nolife; } struct life **life; // malloc initialization & everything if(life->nolife == 0) Would I get error at life->nolife if it is equal to 0. wrong accession? (3 Replies)
Discussion started by: joey
3 Replies

9. UNIX for Dummies Questions & Answers

Segmentation Fault

Hi, While comparing primary key data of two tables thr bteq script I am getting this Error. This script is a shell script. *** Error: The following error was encountered on the output file. Script.sh: 3043492 Segmentation fault(coredump) Please let me know how to get through it. ... (5 Replies)
Discussion started by: monika
5 Replies

10. Shell Programming and Scripting

How to overcome Segmentation Fault in Unix ??

Hi.. I want to add a line of data to a already existing file.. When i use echo "1i\nGROUP_NAME,JOB_NAME,STATUS,PROCESS_GROUP,JOB_START,JOB_END \n.\nwq" | ex -s abc.txt where abc.txt contains only Hello Testing Insert I am getting this.. dumb: Unknown terminal type ksh: 19464... (4 Replies)
Discussion started by: charan81
4 Replies
Login or Register to Ask a Question