linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* perf buildild-list -H dumps core
@ 2017-10-13  7:33 Thomas-Mich Richter
  2017-10-13 14:48 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas-Mich Richter @ 2017-10-13  7:33 UTC (permalink / raw)
  To: linux-perf-use.; +Cc: Hendrik Brueckner

Maybe this has been fixed already, but I hit a core dump when I do this:

[root@s35lp76 docker]# uname -a
Linux s35lp76 4.14.0-rc3tmr1+ #5 SMP Thu Oct 5 10:05:43 CEST 2017 s390x s390x s390x GNU/Linux
[root@s35lp76 docker]# ~/linux/tools/perf/perf buildid-list -i 333.perf.data 
15dd27179a5fe664c0778b7871989c101b1ac506 /lib/modules/4.14.0-rc3tmr1+/build/vmlinux
4d16d00bd6ed5969f2ef3176d3e52801c85ed9d8 [vdso]
0a751d08365dbbca4ac4deb7ed2b8107d42bad80 /lib/libc.so.6
5c0a120336206d0483d3d8112207fbb54ba00a44 /bin/find
a70676b1cdcc5575e4c5e34a5b80746dca120f75 /bin/ls
[root@s35lp76 docker]# ~/linux/tools/perf/perf buildid-list -H -i 333.perf.data 
Segmentation fault (core dumped)

[root@s35lp76 docker]# 

Shouldn't I specify option -H ?

I have not tried this on Intel, maybe it is platform related?

Thanks for your help
-- 
Thomas Richter, Dept 3303, IBM LTC Boeblingen Germany
--
Vorsitzende des Aufsichtsrats: Martina Koederitz 
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: perf buildild-list -H dumps core
  2017-10-13  7:33 perf buildild-list -H dumps core Thomas-Mich Richter
@ 2017-10-13 14:48 ` Arnaldo Carvalho de Melo
  2017-10-16  6:52   ` Thomas-Mich Richter
  2017-10-16  7:00   ` perf buildild-list -H dumps core Thomas-Mich Richter
  0 siblings, 2 replies; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-10-13 14:48 UTC (permalink / raw)
  To: Thomas-Mich Richter; +Cc: linux-perf-use., Hendrik Brueckner

Em Fri, Oct 13, 2017 at 09:33:55AM +0200, Thomas-Mich Richter escreveu:
> Maybe this has been fixed already, but I hit a core dump when I do this:
> 
> [root@s35lp76 docker]# uname -a
> Linux s35lp76 4.14.0-rc3tmr1+ #5 SMP Thu Oct 5 10:05:43 CEST 2017 s390x s390x s390x GNU/Linux
> [root@s35lp76 docker]# ~/linux/tools/perf/perf buildid-list -i 333.perf.data 
> 15dd27179a5fe664c0778b7871989c101b1ac506 /lib/modules/4.14.0-rc3tmr1+/build/vmlinux
> 4d16d00bd6ed5969f2ef3176d3e52801c85ed9d8 [vdso]
> 0a751d08365dbbca4ac4deb7ed2b8107d42bad80 /lib/libc.so.6
> 5c0a120336206d0483d3d8112207fbb54ba00a44 /bin/find
> a70676b1cdcc5575e4c5e34a5b80746dca120f75 /bin/ls
> [root@s35lp76 docker]# ~/linux/tools/perf/perf buildid-list -H -i 333.perf.data 
> Segmentation fault (core dumped)
> 
> [root@s35lp76 docker]# 
> 
> Shouldn't I specify option -H ?
> 
> I have not tried this on Intel, maybe it is platform related?
> 
> Thanks for your help

Can you please provide a backtrace? I just tried it here and couldn't
reproduce.

[root@jouet ~]# perf record -a sleep 2
[ perf record: Woken up 5 times to write data ]
[ perf record: Captured and wrote 3.654 MB perf.data (32078 samples) ]
[root@jouet ~]# perf buildid-list -H > /tmp/bla
[root@jouet ~]# head /tmp/bla
7b2520cbe38483a64f3f6c83e88543222a92a4d8 /proc/kcore
8678a8baa7adb62301351bbe6ec0411431b6c239 /usr/lib64/libz.so.1.2.11
feccaee0beafed7718f53b96fa88c57ec421256b /usr/lib64/libdl-2.25.so
f045f54aa78cf1931cc893f78b6cbc52c72a8cb1 /usr/lib64/libc-2.25.so
9059cd82d902243e5a2ad834bd83f4b21d0215ac /usr/lib64/libpthread-2.25.so
594c9c58b36cc894bf96e631cce3c4f588a53ca7 /usr/lib64/ld-2.25.so
1308b8e1e2aba6a1a9ac9d4a00c16f657c9ba21a [vdso]
93a5e75faa96b2fe55ced8e3abca4a9ed45636d7 /usr/lib64/libdbus-1.so.3.19.0
c163d82c56b2bb68d4c6d83f2d1c191bfc14e9e8 /usr/lib64/libffi.so.6.0.2
0b43611288742c9c62d4571aba4f0848e15a9d4c /usr/lib64/libglib-2.0.so.0.5200.3
[root@jouet ~]# uname -a
Linux jouet 4.13.0+ #3 SMP Mon Sep 25 11:51:22 -03 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@jouet ~]# perf --version
perf version 4.14.rc3.g4d748d
[root@jouet ~]#

- Arnaldo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: perf buildild-list -H dumps core
  2017-10-13 14:48 ` Arnaldo Carvalho de Melo
