]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: avoid runtime·cgocall in functions called by forkAndExecInChild
authorAram Hăvărneanu <aram@mgk.ro>
Thu, 13 Mar 2014 07:26:01 +0000 (18:26 +1100)
committerDave Cheney <dave@cheney.net>
Thu, 13 Mar 2014 07:26:01 +0000 (18:26 +1100)
Calling runtime·cgocall could trigger a GC in the child while
gclock was held by the parent.

Fixes #7511

LGTM=bradfitz, dvyukov, dave
R=golang-codereviews, bradfitz, dvyukov, dave
CC=golang-codereviews, rsc
https://golang.org/cl/75210044

src/pkg/runtime/syscall_solaris.goc

index cd30dd17889f1722768b8b50dec19f7eeac7b722..21bcce4d17ae5b5f4e86ec2233a0b22f8c9459dd 100644 (file)
@@ -170,7 +170,7 @@ func execve(path uintptr, argv uintptr, envp uintptr) (err uintptr) {
        c.fn = (void*)libc·execve;
        c.n = 3;
        c.args = (void*)&path;
-       runtime·cgocall(runtime·asmsysvicall6, &c);
+       runtime·asmcgocall(runtime·asmsysvicall6, &c);
        err = c.err;
 }
 
@@ -193,7 +193,7 @@ func fcntl1(fd uintptr, cmd uintptr, arg uintptr) (val uintptr, err uintptr) {
        c.fn = (void*)libc·fcntl;
        c.n = 3;
        c.args = (void*)&fd;
-       runtime·cgocall(runtime·asmsysvicall6, &c);
+       runtime·asmcgocall(runtime·asmsysvicall6, &c);
        err = c.err;
        val = c.r1;
 }
@@ -227,7 +227,7 @@ func ioctl(fd uintptr, req uintptr, arg uintptr) (err uintptr) {
        c.fn = (void*)libc·ioctl;
        c.n = 3;
        c.args = (void*)&fd;
-       runtime·cgocall(runtime·asmsysvicall6, &c);
+       runtime·asmcgocall(runtime·asmsysvicall6, &c);
        err = c.err;
 }
 
@@ -338,7 +338,7 @@ func write1(fd uintptr, buf uintptr, nbyte uintptr) (n uintptr, err uintptr) {
        c.fn = (void*)libc·write;
        c.n = 3;
        c.args = (void*)fd;
-       runtime·cgocall(runtime·asmsysvicall6, &c);
+       runtime·asmcgocall(runtime·asmsysvicall6, &c);
        err = c.err;
        n = c.r1;
 }