×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Crazy process tree

  • Posts: 278
  • Thank you received: 17

Crazy process tree was created by S

Hi!

I have been trying out the dome scripting gateway and kstars and indi have been running (fine) on my RPi for a week or so. But running ps today I noticed the following process tree:
 

Everything worked fine despite of this. I have not been able to reproduce the "error" yet, so this is just to let you know that something seems to go wrong somewhere...

Best Regards,
Søren
7 years 5 days ago #16277

Please Log in or Create an account to join the conversation.

  • Posts: 90
  • Thank you received: 37

Replied by Csaba Kertesz on topic Crazy process tree

Did not you see crashes of indi_script_dome in the INDI log on the Pi over time?

If a driver crashes, the process remains in zombie state and the INDI server starts a new driver process. It would explain this crazy long list.
7 years 5 days ago #16282

Please Log in or Create an account to join the conversation.

  • Posts: 1029
  • Thank you received: 301

Replied by Eric on topic Crazy process tree

If a driver dies, the process line should mention "(defunct)" and the STAT column should mark "Z". The situation depicted here matches a recursion.

Superficial look at the code in "dome_script.cpp" reveals that DomeScript::RunScript first forks the driver, then replaces that forked process with the script execution.

In the depicted situation, it appears the fork operation succeeded, but the script execution failed to actually replace the process with anything, leaving the driver process as is.

There is no provision against this type of error in the code: the funny result is a second, then a third, etc, INDI dome driver, still exchanging with the server and apparently always getting priority as a bonus :)

I'd look for missing scripts in the installation to explain why "execvp" is failing to execute properly.

Fixing this should be straightforward: the forked driver must not return but die with "exit()" if the attempt at execvp fails. However, there doesn't seem to be any side-effects to this situation, unless at some point the system decides the process recursion is weird and has to stop (antivirus decision for instance).

-Eric
The following user(s) said Thank You: Peter Polakovic
6 years 11 months ago #16360

Please Log in or Create an account to join the conversation.

  • Posts: 712
  • Thank you received: 174

Replied by Peter Polakovic on topic Crazy process tree

Hi Eric, you're right. Fixed in both scripting gateways... Thank you, Peter
6 years 11 months ago #16366

Please Log in or Create an account to join the conversation.

  • Posts: 1029
  • Thank you received: 301

Replied by Eric on topic Crazy process tree

Now that was a quick fix :)
I still have to return to the part of the code reaping zombie processes in indiserver. While it allows proper signal propagation in subprocesses it doesn't behave as I thought it would when drivers die.
6 years 11 months ago #16367

Please Log in or Create an account to join the conversation.

Time to create page: 1.504 seconds