2014-07-21 01:16:50

by Jet Chen

[permalink] [raw]
Subject: [rcu] BUG: unable to handle kernel NULL pointer dereference at (null)

Hi Pranith,

0day kernel testing robot got the below dmesg and the first bad commit is

git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
commit c6e2955266d149d207656d7a5b975ac28c27826a
Author: Pranith Kumar <[email protected]>
AuthorDate: Tue Jul 15 21:50:02 2014 -0400
Commit: Paul E. McKenney <[email protected]>
CommitDate: Thu Jul 17 16:39:53 2014 -0700

rcu: Remove redundant checks for rcu_scheduler_fully_active
rcu_scheduler_fully_active is set to true early in the boot process.
rcu_prepare_kthreads() is called in two locations. Once after setting the above
flag and the other while hotplugging a CPU from rcu_cpu_notify(). CPU hotplug is
enabled much later by which time the above flag is already set. Hence checking
for this flag is redundant in this function.
The checks in rcu_spawn_one_boost_kthread() and rcu_spawn_all_nocb_kthreads()
are similarly redundant.
This commit removes the redundant checks for this flag from the above
locations.
Signed-off-by: Pranith Kumar <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>

+----------------------------------------------------------+------------+------------+
| | 34e82ed60a | c6e2955266 |
+----------------------------------------------------------+------------+------------+
| boot_successes | 60 | 0 |
| boot_failures | 0 | 20 |
| BUG:unable_to_handle_kernel_NULL_pointer_dereference | 0 | 20 |
| Oops | 0 | 20 |
| EIP_is_at_wake_up_process | 0 | 20 |
| Kernel_panic-not_syncing:Attempted_to_kill_the_idle_task | 0 | 20 |
| backtrace:kthread_create_on_node | 0 | 20 |
| backtrace:rcu_cpu_notify | 0 | 20 |
| backtrace:rcu_init | 0 | 20 |
+----------------------------------------------------------+------------+------------+

