-2

I am a beginner to programming etc., and I have to use an existing code for my work. When I run it (it is a .sh script), I get this error:

line 21: 5048 Segmentation fault ./genome_compare fasta_list_hg19 (......) >HDAC8_20_20.copy_counts.se

I got few more of the same error with different numbers preceeding the Segmentation fault, all of which on the line which mention this ./genome_compare command.

Does this mean the error is inside the genome_compare executable?

More info: The scripts are available on a public depository from U Washington and I used Cygwin to use it from inside Windows.

stellaxx
  • 1
  • 1
  • 2
  • It's unlikely the script is causing the segmentation fault, it's in the program the script runs. We can't help without code, but the best bet would be to run the genome_compare program in a debugger. – Collin Jun 18 '14 at 16:47
  • Yes, the error is inside the `genome_compare` executable. I believe the number 5048 is just the process ID of the program that crashed, and can safely be ignored. We are unlikely to be able to help you further -- you should instead contact the authors of the `genome_compare` program for assistance. (I would bet a cookie that the basic problem is that the program has never actually been tested on Cygwin.) – zwol Jun 18 '14 at 16:47
  • Oh, one more piece of advice: Run the shell script with `sh -x nameofscript.sh`. That will tell you the exact command line that crashed. Copy and paste that line (without the leading `+`) into a terminal and run it ten times in a row. Does it crash *every single time*? If it doesn't, you have a *hardware* problem (most likely bad RAM). – zwol Jun 18 '14 at 16:49
  • @Zack - I've been going over the errors I'm getting. A couple of days back I only got a few /r errors which I found out were to do with the dos2unix conversion. Now, I get those segmentation fault errors (along with /r errors) - even though I did not change anything in the genome_compare file. Do you know why this could be happening and what I should do to work around that? – stellaxx Jun 19 '14 at 15:07

1 Answers1

0

Here's an excellent answer about segmentation fault already: What is a segmentation fault?

From my personal experience there is no easy way or "single best formula" to resolve these. Debug your code esp. when using pointers.

You might want to post a snipplet of your code for us to review and provide feedback.

Thanks.

Community
  • 1
  • 1
A Sharma
  • 626
  • 1
  • 5
  • 13
  • I've been going over the errors I'm getting. A couple of days back I on;y got a few /r errors which I found out were to do with the dos2unix conversion. Now, I get those segmentation fault errors (including the/r errors) - even though I did not change anything in the genome_compare file. Do you know why this could be happening and what I should do to work around that? – stellaxx Jun 19 '14 at 15:06