From 295a4d8e6433e8a8b6df25375fb780b0f75ff4e6 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sat, 22 Dec 2012 15:06:28 -0500 Subject: runtime: ignore failure from madvise When we release memory to the OS, if the OS doesn't want us to release it (for example, because the program executed mlockall(MCL_FUTURE)), madvise will fail. Ignore the failure instead of crashing. Fixes #3435. R=ken2 CC=golang-dev https://golang.org/cl/6998052 --- src/pkg/runtime/sys_linux_amd64.s | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/pkg/runtime/sys_linux_amd64.s') diff --git a/src/pkg/runtime/sys_linux_amd64.s b/src/pkg/runtime/sys_linux_amd64.s index 3f7a207f37..e459437582 100644 --- a/src/pkg/runtime/sys_linux_amd64.s +++ b/src/pkg/runtime/sys_linux_amd64.s @@ -250,9 +250,7 @@ TEXT runtime·madvise(SB),7,$0 MOVQ 24(SP), DX MOVQ $28, AX // madvise SYSCALL - CMPQ AX, $0xfffffffffffff001 - JLS 2(PC) - MOVL $0xf1, 0xf1 // crash + // ignore failure - maybe pages are locked RET // int64 futex(int32 *uaddr, int32 op, int32 val, -- cgit v1.3