bugDenemo - Bugs: bug #35749, Fix signal handler

 
 

bug #35749: Fix signal handler

Submitter:  Markus Elfring <elfring>
Submitted:  Wed 07 Mar 2012 07:10:27 PM UTC
   
 
Category:  None Severity:  1 - Wish
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Originator Name:  Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 12 Aug 2015 03:42:09 PM UTC, comment #14: 

The priority to do this is so low that it shouldn't get on tbe bug tracker until there is some need for Denemo to handle signals.

Richard Shann <rshann>
Group administrator
Wed 12 Aug 2015 11:50:30 AM UTC, comment #13: 

How do you think about to make the selection possible for the use of specific signal handlers by another configuration option for your build system (http://git.savannah.gnu.org/cgit/denemo.git/commit/?id=ab6b4870f3dba3e54f777efe9929325f75a82900 instead of [only commenting a function call out])?

Markus Elfring <elfring>
Tue 11 Aug 2015 08:23:51 PM UTC, comment #12: 

Signal handler implementations can still be unsafe even if they belong to a single-threaded program.
It might appear unlikely to some degree to observe unwanted run time behaviour from such open issues. I hope that corresponding error situations can be better avoided.

Markus Elfring <elfring>
Tue 11 Aug 2015 08:00:01 PM UTC, comment #11: 

From my limited understanding those small programs are not erroneous since they are not threaded. They set a signal handler then cause a floating point exception then the signal handler exits if the exception caused a signal otherwise main exits.
But you would need to find the authors to verify this (I guess it is part of automake or whatever the gnu system for creating makefiles is called).

Richard Shann <rshann>
Group administrator
Tue 11 Aug 2015 06:55:39 PM UTC, comment #10: 

Would it be nice if small test programs can also be corrected?

Markus Elfring <elfring>
Tue 11 Aug 2015 06:47:08 PM UTC, comment #9: 

Well, by eliminating the use of signal handlers in the Denemo source code I guess I can remain blissfully ignorant of this topic :)

I don't think there is a need to report back to whoever creates the M4 macros, as these short compiler test programs clearly are not threaded.

Richard Shann <rshann>
Group administrator
Tue 11 Aug 2015 06:40:53 PM UTC, comment #8: 

The knowledge and awareness for asynchronous-signal-safety is incomplete as the affected source files showed. Safe data exchange with signal handlers is a known software development challenge.

I find corresponding comments a bit interesting. Do any fixes need to be reported back to other software origins?

Would you like to replace any exit() calls by _Exit() at such source code places?

Markus Elfring <elfring>
Tue 11 Aug 2015 06:26:08 PM UTC, comment #7: 

No, I didn't notice that. The M4 code is a small C program being used to test the compiler features before using the compiler to compile Denemo (I would guess), it uses exit(), but I would guess they know what they are doing.
The other one, I've no idea what it is for - it is clearly only for some sort of debugging as Denemo is a GUI.
I've dropped the call to  signal() as it does not seem to serve a useful purpose, and on the face of it could cause a problem with threads as you say.

Richard Shann <rshann>
Group administrator
Tue 11 Aug 2015 05:30:47 PM UTC, comment #6: 

Did you notice that one signal handler is defined in a M4 script while the other is in a C source file?
Will more source code clean-up be a bit useful here?

Markus Elfring <elfring>
Tue 11 Aug 2015 04:04:14 PM UTC, comment #5: 

I can see the sigchld_handler code in the current code but not the sigfpe_handler, which must be the one I recalled having been deleted.
The one that remains seems to want to put a message out on to stderr and then continue - the messages concerned I have never seen being emitted, but I just checked and the code is compiled in my build. I don't know what it is intended to achieve, perhaps we can just safely delete it?

Richard Shann <rshann>
Group administrator
Tue 11 Aug 2015 03:44:20 PM UTC, comment #4: 

How do you think about to fix the current implementations of the functions "sigchld_handler" and "sigfpe_handler"?

Markus Elfring <elfring>
Tue 11 Aug 2015 03:00:05 PM UTC, comment #3: 

As I recall the denemo signal handler code was dropped some time ago. Can you be more explicit about what it is you have observed that is wrong with the current code - some indication of what needs fixing and how to check if it is fixed?

Richard Shann <rshann>
Group administrator
Tue 11 Aug 2015 02:10:27 PM UTC, comment #2: 

Do you care for program correctness if only async-signal-safe functionality will be used within signal handlers?

Markus Elfring <elfring>
Tue 11 Aug 2015 01:32:40 PM UTC, comment #1: 

It's not clear what needs fixing, if anything now.

Richard Shann <rshann>
Group administrator
Wed 07 Mar 2012 07:10:27 PM UTC, original submission:  

The functions "g_print" and "exit" do not belong to the list of async-signal-safe functions.
I guess that a different program design will be needed for functions like "denemo_signal_handler".

Markus Elfring <elfring>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rshann (Posted a comment)
  • -email is unavailable- added by elfring (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-08-12 rshann Severity3 - Normal 1 - Wish
    2015-08-11 rshann StatusNeed Info Fixed
        Open/ClosedOpen Closed
    2015-08-11 rshann StatusFixed Need Info
        Open/ClosedClosed Open
    2015-08-11 rshann StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code