Re: [PATCH v1] perf pmu: Ensure all alias variables are initialized

From: Namhyung Kim
Date: Sun Sep 17 2023 - 01:28:23 EST


On Wed, Sep 13, 2023 at 7:24 PM Ian Rogers <irogers@xxxxxxxxxx> wrote:
>
> Fix an error detected by memory sanitizer:
> ```
> ==4033==WARNING: MemorySanitizer: use-of-uninitialized-value
> #0 0x55fb0fbedfc7 in read_alias_info tools/perf/util/pmu.c:457:6
> #1 0x55fb0fbea339 in check_info_data tools/perf/util/pmu.c:1434:2
> #2 0x55fb0fbea339 in perf_pmu__check_alias tools/perf/util/pmu.c:1504:9
> #3 0x55fb0fbdca85 in parse_events_add_pmu tools/perf/util/parse-events.c:1429:32
> #4 0x55fb0f965230 in parse_events_parse tools/perf/util/parse-events.y:299:6
> #5 0x55fb0fbdf6b2 in parse_events__scanner tools/perf/util/parse-events.c:1822:8
> #6 0x55fb0fbdf8c1 in __parse_events tools/perf/util/parse-events.c:2094:8
> #7 0x55fb0fa8ffa9 in parse_events tools/perf/util/parse-events.h:41:9
> #8 0x55fb0fa8ffa9 in test_event tools/perf/tests/parse-events.c:2393:8
> #9 0x55fb0fa8f458 in test__pmu_events tools/perf/tests/parse-events.c:2551:15
> #10 0x55fb0fa6d93f in run_test tools/perf/tests/builtin-test.c:242:9
> #11 0x55fb0fa6d93f in test_and_print tools/perf/tests/builtin-test.c:271:8
> #12 0x55fb0fa6d082 in __cmd_test tools/perf/tests/builtin-test.c:442:5
> #13 0x55fb0fa6d082 in cmd_test tools/perf/tests/builtin-test.c:564:9
> #14 0x55fb0f942720 in run_builtin tools/perf/perf.c:322:11
> #15 0x55fb0f942486 in handle_internal_command tools/perf/perf.c:375:8
> #16 0x55fb0f941dab in run_argv tools/perf/perf.c:419:2
> #17 0x55fb0f941dab in main tools/perf/perf.c:535:3
> ```
>
> Fixes: 7b723dbb96e8 ("perf pmu: Be lazy about loading event info files
> from sysfs")
>
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>

Applied to perf-tools, thanks!

Namhyung