@ 2017-10-16  6:52   ` Thomas-Mich Richter
  2017-10-17  0:28     ` Namhyung Kim
  2017-10-16  7:00   ` perf buildild-list -H dumps core Thomas-Mich Richter
  1 sibling, 1 reply; 10+ messages in thread
From: Thomas-Mich Richter @ 2017-10-16  6:52 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-perf-use., Hendrik Brueckner

On 10/13/2017 04:48 PM, Arnaldo Carvalho de Melo wrote:

Here is the load of perf using gdb:

 

[root@s35lp76 core-dump-buildid]# gdb ~/linux/tools/perf/perf
GNU gdb (GDB) Fedora 7.12.1-48.fc25
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "s390x-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /root/linux/tools/perf/perf...done.



This is the command:
(gdb) r buildid-list -H 
Starting program: /root/linux/tools/perf/perf buildid-list -H
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Detaching after fork from child process 249033.

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
Missing separate debuginfos, use: dnf debuginfo-install audit-libs-2.7.7-1.fc25.s390x bzip2-libs-1.0.6-21.fc25.s390x elfutils-libelf-0.169-1.fc25.s390x elfutils-libs-0.169-1.fc25.s390x libcap-ng-0.7.8-1.fc25.s390x numactl-libs-2.0.11-2.ibm.fc25.s390x openssl-libs-1.1.0e-1.1.ibm.fc25.s390x perl-libs-5.24.1-386.fc25.s390x python-libs-2.7.13-2.fc25.s390x slang-2.3.0-7.fc25.s390x xz-libs-5.2.3-2.fc25.s390x zlib-1.2.8-10.fc25.s390x
(gdb) where
#0  0x0000000000000000 in ?? ()
#1  0x00000000010fad6a in machines__deliver_event (machines=<optimized out>, machines@entry=0x2c6fd18, 
    evlist=<optimized out>, event=event@entry=0x3fffdf00470, sample=0x3ffffffe880, sample@entry=0x3ffffffe888, 
    tool=tool@entry=0x1312968 <build_id.mark_dso_hit_ops>, file_offset=1136) at util/session.c:1287
#2  0x00000000010fbf4e in perf_session__deliver_event (file_offset=1136, tool=0x1312968 <build_id.mark_dso_hit_ops>, 
    sample=0x3ffffffe888, event=0x3fffdf00470, session=0x2c6fc30) at util/session.c:1340
#3  perf_session__process_event (session=0x2c6fc30, session@entry=0x0, event=event@entry=0x3fffdf00470, 
    file_offset=file_offset@entry=1136) at util/session.c:1522
#4  0x00000000010fddde in __perf_session__process_events (file_size=11880, data_size=<optimized out>, 
    data_offset=<optimized out>, session=0x0) at util/session.c:1899
#5  perf_session__process_events (session=0x0, session@entry=0x2c6fc30) at util/session.c:1953
#6  0x000000000103b2ac in perf_session__list_build_ids (with_hits=<optimized out>, force=<optimized out>)
    at builtin-buildid-list.c:83
#7  cmd_buildid_list (argc=<optimized out>, argv=<optimized out>) at builtin-buildid-list.c:115
#8  0x00000000010a026c in run_builtin (p=0x1311f78 <commands+24>, argc=argc@entry=2, argv=argv@entry=0x3fffffff3c0)
    at perf.c:296
#9  0x000000000102bc00 in handle_internal_command (argv=<optimized out>, argc=2) at perf.c:348
#10 run_argv (argcp=<synthetic pointer>, argv=<synthetic pointer>) at perf.c:392
#11 main (argc=<optimized out>, argv=0x3fffffff3c0) at perf.c:536
(gdb) 


Hope this helps.
-- 
Thomas Richter, Dept 3303, IBM LTC Boeblingen Germany
--
Vorsitzende des Aufsichtsrats: Martina Koederitz 
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: perf buildild-list -H dumps core
  2017-10-13 14:48 ` Arnaldo Carvalho de Melo
  2017-10-16  6:52   ` Thomas-Mich Richter
@ 2017-10-16  7:00   ` Thomas-Mich Richter
  1 sibling, 0 replies; 10+ messages in thread
