Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#64522 - [perf] trace segfault

Attached to Project: Arch Linux
Opened by Santiago Pastorino (spastorino) - Friday, 15 November 2019, 21:09 GMT
Last edited by Sébastien Luttringer (seblu) - Saturday, 25 April 2020, 15:06 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Sébastien Luttringer (seblu)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I'm getting a segfault when running perf trace.

```
perf: Segmentation fault
Obtained 10 stack frames.
perf(+0x2ce253) [0x55693870b253]
/usr/lib/libc.so.6(+0x3bfaf) [0x7fa780ae6faf]
/usr/lib/libc.so.6(+0x1c0a40) [0x7fa780c6ba40]
perf(+0x247e21) [0x556938684e21]
perf(+0x2451ab) [0x5569386821ab]
perf(+0x24e7db) [0x55693868b7db]
perf(+0x27d042) [0x5569386ba042]
perf(+0x1f92fb) [0x5569386362fb]
/usr/lib/libc.so.6(__libc_start_main+0xf2) [0x7fa780ad2152]
perf(+0x1f955d) [0x55693863655d]
Segmentation fault
```

Backtrace ...

```
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007fdbb2615a40 in main_arena () from /usr/lib/libc.so.6
(gdb) bt
#0 0x00007fdbb2615a40 in main_arena () from /usr/lib/libc.so.6
#1 0x0000562fc44e22d7 in syscall__scnprintf_val (sc=0x562fc50cc4a0, val=6, arg=0x7ffd10440870, size=2021, bf=0x562fc52b722b "") at builtin-trace.c:1649
#2 syscall__scnprintf_args (sc=sc@entry=0x562fc50cc4a0, bf=0x562fc52b721b "fd: 223, level: ", size=2037, args=args@entry=0x7fdbb21a118c <error: Cannot access memory at address 0x7fdbb21a118c>, augmented_args=augmented_args@entry=0x0,
augmented_args_size=augmented_args_size@entry=0, trace=0x7ffd10440fa0, thread=0x562fc51da000) at builtin-trace.c:1716
#3 0x0000562fc44e3e22 in trace__sys_enter (trace=0x7ffd10440fa0, evsel=<optimized out>, event=<optimized out>, sample=0x7ffd10440990) at builtin-trace.c:1935
#4 0x0000562fc44e11ac in trace__handle_event (sample=0x7ffd10440990, event=0x7fdbb21a1140, trace=0x7ffd10440fa0) at builtin-trace.c:2645
#5 __trace__deliver_event (trace=trace@entry=0x7ffd10440fa0, event=0x7fdbb21a1140) at builtin-trace.c:2899
#6 0x0000562fc44ea7dc in trace__deliver_event (event=<optimized out>, trace=0x7ffd10440fa0) at builtin-trace.c:2926
#7 trace__run (argv=<optimized out>, argc=<optimized out>, trace=0x7ffd10440fa0) at builtin-trace.c:3124
#8 cmd_trace (argc=<optimized out>, argv=<optimized out>) at builtin-trace.c:4060
#9 0x0000562fc4519043 in run_builtin (p=0x562fc4a026c0 <commands+576>, argc=1, argv=0x7ffd10444560) at perf.c:304
#10 0x0000562fc44952fc in handle_internal_command (argv=<optimized out>, argc=<optimized out>) at perf.c:356
#11 run_argv (argcp=<optimized out>, argv=<optimized out>) at perf.c:400
#12 main (argc=1, argv=0x7ffd10444560) at perf.c:522
(gdb) quit
```

Perf version is 5.3-2
This task depends upon

Closed by  Sébastien Luttringer (seblu)
Saturday, 25 April 2020, 15:06 GMT
Reason for closing:  Upstream
Comment by Santiago Pastorino (spastorino) - Tuesday, 19 November 2019, 13:34 GMT
BTW, I've also reported this to LKML https://lkml.org/lkml/2019/11/18/407.
Comment by Santiago Pastorino (spastorino) - Wednesday, 22 April 2020, 20:08 GMT
  • Field changed: Percent Complete (100% → 0%)
This is not working for me since the day I've reported. @seblu, if it works for you maybe my installation is missing some package or something? in that case there may be a missing dependency?, can you try running perf trace again with today's packages updated to see if works and if it does, can I take in some way a list of the things you've installed so I can inspect?.
Comment by freswa (frederik) - Wednesday, 22 April 2020, 20:09 GMT
I can reproduce this with perf 5.6
Comment by Santiago Pastorino (spastorino) - Wednesday, 22 April 2020, 20:19 GMT
I guess it depends on some specific stuff about the process you are running perf trace on. See my valgrind run here https://lkml.org/lkml/2019/12/3/414, and btw, this is not working since 5.3 but with perf version 5.6.g7111951b8d49 is not working either. For instance if I do "perf trace ls" I don't get this segfault.
Comment by Sébastien Luttringer (seblu) - Saturday, 25 April 2020, 15:05 GMT
I agree, this requires well knowledge of the software and should be troubleshooted upstream.

Loading...