| Summary: | below main misses some "optimizations" | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | Mark Wielaard <mark> |
| Component: | massif | Assignee: | Nicholas Nethercote <njn> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
commit 24a94df7386ce4de56a9779bbb5a3214d20067af Author: Mark Wielaard <mark@klomp.org> Date: Mon Mar 1 00:26:00 2021 +0100 VG_(get_fnname_kind): Recognize gcc "optimized" below main functions. The VG_(get_fnname_kind) function detects some special "below main" function names. Specifically __libc_start_main and generic_start_main both of which are used to call the actual main () function from the application. We already recognized one variant, generic_start_main.isra.0, but only for powerpc. Recognize all possibly specialed optimized variants gcc can produce by simply checking for the function name with dot as prefix. This fixes the memcheck/tests/supp_unknown.vgtest and massif/tests/deep-D.vgtest with gcc 11. We can now also get rid of the special cases in massif/tests/deep-D.post.exp-ppc64 and memcheck/tests/supp_unknown.supp. https://bugs.kde.org/show_bug.cgi?id=430158 |
gcc can do a couple more optimizations for generic_start_main, like generic_start_main.isra.0 or generic_start_main.constprop.0.isra.0. For ppc we already recognize generic_start_main.isra.0, but nothing else. It would probably be good to recognize any optimization in get_fnname_kind like so: # if defined(VGO_linux) VG_STREQ("__libc_start_main", name) || // glibc glibness VG_STREQ("generic_start_main", name) || // Yellow Dog doggedness VG_STREQN(19, "generic_start_main.", name) || // gcc optimization # elif defined(VGO_darwin) This fixes ./massif/tests/deep-D.vgtest on same setups, and we could then get rid of ./massif/tests/deep-D.post.diff-ppc64