NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

toolchain/38031: fork/wait return/take type pid_t not int in bmake



>Number:         38031
>Category:       toolchain
>Synopsis:       fork/wait return/take type pid_t not int in bmake
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 14 20:25:00 +0000 2008
>Originator:     Ryan Stutsman
>Release:        None; HiStar amd64
>Organization:
Stanford University
>Environment:
Linux histar-box HiStar devel x86_64 GNU/Linux

>Description:
In trying to run pkgsrc/bootstrap/bootstrap bmake must be build.  The bootstrap 
version of bmake compiles successfully but fails to run non-deterministically 
because HiStar uses 64-bit pid_t and bmake naively stores the return from vfork 
as int.

A patch is given to modify the storage for the pid to be type pid_t instead of 
int.

To ensure bmake (and, thus, pkgsrc) portability the storage of the return type 
should match the function declaration.

This probably affects trunk NetBSD's make as well, though I haven't looked 
since I'm not using this on NetBSD.  If additional work needs to be done to 
correct the mainline copy of make I'd be happy to take care of it as well.
>How-To-Repeat:
Run the HiStar amd64 iso, untar pkgsrc in any directory and run the bootstrap 
script.  Once the build procedure starts invoking the bmake.boot  that it has 
built forks will begin to fail non-deterministically.
>Fix:
--- files/compat.c      2008-02-14 18:48:13.000000000 +0000
+++ files/compat.c.orig 2008-02-14 18:37:22.000000000 +0000
@@ -214,8 +214,8 @@
                  errCheck;     /* Check errors */
     WAIT_T       reason;       /* Reason for child's death */
     int          status;       /* Description of child's death */
-    pid_t        cpid;         /* Child actually found */
-    pid_t        retstat;      /* Status of fork */
+    int                  cpid;         /* Child actually found */
+    ReturnStatus  retstat;     /* Status of fork */
     LstNode      cmdNode;      /* Node where current command is located */
     const char  **av;          /* Argument vector for thing to exec */
     int                  argc;         /* Number of arguments in av or 0 if not



Home | Main Index | Thread Index | Old Index