From: Thomas-Mich Richter @ 2017-10-16  7:00 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-perf-use., Hendrik Brueckner

On 10/13/2017 04:48 PM, Arnaldo Carvalho de Melo wrote:
> Em Fri, Oct 13, 2017 at 09:33:55AM +0200, Thomas-Mich Richter escreveu:
>> Maybe this has been fixed already, but I hit a core dump when I do this:
>>
>> [root@s35lp76 docker]# uname -a
>> Linux s35lp76 4.14.0-rc3tmr1+ #5 SMP Thu Oct 5 10:05:43 CEST 2017 s390x s390x s390x GNU/Linux
>> [root@s35lp76 docker]# ~/linux/tools/perf/perf buildid-list -i 333.perf.data 
>> 15dd27179a5fe664c0778b7871989c101b1ac506 /lib/modules/4.14.0-rc3tmr1+/build/vmlinux
>> 4d16d00bd6ed5969f2ef3176d3e52801c85ed9d8 [vdso]
>> 0a751d08365dbbca4ac4deb7ed2b8107d42bad80 /lib/libc.so.6
>> 5c0a120336206d0483d3d8112207fbb54ba00a44 /bin/find
>> a70676b1cdcc5575e4c5e34a5b80746dca120f75 /bin/ls
>> [root@s35lp76 docker]# ~/linux/tools/perf/perf buildid-list -H -i 333.perf.data 
>> Segmentation fault (core dumped)
>>
>> [root@s35lp76 docker]# 
>>
>> Shouldn't I specify option -H ?
>>
>> I have not tried this on Intel, maybe it is platform related?
>>
>> Thanks for your help
> 
> Can you please provide a backtrace? I just tried it here and couldn't
> reproduce.
> 

Here is a simple way to reproduce it:

[root@s35lp76 perf]# ./perf record --namespace -a sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.184 MB perf.data (4 samples) ]
[root@s35lp76 perf]# ./perf buildid-list -H
Segmentation fault (core dumped)
[root@s35lp76 perf]# ./perf record  -a sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.147 MB perf.data (5 samples) ]
[root@s35lp76 perf]# ./perf buildid-list -H
15dd27179a5fe664c0778b7871989c101b1ac506 [kernel.kallsyms]
[root@s35lp76 perf]# 

Hope this helps.

