summaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2019-09-25 12:59:24 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-09-27 09:26:14 -0300
commite3e2cf3d5b1fe800b032e14c0fdcd9a6fb20cf3b (patch)
tree34e170583b1cc56f51ac08120b5f6adeb6d43b8d /mm/memcontrol.c
parent4b0b2b096da9d296e0e5668cdfba8613bd6f5bc8 (diff)
downloadlinux-e3e2cf3d5b1fe800b032e14c0fdcd9a6fb20cf3b.tar.gz
linux-e3e2cf3d5b1fe800b032e14c0fdcd9a6fb20cf3b.tar.bz2
linux-e3e2cf3d5b1fe800b032e14c0fdcd9a6fb20cf3b.zip
perf tests: Avoid raising SEGV using an obvious NULL dereference
An optimized build such as: make -C tools/perf CLANG=1 CC=clang EXTRA_CFLAGS="-O3 will turn the dereference operation into a ud2 instruction, raising a SIGILL rather than a SIGSEGV. Use raise(..) for correctness and clarity. Similar issues were addressed in Numfor Mbiziwo-Tiapo's patch: https://lkml.org/lkml/2019/7/8/1234 Committer testing: Before: [root@quaco ~]# perf test hooks 55: perf hooks : Ok [root@quaco ~]# perf test -v hooks 55: perf hooks : --- start --- test child forked, pid 17092 SIGSEGV is observed as expected, try to recover. Fatal error (SEGFAULT) in perf hook 'test' test child finished with 0 ---- end ---- perf hooks: Ok [root@quaco ~]# After: [root@quaco ~]# perf test hooks 55: perf hooks : Ok [root@quaco ~]# perf test -v hooks 55: perf hooks : --- start --- test child forked, pid 17909 SIGSEGV is observed as expected, try to recover. Fatal error (SEGFAULT) in perf hook 'test' test child finished with 0 ---- end ---- perf hooks: Ok [root@quaco ~]# Fixes: a074865e60ed ("perf tools: Introduce perf hooks") Signed-off-by: Ian Rogers <irogers@google.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lore.kernel.org/lkml/20190925195924.152834-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'mm/memcontrol.c')
0 files changed, 0 insertions, 0 deletions