[Git][ghc/ghc][master] rts: Ensure that sigaction structs are initialized

Marge Bot gitlab at gitlab.haskell.org
Thu Apr 23 03:13:52 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
6f84aca3 by Ben Gamari at 2020-04-22T23:13:43-04:00
rts: Ensure that sigaction structs are initialized

I noticed these may have uninitialized fields when looking into #18037.
The reporter says that zeroing them doesn't fix the MSAN failures they
observe but zeroing them is the right thing to do regardless.

- - - - -


1 changed file:

- rts/posix/Signals.c


Changes:

=====================================
rts/posix/Signals.c
=====================================
@@ -624,7 +624,7 @@ set_sigtstp_action (bool handle)
 void
 install_vtalrm_handler(int sig, TickProc handle_tick)
 {
-    struct sigaction action;
+    struct sigaction action = {};
 
     action.sa_handler = handle_tick;
 
@@ -666,7 +666,8 @@ install_vtalrm_handler(int sig, TickProc handle_tick)
 void
 initDefaultHandlers(void)
 {
-    struct sigaction action,oact;
+    struct sigaction action = {};
+    struct sigaction oact = {};
 
     // install the SIGINT handler
     action.sa_handler = shutdown_handler;



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6f84aca31290afc11acde0f86969a535e519e1d5

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6f84aca31290afc11acde0f86969a535e519e1d5
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200422/5a1aebcb/attachment.html>


More information about the ghc-commits mailing list