-- 
Thomas Richter, Dept 3303, IBM LTC Boeblingen Germany
--
Vorsitzende des Aufsichtsrats: Martina Koederitz 
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: perf buildild-list -H dumps core
  2017-10-16  6:52   ` Thomas-Mich Richter
@ 2017-10-17  0:28     ` Namhyung Kim
  2017-10-17  6:15       ` Thomas-Mich Richter
  2017-10-17 12:01       ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 10+ messages in thread
From: Namhyung Kim @ 2017-10-17  0:28 UTC (permalink / raw)
  To: Thomas-Mich Richter
  Cc: Arnaldo Carvalho de Melo, linux-perf-use., Hendrik Brueckner,
	kernel-team

Hello,

On Mon, Oct 16, 2017 at 08:52:27AM +0200, Thomas-Mich Richter wrote:
> On 10/13/2017 04:48 PM, Arnaldo Carvalho de Melo wrote:
> 
> Here is the load of perf using gdb:
> 
>  
> 
> [root@s35lp76 core-dump-buildid]# gdb ~/linux/tools/perf/perf
> GNU gdb (GDB) Fedora 7.12.1-48.fc25
> Copyright (C) 2017 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "s390x-redhat-linux-gnu".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from /root/linux/tools/perf/perf...done.
> 
> 
> 
> This is the command:
> (gdb) r buildid-list -H 
> Starting program: /root/linux/tools/perf/perf buildid-list -H
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib64/libthread_db.so.1".
> Detaching after fork from child process 249033.
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x0000000000000000 in ?? ()
> Missing separate debuginfos, use: dnf debuginfo-install audit-libs-2.7.7-1.fc25.s390x bzip2-libs-1.0.6-21.fc25.s390x elfutils-libelf-0.169-1.fc25.s390x elfutils-libs-0.169-1.fc25.s390x libcap-ng-0.7.8-1.fc25.s390x numactl-libs-2.0.11-2.ibm.fc25.s390x openssl-libs-1.1.0e-1.1.ibm.fc25.s390x perl-libs-5.24.1-386.fc25.s390x python-libs-2.7.13-2.fc25.s390x slang-2.3.0-7.fc25.s390x xz-libs-5.2.3-2.fc25.s390x zlib-1.2.8-10.fc25.s390x
> (gdb) where
> #0  0x0000000000000000 in ?? ()
> #1  0x00000000010fad6a in machines__deliver_event (machines=<optimized out>, machines@entry=0x2c6fd18, 
>     evlist=<optimized out>, event=event@entry=0x3fffdf00470, sample=0x3ffffffe880, sample@entry=0x3ffffffe888, 
>     tool=tool@entry=0x1312968 <build_id.mark_dso_hit_ops>, file_offset=1136) at util/session.c:1287
> #2  0x00000000010fbf4e in perf_session__deliver_event (file_offset=1136, tool=0x1312968 <build_id.mark_dso_hit_ops>, 
>     sample=0x3ffffffe888, event=0x3fffdf00470, session=0x2c6fc30) at util/session.c:1340
> #3  perf_session__process_event (session=0x2c6fc30, session@entry=0x0, event=event@entry=0x3fffdf00470, 
>     file_offset=file_offset@entry=1136) at util/session.c:1522
> #4  0x00000000010fddde in __perf_session__process_events (file_size=11880, data_size=<optimized out>, 
>     data_offset=<optimized out>, session=0x0) at util/session.c:1899
> #5  perf_session__process_events (session=0x0, session@entry=0x2c6fc30) at util/session.c:1953
> #6  0x000000000103b2ac in perf_session__list_build_ids (with_hits=<optimized out>, force=<optimized out>)
>     at builtin-buildid-list.c:83
> #7  cmd_buildid_list (argc=<optimized out>, argv=<optimized out>) at builtin-buildid-list.c:115
> #8  0x00000000010a026c in run_builtin (p=0x1311f78 <commands+24>, argc=argc@entry=2, argv=argv@entry=0x3fffffff3c0)
>     at perf.c:296
> #9  0x000000000102bc00 in handle_internal_command (argv=<optimized out>, argc=2) at perf.c:348
> #10 run_argv (argcp=<synthetic pointer>, argv=<synthetic pointer>) at perf.c:392
> #11 main (argc=<optimized out>, argv=0x3fffffff3c0) at perf.c:536
> (gdb) 

Looks like due to a NULL namespace event handler.  Does patch below
fix it?

Thanks,
Namhyung


diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index ceac0848469d..b3fd62f7e4c9 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -374,6 +374,8 @@ void perf_tool__fill_defaults(struct perf_tool *tool)
                tool->mmap2 = process_event_stub;
        if (tool->comm == NULL)
                tool->comm = process_event_stub;
+       if (tool->namespaces == NULL)
+               tool->namespaces = process_event_stub;
        if (tool->fork == NULL)
                tool->fork = process_event_stub;
        if (tool->exit == NULL)

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: perf buildild-list -H dumps core
  2017-10-17  0:28     ` Namhyung Kim