[ 0.000000] Checking if this processor honours the WP bit even in supervisor mode...Ok.
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] BUG: unable to handle kernel NULL pointer dereference at (null)
[ 0.000000] IP: [<81048a68>] wake_up_process+0x6/0x2c
[ 0.000000] *pdpt = 0000000000000000 *pde = f000ff53f000ff53 [ 0.000000] Oops: 0000 [#1] PREEMPT SMP [ 0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.16.0-rc1-00055-gc6e2955 #9
[ 0.000000] task: 81957830 ti: 8194c000 task.ti: 8194c000
[ 0.000000] EIP: 0060:[<81048a68>] EFLAGS: 00210082 CPU: 0
[ 0.000000] EIP is at wake_up_process+0x6/0x2c
[ 0.000000] EAX: 00000000 EBX: 00000000 ECX: 81957c40 EDX: 00000002
[ 0.000000] ESI: 93403620 EDI: 8194dedc EBP: 8194dea0 ESP: 8194de9c
[ 0.000000] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
[ 0.000000] CR0: 80050033 CR2: 00000000 CR3: 01a72000 CR4: 000406b0
[ 0.000000] Stack:
[ 0.000000] 8194deb0 8194df14 8103f651 81957c58 00000000 00000000 00030000 dead4ead
[ 0.000000] ffffffff ffffffff 81a7fbfc 00000000 00000000 81885cce 8194ded4 8194ded4
[ 0.000000] 00000000 00030000 dead4ead ffffffff ffffffff 81a7fbfc 00000000 00000000
[ 0.000000] Call Trace:
[ 0.000000] [<8103f651>] kthread_create_on_node+0x90/0x108
[ 0.000000] [<8106a5b0>] rcu_spawn_one_nocb_kthread+0xba/0xda
[ 0.000000] [<81067eb3>] ? rcu_start_future_gp+0x118/0x118
[ 0.000000] [<8106a723>] rcu_cpu_notify+0x153/0x5b8
[ 0.000000] [<81657ae3>] ? __mutex_unlock_slowpath+0x106/0x11d
[ 0.000000] [<810678d2>] ? cpumask_next+0x22/0x26
[ 0.000000] [<81a058cc>] rcu_init+0x291/0x29b
[ 0.000000] [<819f2965>] start_kernel+0x1fa/0x372
[ 0.000000] [<819f255d>] ? set_init_arg+0x49/0x49
[ 0.000000] [<819f22af>] i386_start_kernel+0x79/0x7d
[ 0.000000] Code: 61 00 eb 07 89 f0 e8 df c4 ff ff be 01 00 00 00 8b 45 f0 8b 55 ec e8 b2 07 61 00 83 c4 10 89 f0 5b 5e 5f 5d c3 55 89 e5 53 89 c3 <8b> 00 a8 0c 74 0f ba e0 06 00 00 b8 8e 78 88 81 e8 0d 36 fe ff
[ 0.000000] EIP: [<81048a68>] wake_up_process+0x6/0x2c SS:ESP 0068:8194de9c
[ 0.000000] CR2: 0000000000000000
[ 0.000000] ---[ end trace db4b7fde7786bb07 ]---
[ 0.000000] Kernel panic - not syncing: Attempted to kill the idle task!

git bisect start 58e323c3ee94f1abcecdeeef211a27d1c106c2b3 1795cd9b3a91d4b5473c97f491d63892442212ab --
git bisect good 2a68fcd415ae2fa824ebb7c88f59d657f6669b72 # 17:07 20+ 0 Merge remote-tracking branch 'kbuild/for-next'
git bisect good c6006742775b1c02e32d75a3aec8a26b587205b1 # 17:10 20+ 0 Merge remote-tracking branch 'tip/auto-latest'
git bisect bad 946edaf4f5889f86419444d51da2614a0a41371c # 17:12 0- 20 Merge remote-tracking branch 'staging/staging-next'
git bisect bad 42e17b0d47f73373c97261b63ec1ffe1f690dbf4 # 17:17 0- 8 Merge remote-tracking branch 'percpu/for-next'
git bisect good 57080e0a2472ad31c609217f6329233412321979 # 17:21 20+ 0 Merge remote-tracking branch 'ftrace/for-next'
git bisect bad ae885de230a4897c2bc0b324cb32f22c0b7c9747 # 17:29 0- 20 Merge remote-tracking branch 'kvm/linux-next'
git bisect bad f63782f6953176276ab089434e9b8fbe672167ff # 17:32 0- 20 Merge remote-tracking branch 'rcu/rcu/next'
git bisect good 1823172ab582eb54456fd1354869bb850a1196ba # 17:37 20+ 0 Merge branches 'doc.2014.07.08a', 'fixes.2014.07.09a', 'maintainers.2014.07.08b', 'nocbs.2014.07.07a' and 'torture.2014.07.07a' into HEAD
git bisect good 531f70396af7a4c4da733dd820af4289e887d0c2 # 17:51 20+ 0 rcu: Return bool type in rcu_lockdep_current_cpu_online()
git bisect good 78d9b29a96b632c00fe8136dacb9a39532469f81 # 18:12 20+ 0 rcu: Rationalize kthread spawning
git bisect good 94e336821b022b92b09d14792f512cb502b667f3 # 18:14 20+ 0 rcu: Update tiny.c references to tree.c
git bisect bad c6e2955266d149d207656d7a5b975ac28c27826a # 18:19 0- 20 rcu: Remove redundant checks for rcu_scheduler_fully_active
git bisect good 34e82ed60aad3205657e276e4640c3ea60657048 # 18:21 20+ 0 rcu: Remove stale comment in tree.c
# first bad commit: [c6e2955266d149d207656d7a5b975ac28c27826a] rcu: Remove redundant checks for rcu_scheduler_fully_active
git bisect good 34e82ed60aad3205657e276e4640c3ea60657048 # 18:26 60+ 0 rcu: Remove stale comment in tree.c
git bisect bad 58e323c3ee94f1abcecdeeef211a27d1c106c2b3 # 18:26 0- 11 Add linux-next specific files for 20140718
git bisect good 59ca9ee42838d0f597137cf811e47eaf42fdcb69 # 18:35 60+ 0 Merge tag 'stable/for-linus-3.16-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
git bisect bad 58e323c3ee94f1abcecdeeef211a27d1c106c2b3 # 18:50 0- 11 Add linux-next specific files for 20140718


This script may reproduce the error.

----------------------------------------------------------------------------
#!/bin/bash

kernel=$1

kvm=(
qemu-system-x86_64
-enable-kvm
-cpu Haswell,+smep,+smap
-kernel $kernel
-m 320
-smp 1
-net nic,vlan=1,model=e1000
-net user,vlan=1
-boot order=nc
-no-reboot
-watchdog i6300esb
-rtc base=localtime
-serial stdio
-display none
-monitor null )

append=(
hung_task_panic=1
earlyprintk=ttyS0,115200
debug
apic=debug
sysrq_always_enabled
rcupdate.rcu_cpu_stall_timeout=100
panic=10
softlockup_panic=1
nmi_watchdog=panic
prompt_ramdisk=0
console=ttyS0,115200
console=tty0
vga=normal
root=/dev/ram0
rw
drbd.minor_count=8
)

"${kvm[@]}" --append "${append[*]}"
----------------------------------------------------------------------------

Thanks,
Jet


Attachments:
dmesg-yocto-kbuild-3:20140718181657:i386-randconfig-ib1-07181646:3.16.0-rc1-00055-gc6e2955:9 (13.05 kB)
i386-randconfig-ib1-07181646-58e323c3ee94f1abcecdeeef211a27d1c106c2b3-BUG:-unable-to-handle-kernel-NULL-pointer-dereference-63756.log (53.37 kB)
config-3.16.0-rc1-00055-gc6e2955 (75.04 kB)
Attached Message Part (86.00 B)
Download all attachments