Unix [SOLVED]: Take action after forked application crash

Unix [SOLVED]: Take action after forked application crash

Home Forums Unix Unix [SOLVED]: Take action after forked application crash

Tagged: , , , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #37022

    Anonymous

    QuestionQuestion

    I want to do one thing, but I don’t know it this is possible.

    My app starts with some messages in the console

    std::cout << "appStart" << std:endl
    

    after that, a child Qt process do draws in the framebuffer (the screen). If there is a fail in my Qt process, I’m able to capture it and kill the Qt process, and I want to show a message in the console

    std::cout << "app CRASH!" << std:endl
    

    but the screen is frozen with the last content draw by Qt and my message is not shown in the screen. How could clear the screen and show the console again to see my message?

    #37023

    Anonymous

    Accepted AnswerAnswer

    Finally I have found the problem. The issue was the kill method of the child process. Previously i closed the graphical process with

    SIGKILL     9   /* Kill, unblockable (POSIX).  */
    

    And the process stopped without any control, leaving the screen status. With

    #define SIGTERM     15  /* Termination (ANSI).  */
    

    the process is stopped correctly and the control is returned to my main program.

    Source: https://stackoverflow.com/questions/48008625/take-action-after-forked-application-crash
    Author: Xabi E
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.