@ 2017-10-17  6:15       ` Thomas-Mich Richter
  2017-10-17 12:01       ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 10+ messages in thread
From: Thomas-Mich Richter @ 2017-10-17  6:15 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Arnaldo Carvalho de Melo, linux-perf-use., Hendrik Brueckner,
	kernel-team

On 10/17/2017 02:28 AM, Namhyung Kim wrote:

[...]

> 
> Looks like due to a NULL namespace event handler.  Does patch below
> fix it?
> 
> Thanks,
> Namhyung

Thanks for the fix, it solves the issue.
 
> 
> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
> index ceac0848469d..b3fd62f7e4c9 100644
> --- a/tools/perf/util/session.c
> +++ b/tools/perf/util/session.c
> @@ -374,6 +374,8 @@ void perf_tool__fill_defaults(struct perf_tool *tool)
>                 tool->mmap2 = process_event_stub;
>         if (tool->comm == NULL)
>                 tool->comm = process_event_stub;
> +       if (tool->namespaces == NULL)
> +               tool->namespaces = process_event_stub;
>         if (tool->fork == NULL)
>                 tool->fork = process_event_stub;
>         if (tool->exit == NULL;

-- 
Thomas Richter, Dept 3303, IBM LTC Boeblingen Germany
--
Vorsitzende des Aufsichtsrats: Martina Koederitz 
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: perf buildild-list -H dumps core
  2017-10-17  0:28     ` Namhyung Kim
  2017-10-17  6:15       ` Thomas-Mich Richter
@ 2017-10-17 12:01       ` Arnaldo Carvalho de Melo
  2017-10-17 13:29         ` [PATCH] perf tools: Fix crash on buildid-list with namespace Namhyung Kim
  1 sibling, 1 reply; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-10-17 12:01 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Thomas-Mich Richter, linux-perf-use., Hendrik Brueckner,
	kernel-team

Em Tue, Oct 17, 2017 at 09:28:31AM +0900, Namhyung Kim escreveu:
> Hello,
> 
> On Mon, Oct 16, 2017 at 08:52:27AM +0200, Thomas-Mich Richter wrote:
> > On 10/13/2017 04:48 PM, Arnaldo Carvalho de Melo wrote:
> > 
> > Here is the load of perf using gdb:
> > 
> >  
> > 
> > [root@s35lp76 core-dump-buildid]# gdb ~/linux/tools/perf/perf
> > GNU gdb (GDB) Fedora 7.12.1-48.fc25
> > Copyright (C) 2017 Free Software Foundation, Inc.
> > License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> > This is free software: you are free to change and redistribute it.
> > There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> > and "show warranty" for details.
> > This GDB was configured as "s390x-redhat-linux-gnu".
> > Type "show configuration" for configuration details.
> > For bug reporting instructions, please see:
> > <http://www.gnu.org/software/gdb/bugs/>.
> > Find the GDB manual and other documentation resources online at:
> > <http://www.gnu.org/software/gdb/documentation/>.
> > For help, type "help".
> > Type "apropos word" to search for commands related to "word"...
> > Reading symbols from /root/linux/tools/perf/perf...done.
> > 
> > 
> > 
> > This is the command:
> > (gdb) r buildid-list -H 
> > Starting program: /root/linux/tools/perf/perf buildid-list -H
> > [Thread debugging using libthread_db enabled]
> > Using host libthread_db library "/lib64/libthread_db.so.1".
> > Detaching after fork from child process 249033.
> > 
> > Program received signal SIGSEGV, Segmentation fault.
> > 0x0000000000000000 in ?? ()
> > Missing separate debuginfos, use: dnf debuginfo-install audit-libs-2.7.7-1.fc25.s390x bzip2-libs-1.0.6-21.fc25.s390x elfutils-libelf-0.169-1.fc25.s390x elfutils-libs-0.169-1.fc25.s390x libcap-ng-0.7.8-1.fc25.s390x numactl-libs-2.0.11-2.ibm.fc25.s390x openssl-libs-1.1.0e-1.1.ibm.fc25.s390x perl-libs-5.24.1-386.fc25.s390x python-libs-2.7.13-2.fc25.s390x slang-2.3.0-7.fc25.s390x xz-libs-5.2.3-2.fc25.s390x zlib-1.2.8-10.fc25.s390x
> > (gdb) where
> > #0  0x0000000000000000 in ?? ()
> > #1  0x00000000010fad6a in machines__deliver_event (machines=<optimized out>, machines@entry=0x2c6fd18, 
> >     evlist=<optimized out>, event=event@entry=0x3fffdf00470, sample=0x3ffffffe880, sample@entry=0x3ffffffe888, 
> >     tool=tool@entry=0x1312968 <build_id.mark_dso_hit_ops>, file_offset=1136) at util/session.c:1287
> > #2  0x00000000010fbf4e in perf_session__deliver_event (file_offset=1136, tool=0x1312968 <build_id.mark_dso_hit_ops>, 
> >     sample=0x3ffffffe888, event=0x3fffdf00470, session=0x2c6fc30) at util/session.c:1340
> > #3  perf_session__process_event (session=0x2c6fc30, session@entry=0x0, event=event@entry=0x3fffdf00470, 
> >     file_offset=file_offset@entry=1136) at util/session.c:1522
> > #4  0x00000000010fddde in __perf_session__process_events (file_size=11880, data_size=<optimized out>, 
> >     data_offset=<optimized out>, session=0x0) at util/session.c:1899
> > #5  perf_session__process_events (session=0x0, session@entry=0x2c6fc30) at util/session.c:1953
> > #6  0x000000000103b2ac in perf_session__list_build_ids (with_hits=<optimized out>, force=<optimized out>)
> >     at builtin-buildid-list.c:83
> > #7  cmd_buildid_list (argc=<optimized out>, argv=<optimized out>) at builtin-buildid-list.c:115
> > #8  0x00000000010a026c in run_builtin (p=0x1311f78 <commands+24>, argc=argc@entry=2, argv=argv@entry=0x3fffffff3c0)
> >     at perf.c:296
> > #9  0x000000000102bc00 in handle_internal_command (argv=<optimized out>, argc=2) at perf.c:348
> > #10 run_argv (argcp=<synthetic pointer>, argv=<synthetic pointer>) at perf.c:392
> > #11 main (argc=<optimized out>, argv=0x3fffffff3c0) at perf.c:536
> > (gdb) 
> 
> Looks like due to a NULL namespace event handler.  Does patch below
> fix it?

Namhyung,

	Please resubmit with Thomas' Reported-and-Tested-by: tag, ok?
Hopefully I can put it together with the other fixes in today's
perf/urgent pull req to Ingo.

- Arnaldo
 
> Thanks,
> Namhyung
> 
> 
> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
> index ceac0848469d..b3fd62f7e4c9 100644
> --- a/tools/perf/util/session.c
> +++ b/tools/perf/util/session.c
> @@ -374,6 +374,8 @@ void perf_tool__fill_defaults(struct perf_tool *tool)
>                 tool->mmap2 = process_event_stub;
>         if (tool->comm == NULL)
>                 tool->comm = process_event_stub;
> +       if (tool->namespaces == NULL)
> +               tool->namespaces = process_event_stub;
>         if (tool->fork == NULL)
>                 tool->fork = process_event_stub;
>         if (tool->exit == NULL)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] perf tools: Fix crash on buildid-list with namespace
  2017-10-17 12:01       ` Arnaldo Carvalho de Melo
