Skip to contentSkip to conversation

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

DISCUSSION Thomas Langås 3 participants 3 messages Oct 16, 2002 Memory management

lore
Share & tools
lore
#0 lore raw

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  
Quoted 1 line
Quoted 1 line

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 :)

Signature · 1 line
Thomas
#1 lore raw
Quoted 10 lines · Thomas Langås

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
Quoted 4 lines

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

#2 lore raw
In reply to Thomas Langås
Quoted 1 line · Thomas Langås

kernel BUG at swap.c:62!

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

mm/swap.c +3 -2
@@ -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);
 	}
 }