Messages in this thread | | | Date | Sun, 25 Sep 2022 09:08:39 +0800 | From | Leo Yan <> | Subject | Re: [PATCH 1/4] perf record: Fix a segfault in record__read_lost_samples() |
| |
On Fri, Sep 23, 2022 at 10:31:39AM -0700, Namhyung Kim wrote: > When it fails to open events record__open() returns without setting the > session->evlist. Then it gets a segfault in the function trying to read > lost sample counts. You can easily reproduce it as a normal user like: > > $ perf record -p 1 true > ... > perf: Segmentation fault > ... > > Skip the function if it has no evlist. And add more protection for evsels > which are not properly initialized. > > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Leo Yan <leo.yan@linaro.org>
| |