@ 2017-10-17 13:29         ` Namhyung Kim
  2017-10-17 14:05           ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 10+ messages in thread
From: Namhyung Kim @ 2017-10-17 13:29 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, Peter Zijlstra, Jiri Olsa, LKML, kernel-team,
	Thomas-Mich Richter, linux-perf-use., Hendrik Brueckner

Thomas reported that perf buildid-list gets a segfault due to NULL
pointer when he ran it on a data with namespace events.  It was because
the buildid_id__mark_dso_hit_ops lacks the namespace event handler and
perf_too__fill_default() didn't set it.

  Program received signal SIGSEGV, Segmentation fault.
  0x0000000000000000 in ?? ()
  Missing separate debuginfos, use: dnf debuginfo-install audit-libs-2.7.7-1.fc25.s390x bzip2-libs-1.0.6-21.fc25.s390x elfutils-libelf-0.169-1.fc25.s390x
  +elfutils-libs-0.169-1.fc25.s390x libcap-ng-0.7.8-1.fc25.s390x numactl-libs-2.0.11-2.ibm.fc25.s390x openssl-libs-1.1.0e-1.1.ibm.fc25.s390x perl-libs-5.24.1-386.fc25.s390x
  +python-libs-2.7.13-2.fc25.s390x slang-2.3.0-7.fc25.s390x xz-libs-5.2.3-2.fc25.s390x zlib-1.2.8-10.fc25.s390x
  (gdb) where
  #0  0x0000000000000000 in ?? ()
  #1  0x00000000010fad6a in machines__deliver_event (machines=<optimized out>, machines@entry=0x2c6fd18,
      evlist=<optimized out>, event=event@entry=0x3fffdf00470, sample=0x3ffffffe880, sample@entry=0x3ffffffe888,
      tool=tool@entry=0x1312968 <build_id.mark_dso_hit_ops>, file_offset=1136) at util/session.c:1287
  #2  0x00000000010fbf4e in perf_session__deliver_event (file_offset=1136, tool=0x1312968 <build_id.mark_dso_hit_ops>,
      sample=0x3ffffffe888, event=0x3fffdf00470, session=0x2c6fc30) at util/session.c:1340
  #3  perf_session__process_event (session=0x2c6fc30, session@entry=0x0, event=event@entry=0x3fffdf00470,
      file_offset=file_offset@entry=1136) at util/session.c:1522
  #4  0x00000000010fddde in __perf_session__process_events (file_size=11880, data_size=<optimized out>,
      data_offset=<optimized out>, session=0x0) at util/session.c:1899
  #5  perf_session__process_events (session=0x0, session@entry=0x2c6fc30) at util/session.c:1953
  #6  0x000000000103b2ac in perf_session__list_build_ids (with_hits=<optimized out>, force=<optimized out>)
      at builtin-buildid-list.c:83
  #7  cmd_buildid_list (argc=<optimized out>, argv=<optimized out>) at builtin-buildid-list.c:115
  #8  0x00000000010a026c in run_builtin (p=0x1311f78 <commands+24>, argc=argc@entry=2, argv=argv@entry=0x3fffffff3c0)
      at perf.c:296
  #9  0x000000000102bc00 in handle_internal_command (argv=<optimized out>, argc=2) at perf.c:348
  #10 run_argv (argcp=<synthetic pointer>, argv=<synthetic pointer>) at perf.c:392
  #11 main (argc=<optimized out>, argv=0x3fffffff3c0) at perf.c:536
  (gdb)

Fix it by adding a stub event handler for namespace event.

Reported-and-Tested-by: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/session.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index a7ebd9fe8e40..76ab0709a20c 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -374,6 +374,8 @@ void perf_tool__fill_defaults(struct perf_tool *tool)
 		tool->mmap2 = process_event_stub;
 	if (tool->comm == NULL)
 		tool->comm = process_event_stub;
+	if (tool->namespaces == NULL)
+		tool->namespaces = process_event_stub;
 	if (tool->fork == NULL)
 		tool->fork = process_event_stub;
 	if (tool->exit == NULL)
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] perf tools: Fix crash on buildid-list with namespace
  2017-10-17 13:29         ` [PATCH] perf tools: Fix crash on buildid-list with namespace Namhyung Kim
