Bug ID 1180610
Summary perf does not load symbols from libantlr4
Classification openSUSE
Product openSUSE Tumbleweed
Version Current
Hardware Other
OS Other
Status NEW
Severity Normal
Priority P5 - None
Component Development
Assignee screening-team-bugs@suse.de
Reporter jslaby@suse.com
QA Contact qa-bugs@suse.de
CC mliska@suse.cz
Found By ---
Blocker ---

1) install libantlr4-runtime-devel and perf.
2) 

3) cat > main.cpp <<EOF
#include <cstdio>
#include <antlr4-runtime.h>

int main()
{
        for (int a = 0; a < 10000000; a++)
                antlr4::ANTLRInputStream input("/dev/null");
}
EOF

4) cat > Makefile <<EOF
CXXFLAGS=-g -Wall -I/usr/include/antlr4-runtime -Wno-attributes -mfentry
LDLIBS=-lantlr4-runtime

all: main
EOF

5) make && perf record -g ./main

6) perf report -g

7) symbols of antlr library are shown in hexa (not resolved), despite debuginfo
is installed

Perf fails here:
https://github.com/torvalds/linux/blob/9f1abbe97c08ba7ed609791627533a805a1b2c66/tools/perf/util/symbol-elf.c#L1229

It walks through all symbols in .symtab of:
/usr/lib/debug/usr/lib64/libantlr4-runtime.so.4.8-4.8-1.4.x86_64.debug

and resolves the symbol addresses into names there. First, it obtains the
section a symbol is in -- sym.st_shndx (like 13th for .text, 25th for .data,
...) from:
/usr/lib64/libantlr4-runtime.so.4.8
(i.e. not the .debug). And then it uses the section header to eliminate ASLR.

But there are also symbols like these:
 10305: 0000000000955fa4     0 NOTYPE  LOCAL  DEFAULT   29
Predicate.cpp.2bc410e7

There is no section 29 in libantlr4-runtime.so.4.8, it's only in
libantlr4-runtime.so.4.8-4.8-1.4.x86_64.debug (it's .debuginfo there).

Now, I don't know whose bug is this. Is it perf or the dwarf separator in rpm?

BTW are the section numbers supposed to be the same in both elfs?


You are receiving this mail because: