Menu

#42 Cannot profile application with unmanaged SIGTERM

open-fixed
None
1
2011-02-14
2010-11-22
megurikuru
No

Virtual NetManager (VNM) works together with VDE. When VNM stops running sub-programs (wirefilter, vde_switch, etc) sends SIGTERM (15). Inside VDE elements, at present, the default action with SIGTERM is to do a cleanup() , reattach the default signal management and execute default management of SIGTERM, that is SIGKILL. When profiling programs compiled with -gp, a clean exit is needed to correctly write the profiling information file (gmon.out). That means the program has to do a return from the main or execute exit(int);
I've fixed this doing a "if(sig==SIGTERM) exit(0);" inside the sig_handler function of the various programs (vde_switch,wirefilter,etc), just before the "kill(getpid(), sig);" line.

Discussion

  • megurikuru

    megurikuru - 2010-11-22

    Errata corrige: the line "if(sig==SIGTERM) exit(0);" has to be inserted at the head of sig_handler function to avoid double cleanup call [this is because the use of atexit(cleanup); function in main].

     
  • megurikuru

    megurikuru - 2010-11-26
    • priority: 5 --> 1
    • status: open --> open-works-for-me
     
  • renzo davoli

    renzo davoli - 2011-02-14

    current svn includes a fix for all the commands.

     
  • renzo davoli

    renzo davoli - 2011-02-14
    • assigned_to: nobody --> rd235
    • status: open-works-for-me --> open-fixed
     
  • Nobody/Anonymous

    I believe this is among the so much important info for me. And i am glad reading your article. However want to observation on few basic issues, The web site style is wonderful, the articles is actually nice : D. Good task, cheers
    <a href="http://www.yurigagarin.it/index.php?option=com_blog&view=comments&pid=202827&Itemid=0&lang=it" title="Making Prom Dresses Appear to be Better">Making Prom Dresses Appear to be Better</a>

     

Log in to post a comment.