@ 2017-10-17 14:05           ` Arnaldo Carvalho de Melo
  2017-10-18  0:07             ` Namhyung Kim
  0 siblings, 1 reply; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-10-17 14:05 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Ingo Molnar, Peter Zijlstra, Jiri Olsa, LKML, kernel-team,
	Thomas-Mich Richter, linux-perf-use., Hendrik Brueckner,
	Hari Bathini

Em Tue, Oct 17, 2017 at 10:29:00PM +0900, Namhyung Kim escreveu:
> Thomas reported that perf buildid-list gets a segfault due to NULL
> pointer when he ran it on a data with namespace events.  It was because
> the buildid_id__mark_dso_hit_ops lacks the namespace event handler and
> perf_too__fill_default() didn't set it.

In these cases, next time I suggest you add a Fixes: tag, so that the
stable@kernel.org guys can automatically figure out which kernels need
this fix, in this case:

Fixes: f3b3614a284d ("perf tools: Add PERF_RECORD_NAMESPACES to include namespaces related info")

The script I have for this even adds this CC line:

Cc: Hari Bathini <hbathini@linux.vnet.ibm.com>

I'm adding it,

Thanks!

- Arnaldo
 
>   Program received signal SIGSEGV, Segmentation fault.
>   0x0000000000000000 in ?? ()
>   Missing separate debuginfos, use: dnf debuginfo-install audit-libs-2.7.7-1.fc25.s390x bzip2-libs-1.0.6-21.fc25.s390x elfutils-libelf-0.169-1.fc25.s390x
>   +elfutils-libs-0.169-1.fc25.s390x libcap-ng-0.7.8-1.fc25.s390x numactl-libs-2.0.11-2.ibm.fc25.s390x openssl-libs-1.1.0e-1.1.ibm.fc25.s390x perl-libs-5.24.1-386.fc25.s390x
>   +python-libs-2.7.13-2.fc25.s390x slang-2.3.0-7.fc25.s390x xz-libs-5.2.3-2.fc25.s390x zlib-1.2.8-10.fc25.s390x
>   (gdb) where
>   #0  0x0000000000000000 in ?? ()
>   #1  0x00000000010fad6a in machines__deliver_event (machines=<optimized out>, machines@entry=0x2c6fd18,
>       evlist=<optimized out>, event=event@entry=0x3fffdf00470, sample=0x3ffffffe880, sample@entry=0x3ffffffe888,
>       tool=tool@entry=0x1312968 <build_id.mark_dso_hit_ops>, file_offset=1136) at util/session.c:1287
>   #2  0x00000000010fbf4e in perf_session__deliver_event (file_offset=1136, tool=0x1312968 <build_id.mark_dso_hit_ops>,
>       sample=0x3ffffffe888, event=0x3fffdf00470, session=0x2c6fc30) at util/session.c:1340
>   #3  perf_session__process_event (session=0x2c6fc30, session@entry=0x0, event=event@entry=0x3fffdf00470,
>       file_offset=file_offset@entry=1136) at util/session.c:1522
>   #4  0x00000000010fddde in __perf_session__process_events (file_size=11880, data_size=<optimized out>,
>       data_offset=<optimized out>, session=0x0) at util/session.c:1899
>   #5  perf_session__process_events (session=0x0, session@entry=0x2c6fc30) at util/session.c:1953
>   #6  0x000000000103b2ac in perf_session__list_build_ids (with_hits=<optimized out>, force=<optimized out>)
>       at builtin-buildid-list.c:83
>   #7  cmd_buildid_list (argc=<optimized out>, argv=<optimized out>) at builtin-buildid-list.c:115
>   #8  0x00000000010a026c in run_builtin (p=0x1311f78 <commands+24>, argc=argc@entry=2, argv=argv@entry=0x3fffffff3c0)
>       at perf.c:296
>   #9  0x000000000102bc00 in handle_internal_command (argv=<optimized out>, argc=2) at perf.c:348
>   #10 run_argv (argcp=<synthetic pointer>, argv=<synthetic pointer>) at perf.c:392
>   #11 main (argc=<optimized out>, argv=0x3fffffff3c0) at perf.c:536
>   (gdb)
> 
> Fix it by adding a stub event handler for namespace event.
> 
> Reported-and-Tested-by: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/perf/util/session.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
> index a7ebd9fe8e40..76ab0709a20c 100644
> --- a/tools/perf/util/session.c
> +++ b/tools/perf/util/session.c
> @@ -374,6 +374,8 @@ void perf_tool__fill_defaults(struct perf_tool *tool)
>  		tool->mmap2 = process_event_stub;
>  	if (tool->comm == NULL)
>  		tool->comm = process_event_stub;
> +	if (tool->namespaces == NULL)
> +		tool->namespaces = process_event_stub;
>  	if (tool->fork == NULL)
>  		tool->fork = process_event_stub;
>  	if (tool->exit == NULL)
> -- 
> 2.14.2

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] perf tools: Fix crash on buildid-list with namespace
  2017-10-17 14:05           ` Arnaldo Carvalho de Melo
@ 2017-10-18  0:07             ` Namhyung Kim
  0 siblings, 0 replies; 10+ messages in thread
