]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: don't use MAP_STACK in SigStack test
authorIan Lance Taylor <iant@golang.org>
Sat, 9 Dec 2017 00:05:22 +0000 (16:05 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sat, 9 Dec 2017 01:21:32 +0000 (01:21 +0000)
On DragonFly mmap with MAP_STACK returns the top of the region, not
the bottom. Rather than try to cope, just don't use the flag anywhere.

Fixes #23061

Change-Id: Ib5df4dd7c934b3efecfc4bc87f8989b4c37555d7
Reviewed-on: https://go-review.googlesource.com/83035
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/testdata/testprogcgo/sigstack.go

index e30a5592dcb718edccc5cfb7af3612d8bdf4c5e1..492dfeff7f5628c02f462e9e223de1b134cc08b6 100644 (file)
@@ -17,15 +17,11 @@ package main
 #include <stdlib.h>
 #include <sys/mman.h>
 
-#ifndef MAP_STACK
-#define MAP_STACK 0
-#endif
-
 extern void SigStackCallback();
 
 static void* WithSigStack(void* arg __attribute__((unused))) {
        // Set up an alternate system stack.
-       void* base = mmap(0, SIGSTKSZ, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON|MAP_STACK, -1, 0);
+       void* base = mmap(0, SIGSTKSZ, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0);
        if (base == MAP_FAILED) {
                perror("mmap failed");
                abort();