hwclock and df seg fault
Hey guys
I have an old SGI indy R4600 and have installed debian testing with latest linux-mips cvs kernel. I found two problems with the programs hwclock and df. Apart from that appears to work fine. I have included their output. I don't know if it is a kernel or package problem. I don't know if it as something to do with preemtible kernel which I enabled in kernel. If anyone is interested and wants to see kernel .config, fstab or anything else I'm happy to oblidge.
Barcelona:/var/log# hwclock Mar 21 19:11:20 Barcelona kernel: bad: scheduling while atomic! Mar 21 19:11:20 Barcelona kernel: Call Trace: Mar 21 19:11:20 Barcelona kernel: [<88030498>] schedule+0xb10/0xb18 Mar 21 19:11:20 Barcelona kernel: [<88030490>] schedule+0xb08/0xb18 Mar 21 19:11:20 Barcelona kernel: [<88031ef0>] sys_sched_yield+0x154/0x1b4 Mar 21 19:11:20 Barcelona kernel: [<88031fac>] yield+0x24/0x38 Mar 21 19:11:20 Barcelona kernel: [<8808a2fc>] coredump_wait+0x3c/0xa4 Mar 21 19:11:20 Barcelona kernel: [<8805d8e0>] cache_grow+0x274/0x4c0 Mar 21 19:11:20 Barcelona kernel: [<8808a4b8>] do_coredump+0x154/0x26c Mar 21 19:11:20 Barcelona kernel: [<8805dd34>] cache_alloc_refill+0x208/0x2b8 Mar 21 19:11:20 Barcelona kernel: [<88007e14>] indy_r4k_timer_interrupt+0x90/0x98 Mar 21 19:11:20 Barcelona kernel: [<8801ec14>] r4k_flush_icache_page+0xf4/0x124 Mar 21 19:11:20 Barcelona kernel: [<882412f0>] change_floppy+0x94/0x180 Mar 21 19:11:20 Barcelona kernel: [<88041380>] __dequeue_signal+0x16c/0x2a0 Mar 21 19:11:20 Barcelona kernel: [<880413b4>] __dequeue_signal+0x1a0/0x2a0 Mar 21 19:11:20 Barcelona kernel: [<8805e0ec>] kmem_cache_alloc+0x94/0x9c Mar 21 19:11:20 Barcelona kernel: [<880414e0>] dequeue_signal+0x2c/0xa8 Mar 21 19:11:20 Barcelona kernel: [<8802e9b8>] wake_up_state+0x18/0x2c Mar 21 19:11:20 Barcelona kernel: [<8804468c>] get_signal_to_deliver+0x394/0x524 Mar 21 19:11:20 Barcelona kernel: [<8800cf08>] do_signal+0x44/0xd74 Mar 21 19:11:20 Barcelona kernel: [<8801dd20>] do_page_fault+0x280/0x380 Mar 21 19:11:20 Barcelona kernel: [<88086938>] chrdev_open+0x150/0x2cc Mar 21 19:11:20 Barcelona kernel: [<88079108>] dentry_open+0x1a4/0x2d0 Mar 21 19:11:20 Barcelona kernel: [<88078f90>] dentry_open+0x2c/0x2d0 Mar 21 19:11:20 Barcelona kernel: [<88079108>] dentry_open+0x1a4/0x2d0 Mar 21 19:11:20 Barcelona kernel: [<88078f90>] dentry_open+0x2c/0x2d0 Mar 21 19:11:20 Barcelona kernel: [<8807b554>] __fput+0x118/0x1c0 Mar 21 19:11:20 Barcelona kernel: [<8807b434>] fput+0x40/0x48 Mar 21 19:11:20 Barcelona kernel: [<8807972c>] filp_close+0x6c/0xb4 Mar 21 19:11:20 Barcelona kernel: [<88079718>] filp_close+0x58/0xb4 Mar 21 19:11:20 Barcelona kernel: [<8800dc70>] do_notify_resume+0x38/0x54 Mar 21 19:11:20 Barcelona kernel: [<88008be0>] work_notifysig+0xc/0x14 Mar 21 19:11:20 Barcelona kernel: [<88011828>] stack_done+0x20/0x3c Mar 21 19:11:20 Barcelona kernel: [<88079774>] sys_close+0x0/0x12c Mar 21 19:11:20 Barcelona kernel: Mar 21 19:11:20 Barcelona kernel: note: hwclock[369] exited with preempt_count 2
Barcelona:/var/log# df Filesystem 1K-blocks Used Available Use% Mounted on df: `/': Invalid argument df: `/proc': Invalid argument df: `/dev/pts': Invalid argument df: `/dev/shm': Invalid argument df: `/sys': Invalid argument Barcelona:/var/log#
P.S. feel free to ignore me. It does not really worry me that they don't work, but I thought maybe someone would want to know.
Quoted 7 lines · Martin C. Barlow
I have an old SGI indy R4600 and have installed debian testing with latest linux-mips cvs kernel. I found two problems with the programs hwclock and df. Apart from that appears to work fine. I have included their output. I don't know if it is a kernel or package problem. I don't know if it as something to do with preemtible kernel which I enabled in kernel. If anyone is interested and wants to see kernel .config, fstab or anything else I'm happy to oblidge.
Standard flame - what kernel version?
I checked in the last fixes for the preemptible kernel less than two days ago so if your kernel is older than that it's time to update :-)
Ralf
Martin C. Barlow wrote:
[snip]
Quoted 2 lines
Barcelona:/var/log# hwclock Mar 21 19:11:20 Barcelona kernel: bad: scheduling while atomic!
[snip]
Quoted 2 lines
Mar 21 19:11:20 Barcelona kernel: note: hwclock[369] exited with
preempt_count2
So this was with CONFIG_PREEMPT, I guess. Does it happen also without that?
Thiemo
I downloaded the kernel from cvs today (less than 6 hours ago). I will recompile without preemptible and let you know the result. The version is 2.6.4
marty
-----Original Message-----
From: Ralf Baechle [mailto:[email protected]]
Sent: Saturday, 20 March 2004 11:22 PM
To: Martin C. Barlow
Cc: [email protected]
Subject: Re: hwclock and df seg fault
Quoted 7 lines · Martin C. Barlow
I have an old SGI indy R4600 and have installed debian testing with latest linux-mips cvs kernel. I found two problems with the programs hwclock and df. Apart from that appears to work fine. I have included their output. I don't know if it is a kernel or package problem. I don't know if it as something to do with preemtible kernel which I enabled in kernel. If anyone is interested and wants to see kernel .config, fstab or anything else I'm happy to oblidge.
Standard flame - what kernel version?
I checked in the last fixes for the preemptible kernel less than two days ago so if your kernel is older than that it's time to update :-)
Ralf
Thiemo
With PREEMP turned off, the hwclock command works again. Looks like the new scheduler may have a little problem.
The df problem is still there. This may be just a user space mis-configuration error. I'll see if I can find the problem. Let me know if you need any dumps.
marty
-----Original Message-----
From: Thiemo Seufer [mailto:[email protected]]
Sent: Saturday, 20 March 2004 11:22 PM
To: Martin C. Barlow
Cc: [email protected]
Subject: Re: hwclock and df seg fault
Martin C. Barlow wrote:
[snip]
Quoted 2 lines
Barcelona:/var/log# hwclock Mar 21 19:11:20 Barcelona kernel: bad: scheduling while atomic!
[snip]
Quoted 2 lines
Mar 21 19:11:20 Barcelona kernel: note: hwclock[369] exited with
preempt_count2
So this was with CONFIG_PREEMPT, I guess. Does it happen also without that?
Thiemo
I did a search for this problem and found that the sparc64 guys had a similar problem that they solved. I don't know if the problem is similar.
http://lists.debian.org/debian-sparc/2003/debian-sparc-200311/msg00068.h
tml
They solved it by analysing an strace. I did the same. Looking at it, it looks like some linking is failing and then later on SYS_4255(), the critical function is failing.
Hope that helps someone to understand.
marty
Barcelona:~# strace df
execve("/bin/df", ["df"], [/* 16 vars */]) = 0
uname({sys="Linux", node="Barcelona", ...}) = 0
brk(0) = 0x10001000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x2aac2000
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=9507, ...}) = 0
old_mmap(NULL, 9507, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2aac4000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\10\0\0\0\1\0\1PD"...,
512) = 512
lseek(3, 588, SEEK_SET) = 588
read(3, "\0\0\0\4\0\0\0\20\0\0\0\1GNU\0\0\0\0\0\0\0\0\2\0\0\0\4"..., 32)
= 32
fstat64(3, {st_mode=S_IFREG|0644, st_size=1692012, ...}) = 0
old_mmap(NULL, 1872896, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0x2ab02000
mprotect(0x2ac7f000, 312320, PROT_NONE) = 0
old_mmap(0x2acbe000, 45056, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
3, 0x17c000) = 0x2acbe000
old_mmap(0x2acc9000, 9216, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2acc9000
close(3) = 0
munmap(0x2aac4000, 9507) = 0
brk(0) = 0x10001000
brk(0x10022000) = 0x10022000
brk(0) = 0x10022000
open("/etc/mtab", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=162, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x2aac3000
read(3, "/dev/sda1 / ext3 rw,errors=remou"..., 4096) = 162
read(3, "", 4096) = 0
close(3) = 0
munmap(0x2aac3000, 4096) = 0
fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 0), ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x2aac3000
write(1, "Filesystem 1K-blocks "..., 67Filesystem
1K-blocks Used Available Use% Mounted on
) = 67
SYS_4255() = -1 EINVAL (Invalid argument)
write(2, "df: ", 4df: ) = 4
write(2, "`/\'", 3`/') = 3
write(2, ": Invalid argument", 18: Invalid argument) = 18
write(2, "\n", 1
) = 1
SYS_4255() = -1 EINVAL (Invalid argument)
write(2, "df: ", 4df: ) = 4
write(2, "`/proc\'", 7`/proc') = 7
write(2, ": Invalid argument", 18: Invalid argument) = 18
write(2, "\n", 1
) = 1
SYS_4255() = -1 EINVAL (Invalid argument)
write(2, "df: ", 4df: ) = 4
write(2, "`/sys\'", 6`/sys') = 6
write(2, ": Invalid argument", 18: Invalid argument) = 18
write(2, "\n", 1
) = 1Barcelona:~# df Filesystem 1K-blocks Used Available Use% Mounted on df: `/': Invalid argument df: `/proc': Invalid argument df: `/sys': Invalid argument df: `/dev/pts': Invalid argument df: `/dev/shm': Invalid argument
Barcelona:~# uname -a Linux Barcelona 2.6.4 #3 Mon Mar 22 00:14:42 EST 2004 mips GNU/Linux
Barcelona:~# cat /proc/version Linux version 2.6.4 (root@Barcelona) (gcc version 3.3.3 (Debian)) #3 Mon Mar 22 00:14:42 EST 2004
Barcelona:~# dpkg -l coreutils libc6 ii coreutils 5.0.91-2 The GNU core utilities ii libc6 2.3.2.ds1-11 GNU C Library: Shared libraries and Timezone data
-----Original Message-----
From: Ralf Baechle [mailto:[email protected]]
Sent: Saturday, 20 March 2004 11:22 PM
To: Martin C. Barlow
Cc: [email protected]
Subject: Re: hwclock and df seg fault
I checked in the last fixes for the preemptible kernel less than two days ago so if your kernel is older than that it's time to update :-)
Ralf
The RTC bug was trivial, patch below and in CVS,
Ralf
Index: drivers/char/ds1286.c
===================================================================
RCS file: /home/cvs/linux/drivers/char/ds1286.c,v
retrieving revision 1.9
char/ds1286.c +1 -1
@@ -254,7 +254,7 @@ ds1286_status |=RTC_IS_OPEN ; -spin_lock_irq (&ds1286_lock); +spin_unlock_irq (&ds1286_lock);return 0 ; out_busy:
Quoted 5 lines · Martin C. Barlow
With PREEMP turned off, the hwclock command works again. Looks like the new scheduler may have a little problem.
The df problem is still there. This may be just a user space mis-configuration error. I'll see if I can find the problem. Let me know if you need any dumps.
No, the different locking code used for the preemptible kernel contains assertions which simply detected the bug in the RTC driver.
Ralf
Quoted 8 lines · Martin C. Barlow
Thiemo
With PREEMP turned off, the hwclock command works again. Looks like the new scheduler may have a little problem.
The df problem is still there. This may be just a user space mis-configuration error. I'll see if I can find the problem. Let me know if you need any dumps.
df works fine here with PREEMPT, both UP and SMP.
There are still some holes in PREEMPT, but mostly are theorectical ones and you won't hit thme easily.
Jun