From: Namhyung Kim @ 2017-10-18  0:07 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, Peter Zijlstra, Jiri Olsa, LKML, kernel-team,
	Thomas-Mich Richter, linux-perf-use., Hendrik Brueckner,
	Hari Bathini

On Tue, Oct 17, 2017 at 11:05:55AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Oct 17, 2017 at 10:29:00PM +0900, Namhyung Kim escreveu:
> > Thomas reported that perf buildid-list gets a segfault due to NULL
> > pointer when he ran it on a data with namespace events.  It was because
> > the buildid_id__mark_dso_hit_ops lacks the namespace event handler and
> > perf_too__fill_default() didn't set it.
> 
> In these cases, next time I suggest you add a Fixes: tag, so that the
> stable@kernel.org guys can automatically figure out which kernels need
> this fix, in this case:
> 
> Fixes: f3b3614a284d ("perf tools: Add PERF_RECORD_NAMESPACES to include namespaces related info")

Ah right, will add next time.

> 
> The script I have for this even adds this CC line:
> 
> Cc: Hari Bathini <hbathini@linux.vnet.ibm.com>
> 
> I'm adding it,

Thanks,
Namhyung

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-10-18  0:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-13  7:33 perf buildild-list -H dumps core Thomas-Mich Richter
2017-10-13 14:48 ` Arnaldo Carvalho de Melo
2017-10-16  6:52   ` Thomas-Mich Richter
2017-10-17  0:28     ` Namhyung Kim
2017-10-17  6:15       ` Thomas-Mich Richter
2017-10-17 12:01       ` Arnaldo Carvalho de Melo
2017-10-17 13:29         ` [PATCH] perf tools: Fix crash on buildid-list with namespace Namhyung Kim
2017-10-17 14:05           ` Arnaldo Carvalho de Melo
2017-10-18  0:07             ` Namhyung Kim
2017-10-16  7:00   ` perf buildild-list -H dumps core Thomas-Mich Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).