Skip to content

Commit 29cb57c

Browse files
ianlancetaylorbradfitz
authored andcommitted
runtime: don't use MAP_STACK in SigStack test
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-by: Austin Clements <[email protected]>
1 parent 840fad1 commit 29cb57c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/runtime/testdata/testprogcgo/sigstack.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,11 @@ package main
1717
#include <stdlib.h>
1818
#include <sys/mman.h>
1919
20-
#ifndef MAP_STACK
21-
#define MAP_STACK 0
22-
#endif
23-
2420
extern void SigStackCallback();
2521
2622
static void* WithSigStack(void* arg __attribute__((unused))) {
2723
// Set up an alternate system stack.
28-
void* base = mmap(0, SIGSTKSZ, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON|MAP_STACK, -1, 0);
24+
void* base = mmap(0, SIGSTKSZ, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0);
2925
if (base == MAP_FAILED) {
3026
perror("mmap failed");
3127
abort();

0 commit comments

Comments
 (0)