2002-10-16 12:55:37

by Thomas Langås

[permalink] [raw]
Subject: Kernel BUG at swap.c:62 [2.4.19 vanilla]


Reading Oops report from the terminal
kernel BUG at swap.c:62!
kernel BUG at swap.c:62!
invalid operand: 0000
CPU: 1
EIP: 0010:[<c01329ca>] Not tainted
EFLAGS: 00010202
invalid operand: 0000
CPU: 1
EIP: 0010:[<c01329ca>] Not tainted
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010202
eax: 020008c1 ebx: c2302140 ecx: c2302140 edx: f7d514e4
esi: 00000000 edi: f7d514e4 ebp: cf5439b0 esp: c6f0bee8
ds: 0018 es: 0018 ss: 0018
Process perl (pid: 16439, stackpage=c6f0b000)
Stack: c012bc22 c2302140 f7d514e4 c2302140 c012e2b3 c2302140 cf5439b0 00000000
f7d514e4 00000001 00000286 00000003 00000001 f0f6a780 00000fff bfffd118
bfffe118 c01481b2 cf5439b0 00000000 c0162aa0 00000000 bfffe118 c0164453
Call Trace: [<c012bc22>] [<c012e2b3>] [<c01481b2>] [<c0162aa0>] [<c0164453>]
eax: 020008c1 ebx: c2302140 ecx: c2302140 edx: f7d514e4
esi: 00000000 edi: f7d514e4 ebp: cf5439b0 esp: c6f0bee8
ds: 0018 es: 0018 ss: 0018
Process perl (pid: 16439, stackpage=c6f0b000)
Stack: c012bc22 c2302140 f7d514e4 c2302140 c012e2b3 c2302140 cf5439b0 00000000
f7d514e4 00000001 00000286 00000003 00000001 f0f6a780 00000fff bfffd118
bfffe118 c01481b2 cf5439b0 00000000 c0162aa0 00000000 bfffe118 c0164453
Call Trace: [<c012bc22>] [<c012e2b3>] [<c01481b2>] [<c0162aa0>] [<c0164453>]
[<c0148262>] [<c014f07e>] [<c0142600>] [<c0108b3b>]

Code: 0f 0b 3e 00 f2 02 29 c0 8b 15 1c 6c 2d c0 8d 41 1c 89 42 04
[<c0148262>] [<c014f07e>] [<c0142600>] [<c0108b3b>]
Code: 0f 0b 3e 00 f2 02 29 c0 8b 15 1c 6c 2d c0 8d 41 1c 89 42 04

>>EIP; c01329ca <lru_cache_add+3a/70> <=====
Trace; c012bc22 <add_to_page_cache_unique+82/90>
Trace; c012e2b3 <read_cache_page+73/120>
Trace; c01481b2 <page_getlink+22/b0>
Trace; c0162aa0 <ext3_readpage+0/20>
Trace; c0164453 <ext3_dirty_inode+a3/100>
Trace; c0148262 <page_readlink+22/90>
Trace; c014f07e <__mark_inode_dirty+2e/a0>
Trace; c0142600 <sys_readlink+80/a0>
Trace; c0108b3b <system_call+33/38>
Code; c01329ca <lru_cache_add+3a/70>
00000000 <_EIP>:
Code; c01329ca <lru_cache_add+3a/70> <=====
0: 0f 0b ud2a <=====
Code; c01329cc <lru_cache_add+3c/70>
2: 3e ds
Code; c01329cd <lru_cache_add+3d/70>
3: 00 f2 add %dh,%dl
Code; c01329cf <lru_cache_add+3f/70>
5: 02 29 add (%ecx),%ch
Code; c01329d1 <lru_cache_add+41/70>
7: c0 8b 15 1c 6c 2d c0 rorb $0xc0,0x2d6c1c15(%ebx)
Code; c01329d8 <lru_cache_add+48/70>
e: 8d 41 1c lea 0x1c(%ecx),%eax
Code; c01329db <lru_cache_add+4b/70>
11: 89 42 04 mov %eax,0x4(%edx)


This is a vanilla 2.4.19 kernel, and we've seen this bug on several machines,
but we haven't been able to find out what triggers it. And I don't see a
BUG-statement at swap.c line 62. So, anyone with an idea of what to do is
welcome with suggestions :)

--
Thomas


2002-10-16 14:32:25

by Emiliano Gabrielli

[permalink] [raw]
Subject: Re: Kernel BUG at swap.c:62 [2.4.19 vanilla]

On 15:01, mercoled? 16 ottobre 2002, Thomas Lang?s wrote:
> Reading Oops report from the terminal
> kernel BUG at swap.c:62!
> kernel BUG at swap.c:62!
> invalid operand: 0000
> CPU: 1
> EIP: 0010:[<c01329ca>] Not tainted
> EFLAGS: 00010202
> invalid operand: 0000

>
> This is a vanilla 2.4.19 kernel, and we've seen this bug on several
> machines, but we haven't been able to find out what triggers it. And I
> don't see a BUG-statement at swap.c line 62. So, anyone with an idea of
> what to do is welcome with suggestions :)

well, the BUG() is inplicit in add_page_to_inactive_list in linux.c:61, this
macro is defined in linux/swap.h:197.

Could this one is a patch ?!?:

@linux/swap.h
#define DEBUG_LRU_PAGE(page) \
do { \
- if (!PageLRU(page)) \
- BUG(); \
- if (PageActive(page)) \
- BUG(); \
+ BUG_ON(!PageLRU(page)) \
+ BUG_ON (PageActive(page)) \
} while (0)

@mm/swap.c
void lru_cache_add(struct page * page)
{
+ spin_lock(&pagemap_lru_lock);
if (!TestSetPageLRU(page)) {
- spin_lock(&pagemap_lru_lock);
add_page_to_inactive_list(page);
- spin_unlock(&pagemap_lru_lock);
}
+ spin_unlock(&pagemap_lru_lock);
}

best reguards

Emiliano 'AlberT' Gabrielli

2002-10-16 14:35:28

by Hugh Dickins

[permalink] [raw]
Subject: Re: Kernel BUG at swap.c:62 [2.4.19 vanilla]

On Wed, 16 Oct 2002, Thomas Lang?s wrote:
> kernel BUG at swap.c:62!

Andrew Morton foresaw that race, and fixed it in 2.4.20-pre3:

--- 2.4.19/mm/swap.c Wed Nov 7 06:44:20 2001
+++ 2.4.20-pre11/mm/swap.c Wed Oct 16 11:18:44 2002
@@ -57,9 +57,10 @@
*/
void lru_cache_add(struct page * page)
{
- if (!TestSetPageLRU(page)) {
+ if (!PageLRU(page)) {
spin_lock(&pagemap_lru_lock);
- add_page_to_inactive_list(page);
+ if (!TestSetPageLRU(page))
+ add_page_to_inactive_list(page);
spin_unlock(&pagemap_lru_lock);
}
}