]> Cypherpunks repositories - gostls13.git/commitdiff
runtime, runtime/cgo: revert CL 18814; don't drop signal stack in new thread on dragonfly
authorMikio Hara <mikioh.mikioh@gmail.com>
Wed, 28 Sep 2016 08:26:12 +0000 (17:26 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Wed, 28 Sep 2016 14:45:06 +0000 (14:45 +0000)
This change reverts CL 18814 which is a workaroud for older DragonFly
BSD kernels, and fixes #13945 and #13947 in a more general way the
same as other platforms except NetBSD.

This is a followup to CL 29491.

Updates #16329.

Change-Id: I771670bc672c827f2b3dbc7fd7417c49897cb991
Reviewed-on: https://go-review.googlesource.com/29971
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/cgo/gcc_dragonfly_amd64.c
src/runtime/sys_dragonfly_amd64.s

index b534dccf79710bfbab31833f25a9d3bcdc9da1d5..e532ad69d6933a564d8bdddd2369c61b4ddc1efd 100644 (file)
@@ -56,7 +56,6 @@ static void*
 threadentry(void *v)
 {
        ThreadStart ts;
-       stack_t ss;
 
        ts = *(ThreadStart*)v;
        free(v);
@@ -66,17 +65,6 @@ threadentry(void *v)
         */
        setg_gcc((void*)ts.g);
 
-       // On DragonFly, a new thread inherits the signal stack of the
-       // creating thread. That confuses minit, so we remove that
-       // signal stack here before calling the regular mstart. It's
-       // a bit baroque to remove a signal stack here only to add one
-       // in minit, but it's a simple change that keeps DragonFly
-       // working like other OS's. At this point all signals are
-       // blocked, so there is no race.
-       memset(&ss, 0, sizeof ss);
-       ss.ss_flags = SS_DISABLE;
-       sigaltstack(&ss, nil);
-
        crosscall_amd64(ts.fn);
        return nil;
 }
index 76dff106704f2940003e02ded4a5982af7fd1ddb..bc16bdbbde90d72eca0e4e68adadef99890d387a 100644 (file)
@@ -51,18 +51,6 @@ TEXT runtime·lwp_start(SB),NOSPLIT,$0
        MOVQ    R13, g_m(DI)
        MOVQ    DI, g(CX)
 
-       // On DragonFly, a new thread inherits the signal stack of the
-       // creating thread. That confuses minit, so we remove that
-       // signal stack here before calling the regular mstart. It's
-       // a bit baroque to remove a signal stack here only to add one
-       // in minit, but it's a simple change that keeps DragonFly
-       // working like other OS's. At this point all signals are
-       // blocked, so there is no race.
-       SUBQ    $8, SP
-       MOVQ    $0, 0(SP)
-       CALL    runtime·signalstack(SB)
-       ADDQ    $8, SP
-
        CALL    runtime·stackcheck(SB)
        CALL    runtime·mstart(SB)