Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1985868ybl; Sat, 10 Aug 2019 14:11:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0VhfwCjjZCoGjpUpnxjd3Id/KMkXk+uf355v6+WuVNIpiIYpAIjzn/aOPGoGWEVPb2EaQ X-Received: by 2002:a62:dbc6:: with SMTP id f189mr10577614pfg.237.1565471518596; Sat, 10 Aug 2019 14:11:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565471518; cv=none; d=google.com; s=arc-20160816; b=MZbHXIee38qVAyCrUu5djTc8iWv4bMYQqZfgYGmu+LscucAT8rawHEoocrvMff/Xx1 nsf8leXW7eDyjk3jCRzRQzG4UTuLHoXIgPtRU5VIKqH7UoFHFlCK+NA7LYPQ1AZbmm/O VdCdLSWDF2jzm/6UDzGFaWnr+G6C0XWhxXrNdRazRs5m3kvZfRc5f79c+oMV3+CheFEo eMCa+V26HMIU/6NNtB8GBcTq2cf9kt2pd6FNQ7mo/xKg955y+QxQAVcbJ3n5rE/mopSn tBfitzDUDX/EL25i4hBC6m5Njh8ZI0VtbCYPyzoT06rfm1b8FiRBsBGcI3YgHn5wk+0+ ybXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=gGT8k0IH2sBMxYeHmwwQ3FFSXUe0x47zTBGz8vqPBZg=; b=nSLTw9yDcB53rcZEonrdUkoTl1X7IPNdPE18TUWWYbVXw1zrfQChyRo7I0tAY9/HRn z6WZ3JqymKlWWdqNyT7gcfWeL8VLVCA33JRdSmL0dd2m+HFEyzXfW2UI3/Kg54EDn650 lkm6dKly+oz5ddYpVzCJIG1T1ZkoW26/PpRHQ4BDd5fhXzRU9bxIGlN2QiAE/uc4JokN qEmkLsntuRAr0Q40rRHlJAK2Jl+cYxt4yOgDqmraROB7i4Z1aHbT0WHoNKTcvZmcHzp0 Bti4Yevrpv7fvv2TGieSplT+CvWG8bTTW25OUBbITpKOd6svJ7CthGm7blPlYaBa1/mc 7dcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 21si24191665pgl.177.2019.08.10.14.11.43; Sat, 10 Aug 2019 14:11:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726455AbfHJVLN (ORCPT + 99 others); Sat, 10 Aug 2019 17:11:13 -0400 Received: from mx3.molgen.mpg.de ([141.14.17.11]:47409 "EHLO mx1.molgen.mpg.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725863AbfHJVLN (ORCPT ); Sat, 10 Aug 2019 17:11:13 -0400 Received: from [192.168.0.6] (ip5f5bd16e.dynamic.kabel-deutschland.de [95.91.209.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id A18E6201A3C38; Sat, 10 Aug 2019 23:11:10 +0200 (CEST) Subject: Re: [Linux 5.2.x] /sys/kernel/debug/tracing/events/power/cpu_idle/id: BUG: kernel NULL pointer dereference, address: 0000000000000000 From: Paul Menzel To: Thomas Gleixner , Jacob Pan , Len Brown Cc: x86@kernel.org, LKML , linux-pm@vger.kernel.org References: <4b54ff1e-f18b-3c58-7caa-945a0775c24c@molgen.mpg.de> <01c7bc6b-dc6d-5eca-401a-8869e02f7c2a@molgen.mpg.de> Message-ID: Date: Sat, 10 Aug 2019 23:11:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <01c7bc6b-dc6d-5eca-401a-8869e02f7c2a@molgen.mpg.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+ INTEL IDLE DRIVER] Dear Linux folks, On 10.08.19 20:28, Paul Menzel wrote: > On 10.08.19 19:31, Thomas Gleixner wrote: > >> On Sat, 10 Aug 2019, Paul Menzel wrote: >>> >>> I have no idea, who to report this to, so I please refer me to the >>> correct >>> list. >> >> I have no idea yet either :) >> >>> With Linux 5.2.7 from Debian Sid/unstable and PowerTOP 2.10, executing >>> >>>      sudo powertop --auto-tune >>> >>> causes a NULL pointer dereference, and the graphical session crashes >>> due to an >>> effect on the i915 driver. It worked in the past with the 4.19 series >>> from >>> Debian. >>> >>> Here is the trace, and please find all Linux kernel logs attached. >>> >>>> [ 2027.170589] BUG: kernel NULL pointer dereference, address: >>>> 0000000000000000 >>>> [ 2027.170600] #PF: supervisor instruction fetch in kernel mode >>>> [ 2027.170604] #PF: error_code(0x0010) - not-present page >>>> [ 2027.170609] PGD 0 P4D 0 [ 2027.170619] Oops: 0010 [#1] SMP PTI >> ... >>>> [ 2027.170730]  do_dentry_open+0x13a/0x370 >> >> If you have compiled with debug info, please decode the line: >> >>    linux/scripts/faddr2line vmlinux do_dentry_open+0x13a/0x370 >> >> That gives us the fops pointer which is NULL. > > Hah, luckily it’s reproducible. > > ``` > $ scripts/faddr2line /usr/lib/debug/boot/vmlinux-5.2.0-2-amd64 > do_dentry_open+0x13a/0x370 > do_dentry_open+0x13a/0x370: > do_dentry_open at fs/open.c:799 > ``` > >>>> [ 2027.170745]  path_openat+0x2c6/0x1480 >>>> [ 2027.170757]  ? terminate_walk+0xe6/0x100 >>>> [ 2027.170767]  ? path_lookupat.isra.48+0xa3/0x220 >>>> [ 2027.170779]  ? reuse_swap_page+0x105/0x320 >>>> [ 2027.170791]  do_filp_open+0x93/0x100 >>>> [ 2027.170804]  ? __check_object_size+0x15d/0x189 >>>> [ 2027.170816]  do_sys_open+0x184/0x220 >>>> [ 2027.170828]  do_syscall_64+0x53/0x130 >>>> [ 2027.170837]  entry_SYSCALL_64_after_hwframe+0x44/0xa9 >> >> That's an open crashing. We just don't know which file. Is the machine >> completely hosed after that or is it just the graphics stuff dying? > > No, the graphical login manager showed up, and I could log back in, and > continue using hte machine. > >> If it's not completely dead then instead of running it from your >> graphical >> desktop you could switch to a VGA terminal Alt+Ctrl+F1 (or whatever >> function key your distro maps to) after boot and run powertop with strace >> from there: >> >>    strace -f -o xxx.log powertop >> >> With a bit of luck xxx.log should contain the information about the >> file it >> tries to open. > > ``` > 2157  access("/sys/class/drm/card0/power/rc6_residency_ms", R_OK) = 0 > 2157  openat(AT_FDCWD, > "/sys/kernel/debug/tracing/events/power/cpu_idle/id", O_RDONLY) = ? > 2157  +++ killed by SIGKILL +++ > ``` > >> Alternatively if you have a serial console you can enable the >> sys_enter_open* tracepoints: >> >> # echo 1 >/sys/kernel/debug/tracing/events/syscalls/sys_enter_open >> # echo 1 >/sys/kernel/debug/tracing/events/syscalls/sys_enter_openat >> >> Either add 'ftrace_dump_on_oops' to the kernel command line or enable it >> from the shell: >> >> # echo 1 > /proc/sys/kernel/ftrace_dump_on_oops >> >> Then run powertop. After the crash it will take some time to spill out >> the trace buffer over serial, but it will pinpoint the offending file. > > I do not have serial console on this device. For the record. It is also reproducible with Linux 5.2.6, and trying to print the file contents with cat already fails. ``` $ sudo ls -l /sys/kernel/debug/tracing/events/power/cpu_idle/id -r--r--r-- 1 root root 0 Aug 10 23:05 /sys/kernel/debug/tracing/events/power/cpu_idle/id $ sudo cat /sys/kernel/debug/tracing/events/power/cpu_idle/id Killed ``` Kind regards, Paul