bugmake - Bugs: bug #49938, fdin might be (but isn't?)...

 
 

bug #49938: fdin might be (but isn't?) clobbered by vfork

Submitter:  Martin Dorey <mdorey>
Submitted:  Mon 26 Dec 2016 06:42:49 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  4.3 Operating System:  POSIX-Based
Fixed Release:  4.3 Triage Status:  Small Effort
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 28 Dec 2016 02:29:53 PM UTC, comment #1: 

I don't see this with GCC 6.2 but the change is not a problem so I applied it.

Paul D. Smith <psmith>
Group administrator
Mon 26 Dec 2016 06:42:49 PM UTC, original submission:  

I imagine it's gcc-4.7 giving me this:

job.c: In function ‘child_execute_job’:
job.c:2126:7: error: variable ‘fdin’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]

... which goes away with this harmless-looking change:

martind@swiftboat:~/download/make-git$ git diff
diff --git a/job.c b/job.c
index 7d900ce..1b28324 100644
--- a/job.c
+++ b/job.c
@@ -2123,7 +2123,7 @@ child_execute_job (struct output out, int good_stdin, char *argv, char **envp)
 {
   int r;
   int pid;
-  int fdin = good_stdin ? FD_STDIN : get_bad_stdin ();
+  const int fdin = good_stdin ? FD_STDIN : get_bad_stdin ();
   int fdout = FD_STDOUT;
   int fderr = FD_STDERR;
 

Martin Dorey <mdorey>

 

(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 psmith (Posted a comment)
  • -email is unavailable- added by mdorey (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-12-28 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.3
        Triage StatusNone Small Effort

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code