Kernel BUG in 2.6.26-git series
In the current git pulls from Linus's tree, I get a kernel BUG if CONFIG_SCHED_SMT is defined. It does not always appear, but when it does, it is late in the bootup sequence. Perhaps there is a timing issue. This is an x86_64 system on an HP dv2815nr notebook with and AMD Turion X2 CPU. My distro is openSUSE 11.0.
kernel: BUG: unable to handle kernel NULL pointer dereference at 000000000000002
kernel: IP: [<ffffffff80231aec>] sched_mc_power_savings_store+0x13/0x41
kernel: PGD 0
kernel: Oops: 0000 [1] SMP
kernel: CPU 0
kernel: Modules linked in: iptable_filter ip_tables x_tables snd_pcm_oss snd_mixer_oss snd_seq snd_seq_device af_packet nfs rfkill_input lockd nfs_acl sunrpc cpufreq_conservative cpufreq_userspace cpufreq_powersave powernow_k8 fuse loop dm_mod arc4 ecb crypto_blkcipher b43 rfkill snd_hda_intel mac80211 k8temp cfg80211 led_class input_polldev bat
tery sr_mod snd_pcm button ac joydev hwmon snd_timer serio_raw cdrom forcedeth ssb snd soundcore snd_page_alloc sg sd_mod ohci_hcd ehci_hcd usbcore edd fan thermal processor ext3 mbcache jbd pata_amd ahci libata scsi_mod dock
kernel: Pid: 3686, comm: sched-powersave Not tainted 2.6.26-Linus-06879-gfb2e405 #71
kernel: RIP: 0010:[<ffffffff80231aec>] [<ffffffff80231aec>]
sched_mc_power_savings_store+0x13/0x41 kernel: RSP: 0018:ffff8800b8793ea8 EFLAGS: 00010292 kernel: RAX: ffffffff80231ad9 RBX: 0000000000000002 RCX: ffffffffffffffea kernel: RDX: 0000000000000002 RSI: ffff8800b9aed000 RDI: ffffffff805508d0 kernel: RBP: ffff8800b8793eb8 R08: ffff8800b9aed000 R09: 0000000000000000 kernel: R10: ffffffff8027c836 R11: ffffffff80231ad9 R12: ffff8800bb6dc4b0 kernel: R13: 00000000ffffffed R14: ffffffff80550940 R15: ffffffff80550240 kernel: FS: 00007f9c3dc546f0(0000) GS:ffffffff8057ea00(0000) knlGS:00000000f69426d0 kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b kernel: CR2: 0000000000000002 CR3: 00000000b9fe6000 CR4: 00000000000006e0 kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 kernel: DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 kernel: Process sched-powersave (pid: 3686, threadinfo ffff8800b8792000, task ffff8800b876c9c0) kernel: Stack: 0000000000000000 0000000000000002 ffff8800b8ab4980 ffffffff802dbb84 kernel: ffff880037a15458 ffff8800b8793f50 ffff8800b8ab49a0 ffff8800b8fb3a80 kernel: 0000000000000002 ffff8800b8793f50 00007f9c3dc7c000 00007f9c3df40be0 kernel: Call Trace: kernel: [<ffffffff802dbb84>] sysfs_write_file+0xd5/0x10c kernel: [<ffffffff8029922b>] ? vfs_write+0xad/0x123 kernel: [<ffffffff8029935d>] ? sys_write+0x45/0x6e kernel: [<ffffffff8020be9b>] ? system_call_fastpath+0x16/0x1b
kernel:
kernel:
kernel: Code: 27 5c 00 00 31 d2 31 f6 31 ff e8 21 fd ff ff e8 c0 5b 00 00 31 c0 c9 c3 55 48 89 e5 53 48 89 cb 48 c7 c1 ea ff ff ff 48 83 ec 08 <8a> 12 8d 42 d0 3c 01 77 1d 31 c0 80 fa 31 0f 94 c0 89 05 11 19
kernel: RIP [<ffffffff80231aec>] sched_mc_power_savings_store+0x13/0x41
kernel: RSP <ffff8800b8793ea8>
kernel: CR2: 0000000000000002
======================================================================
The specific problem is that the buffer pointer in the call to sched_mc_power_savings_store() is NULL. Due to the intermittent nature of the trigger, I have not been able bisect this problem; however, the only recent change in this code was with:
commit 4a0b2b4dbe1335b8b9886ba3dc85a145d5d938ed
Author: Andi Kleen <[email protected]> Date: Tue Jul 1 18:48:41 2008 +0200
sysdev: Pass the attribute to the low level sysdev show/store function
If I forgot any essential details, please let me know.
Larry
Quoted 9 lines · Larry Finger
In the current git pulls from Linus's tree, I get a kernel BUG if
CONFIG_SCHED_SMTis defined. It does not always appear, but when it does, it is late in the bootup sequence. Perhaps there is a timing issue. This is anx86_64system on an HP dv2815nr notebook with and AMD Turion X2 CPU. My distro is openSUSE 11.0.kernel: BUG: unable to handle kernel NULL pointer dereference at 000000000000002
kernel: IP: [<ffffffff80231aec>]sched_mc_power_savings_store+0x13/0x41
Maybe LKML is slow and somebody else replied to this before me, but I know how much I hate to discover that I've been bisecting something that was fixed a week ago in another tree, so here's a link you might try :-)
http://lkml.org/lkml/2008/7/24/398
Vegard
Signature · 4 lines
"The animistic metaphor of the bug that maliciously sneaked in while the programmer was not looking is intellectually dishonest as it disguises that the error is the programmer's own creation." -- E. W. Dijkstra, EWD1036
Quoted 7 lines · Vegard Nossum
Quoted 6 lines · Larry Finger
In the current git pulls from Linus's tree, I get a kernel BUG if
CONFIG_SCHED_SMTis defined. It does not always appear, but when it does, it is late in the bootup sequence. Perhaps there is a timing issue. This is anx86_64system on an HP dv2815nr notebook with and AMD Turion X2 CPU. My distro is openSUSE 11.0.
Quoted 8 lines
Quoted 3 lines
kernel: BUG: unable to handle kernel NULL pointer dereference at 000000000000002
kernel: IP: [<ffffffff80231aec>]sched_mc_power_savings_store+0x13/0x41Maybe LKML is slow and somebody else replied to this before me, but I know how much I hate to discover that I've been bisecting something that was fixed a week ago in another tree, so here's a link you might try :-)
That patch fixes my problem as well. I scanned the LKML archive just before submitting my E-mail, but I missed your thread.
Thanks,
Larry
Quoted 5 lines · Larry Finger
In the current git pulls from Linus's tree, I get a kernel BUG if
CONFIG_SCHED_SMTis defined. It does not always appear, but when it does, it is late in the bootup sequence. Perhaps there is a timing issue. This is anx86_64system on an HP dv2815nr notebook with and AMD Turion X2 CPU. My distro is openSUSE 11.0.
A couple of people ran into that. It was a latent bug triggered by some changes of mine. Here's the patch.
-Andi
commit a2ab909933f8c8623282979dfa64f3e358bdb9fc
Author: Andi Kleen <ak@gargoyle.(none)> Date: Thu Jul 24 21:57:40 2008 +0200
Make scheduler sysfs attributes sysdev class devices
They are really class devices, but were incorrectly declared. This leads to crashes with the recent changes that makes non normal sysdevs use a different prototype.
kernel/sched.c +11 -11
@@ -7641,34 +7641,34 @@ static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt) }#ifdef CONFIG_SCHED_MC -static ssize_t sched_mc_power_savings_show (struct sys_device *dev, -struct sysdev_attribute *attr,char *page) +static ssize_t sched_mc_power_savings_show (struct sysdev_class *class, +char *page) {return sprintf (page,"%u\n" , sched_mc_power_savings); } -static ssize_t sched_mc_power_savings_store (struct sys_device *dev, -struct sysdev_attribute *attr, +static ssize_t sched_mc_power_savings_store (struct sysdev_class *class,const char *buf,size_t count) {return sched_power_savings_store (buf, count,0 ); } -static SYSDEV_ATTR(sched_mc_power_savings, 0644, sched_mc_power_savings_show, - sched_mc_power_savings_store); +static SYSDEV_CLASS_ATTR(sched_mc_power_savings, 0644, + sched_mc_power_savings_show, + sched_mc_power_savings_store);#endif #ifdef CONFIG_SCHED_SMT -static ssize_t sched_smt_power_savings_show (struct sys_device *dev, -struct sysdev_attribute *attr,char *page) +static ssize_t sched_smt_power_savings_show (struct sysdev_class *dev, +char *page) {return sprintf (page,"%u\n" , sched_smt_power_savings); } -static ssize_t sched_smt_power_savings_store (struct sys_device *dev, -struct sysdev_attribute *attr, +static ssize_t sched_smt_power_savings_store (struct sysdev_class *dev,const char *buf,size_t count) {return sched_power_savings_store (buf, count,1 ); } -static SYSDEV_ATTR(sched_smt_power_savings, 0644, sched_smt_power_savings_show, +static SYSDEV_CLASS_ATTR(sched_smt_power_savings, 0644, + sched_smt_power_savings_show, sched_smt_power_savings_store);#endif
Quoted 5 lines · Andi Kleen
Quoted 1 line · Larry Finger
In the current git pulls from Linus's tree, I get a kernel BUG if
CONFIG_SCHED_SMTis defined. It does not always appear, but when it does, it is late in the bootup sequence. Perhaps there is a timing issue. This is anx86_64system on an HP dv2815nr notebook with and AMD Turion X2 CPU. My distro is openSUSE 11.0.A couple of people ran into that. It was a latent bug triggered by some changes of mine. Here's the patch.
Thanks. The patch fixes it for me.
Larry