0

Answers like this one say SIGKILL is bad:

I just found out, if i send a sig kill or sig term to my program, ONLY GCNO FILES ARE MADE, no gcda files.

However, my app runs under the ROS framework, and the only way to terminate it is with a Control-C. It can be trapped under most circumstances, but the framework also helps the process along with SIGKILLs, so some programs within my suite get terminated before they get a chance to save their data.

So, is there some API that I could call every 10 seconds or so to flush the counters to disk?

Ken Y-N
  • 14,644
  • 21
  • 71
  • 114
  • 1
    I get a strong sense of presence of XY problem in this post. Why do you need to flush or kill anything? Just wait for tests to finish and get a report. You should probably deal with *"some programs within my suite get terminated before they get a chance to save their data"* first. – user7860670 Apr 04 '19 at 07:44
  • Unfortunately, the framework is generating the `SIGKILL`. Maybe, though, I should check why one of the programs is not exiting as cleanly as I would hope, but IIRC last time I investigated shutdown issues there was actually a ROS bug that caused a spurious `SIGKILL`. – Ken Y-N Apr 04 '19 at 07:54
  • Did you report this bug? I would consider something like *"spurious SIGKILL"* a critical issue. – user7860670 Apr 04 '19 at 08:07
  • It's actually a known bug. – Ken Y-N Apr 04 '19 at 08:16
  • @VTT An update, if you are interested; it was a bug caused by [a destruction order issue in the framework](https://github.com/ros/ros_comm/issues/318), so if I explicitly delete one object in my destructor, the framework stopped crashing, so now my code produces `.gcda` files! – Ken Y-N Apr 05 '19 at 03:31

0 Answers0