1

I am running the following program

#!/bin/bash
for (( x=1; x<=180; x++ ))
do
./speed && perl load_tables.pl && Rscript Test.R     
done

but after some loops I get the error

Profiling timer expired

How can I fix it?

user3910073
  • 511
  • 1
  • 6
  • 23
  • It must have something to do with "some stuff". [Related?](http://stackoverflow.com/questions/42024496/profiling-timer-expired-when-using-gperftools-with-sort) [Or this?](http://stackoverflow.com/questions/2146082/valgrind-profiling-timer-expired) – Aaron Feb 14 '17 at 10:04
  • @Aaron thanks for your reply but I don't think so, since once it stops I can make it run again from the point it stopped... – user3910073 Feb 14 '17 at 10:33
  • Still, you should post what "some stuff" is if you can. It looks like it can be raised by `make` when it receives a `SIGPROF`, but it could be another software for another reason. `SIGPROF` is related to profiling, the loop you posted can't be responsible for it alone (although it is plausible that it won't happen if "some stuff" is only executed once). Are you maybe `time`ing your execution? – Aaron Feb 14 '17 at 10:40
  • @Aaron thanks. Some stuff is a combination of .cxx programs and R scripts. I am not sure if I am timing it, how can I check? – user3910073 Feb 14 '17 at 10:43
  • Ok I saw your edit, and it's very lickely that `speed` is raising or catching the SIGPROF since it sounds related to profiling. Now I don't know this binary, but someone might be able to help now – Aaron Feb 14 '17 at 10:44
  • @ Aaron no it's some program I wrote, but in the loop I am calling more of them. The weird thing is that if I run it different times it stops at different steps (x=10, x=15, etc..) in the loop.. – user3910073 Feb 14 '17 at 10:46
  • Ok, I understand why you didn't post it at first ! I would suggest trying to isolate the error to `speed` (or the others if it fails), maybe by invoking it in a loop where it only `speed` and `sleep` ? Once you confirm the source of your problem, then you'll be able to ask for help debugging it by posting its code here – Aaron Feb 14 '17 at 10:49
  • 1
    I won't be able to help any further, I suck at `c++`, `perl` and `R`. Good luck ! – Aaron Feb 14 '17 at 10:49
  • @Aaron thanks for the suggestions! – user3910073 Feb 14 '17 at 10:55

1 Answers1

0

You can make your script ignore the SIGPROF signal by adding this command at the top:

trap "" SIGPROF

This registers a signal handler for SIGPROF that does nothing (the empty string).

Benji York
  • 2,044
  • 16
  • 20