From 3648aa5bf6e29bf618195c615ff2ced4bb995327 Mon Sep 17 00:00:00 2001 From: Pingfan Liu Date: Tue, 5 Nov 2019 16:25:33 +0800 Subject: [PATCH] shm: exit when ftruncate() fails numa_police_memory() accesses the mapping region, which size is shmlen. If the shared file can not be extended to shmlen, then SIGBUS will be triggered. Instead exit() is more graceful. Signed-off-by: Pingfan Liu --- shm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shm.c b/shm.c index fb592ed..79043c9 100644 --- a/shm.c +++ b/shm.c @@ -151,6 +151,7 @@ void attach_shared(char *name, char *opt) would be impossible to apply policy then. need to fix that in the kernel. */ perror("ftruncate"); + exit(1); } }