Re: perf crash with tip/perf/core

From: Arnaldo Carvalho de Melo
Date: Fri Jun 03 2016 - 17:27:51 EST

Em Fri, Jun 03, 2016 at 06:15:15PM -0300, Arnaldo Carvalho de Melo escreveu:
> Hi Peter,
> I built what is in tip/perf/core to test the topdown patches
> from Andi but it is crashing on me, 'perf stat' was ok, but then I tried
> 'perf trace' and got the NULL deref below, bet 'perf record' will do the same.

Yeah, just tried with 'perf record usleep 1' and got:

BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<ffffffff813eb669>] __list_del_entry+0x29/0xc0
PGD 1249ea067 PUD 1249e9067 PMD 0
Oops: 0000 [#1] SMP
Modules linked in: hidp rfcomm fuse cmac xt_CHECKSUM ipt_MASQUERADE nf_nat_masquerade_ipv4 xt_addrtype br_netfilter tun nf_conntrack_netbios_ns nf_conntrack_broadcast dm_thin_pool dm_persistent_data dm_bio_prison libcrc32c loop ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_broute bridge stp llc ebtable_filter ebtable_nat ebtables ip6table_mangle ip6table_raw ip6table_security ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_filter ip6_tables iptable_mangle iptable_raw iptable_security iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack bnep arc4 iwlmvm mac80211 intel_rapl x86_pkg_temp_thermal coretemp kvm_intel kvm iwlwifi irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel intel_cstate mei_wdt iTCO_wdt
cfg80211 iTCO_vendor_support uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_core videodev i2c_i801 snd_hda_codec_realtek pcspkr snd_seq rtsx_pci_ms intel_pch_thermal snd_hda_codec_hdmi snd_hda_codec_generic btusb lpc_ich btrtl mei_me snd_hda_intel memstick media snd_hda_codec joydev snd_seq_device mei btbcm shpchp btintel snd_hda_core bluetooth snd_hwdep snd_pcm nfsd snd_timer thinkpad_acpi snd soundcore rfkill auth_rpcgss tpm_tis tpm wmi intel_rst nfs_acl lockd grace sunrpc binfmt_misc i915 i2c_algo_bit drm_kms_helper rtsx_pci_sdmmc mmc_core drm e1000e crc32c_intel rtsx_pci serio_raw ptp pps_core fjes video
CPU: 1 PID: 3572 Comm: perf Not tainted 4.6.0+ #2
Hardware name: LENOVO 20BX001LUS/20BX001LUS, BIOS JBET49WW (1.14 ) 05/21/2015
task: ffff8801fe7e3b00 ti: ffff8801249d8000 task.ti: ffff8801249d8000
RIP: 0010:[<ffffffff813eb669>] [<ffffffff813eb669>] __list_del_entry+0x29/0xc0
RSP: 0018:ffff8801249dbdd8 EFLAGS: 00010207
RAX: 0000000000000000 RBX: ffff8800a8dfc000 RCX: dead000000000200
RDX: 0000000000000000 RSI: ffff88023dc9a820 RDI: ffff8800a8dfc468
RBP: ffff8801249dbdd8 R08: ffff8800a8dfc010 R09: ffff8800a8dfc020
R10: ffff880233990fc0 R11: ffff88007fa3c310 R12: ffff88023dc90980
R13: ffff8801fe7e4380 R14: ffff8800a8dfc268 R15: ffff8800a8dfc248
FS: 00007fbac60d1780(0000) GS:ffff88023dc80000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 00000001249e7000 CR4: 00000000003406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
ffff8801249dbdf8 ffffffff811a6691 ffff8800a8dfc000 ffff8800a8dfc220
ffff8801249dbe08 ffffffff811a6c14 ffff8801249dbe50 ffffffff811a6e01
ffff8800a8dfc248 ffff8800a8dfc000 ffff88007fa3c300 0000000000000008
Call Trace:
[<ffffffff811a6691>] _free_event+0x221/0x320
[<ffffffff811a6c14>] put_event+0x14/0x20
[<ffffffff811a6e01>] perf_event_release_kernel+0x1e1/0x260
[<ffffffff811a6e90>] perf_release+0x10/0x20
[<ffffffff812415bf>] __fput+0xdf/0x1f0
[<ffffffff8124170e>] ____fput+0xe/0x10
[<ffffffff810c2673>] task_work_run+0x73/0x90
[<ffffffff81003242>] exit_to_usermode_loop+0xc2/0xd0
[<ffffffff81003d21>] syscall_return_slowpath+0xa1/0xb0
[<ffffffff817bdefa>] entry_SYSCALL_64_fastpath+0xa2/0xa4
Code: 66 90 55 48 8b 07 48 b9 00 01 00 00 00 00 ad de 48 8b 57 08 48 89 e5 48 39 c8 74 29 48 b9 00 02 00 00 00 00 ad de 48 39 ca 74 3a <4c> 8b 02 4c 39 c7 75 52 4c 8b 40 08 4c 39 c7 75 66 48 89 50 08
RIP [<ffffffff813eb669>] __list_del_entry+0x29/0xc0
RSP <ffff8801249dbdd8>
CR2: 0000000000000000
---[ end trace 1257c98b7b352b79 ]---