linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: 2.5.40-ac4  kernel BUG at slab.c:1477!
@ 2002-10-06 13:31 Manfred Spraul
  2002-10-06 22:43 ` Murray J. Root
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Manfred Spraul @ 2002-10-06 13:31 UTC (permalink / raw)
  To: Murray J. Root, linux-kernel, Andre Hedrick

[-- Attachment #1: Type: text/plain, Size: 941 bytes --]

 > This happens at random during boot when loading modules.
 > About half of the time ide-scsi works fine.
 > The system continues to boot after the BUG with /dev/hdc unaccessible.

from mm/slab.c:

1475 if (xchg((unsigned long *)objp, RED_MAGIC1) != RED_MAGIC2)
1476     /* Either write before start, or a double free. */
1477     BUG();

You run an uniprocessor kernel, with slab debugging enabled, and the 
red-zoning test notices a write before the beginning of the buffer 
during scsi_probe_and_add_lun, with ide-scsi.

Andre: Do you know if ide-scsi makes any assumptions about memory 
alignment of the input buffers? With slab debugging disabled, the 
alignment is 32 or 64 bytes, with debugging enabled, it's just 4 byte 
[actually sizeof(void*)] aligned.

Murray, could you apply the attached patch? It dumps the redzone value 
during scsi_probe_and_add_lun. Hopefully this will help to find who 
corrupts the buffers.

--
	Manfred

[-- Attachment #2: patch-scsi-debug --]
[-- Type: text/plain, Size: 1400 bytes --]

--- 2.5/drivers/scsi/scsi_scan.c	Sun Sep 22 06:25:17 2002
+++ build-2.5/drivers/scsi/scsi_scan.c	Sun Oct  6 14:21:58 2002
@@ -1526,8 +1526,9 @@
 			      GFP_DMA : 0);
 	if (scsi_result == NULL)
 		goto alloc_failed;
-
+printk(KERN_INFO"scsi_result: %p, start %lxh.\n",scsi_result, ((unsigned long*)scsi_result)[-1]);
 	scsi_probe_lun(sreq, scsi_result, &bflags);
+printk(KERN_INFO"scsi_result: %p, start %lxh.\n",scsi_result, ((unsigned long*)scsi_result)[-1]);
 	if (sreq->sr_result)
 		res = SCSI_SCAN_NO_RESPONSE;
 	else {
@@ -1550,8 +1551,10 @@
 					" no device added\n"));
 			res = SCSI_SCAN_TARGET_PRESENT;
 		} else {
+printk(KERN_INFO"scsi_result: %p, start %lxh.\n",scsi_result, ((unsigned long*)scsi_result)[-1]);
 			res = scsi_add_lun(sdevscan, &sdev, sreq, scsi_result,
 					   &bflags);
+printk(KERN_INFO"scsi_result: %p, start %lxh.\n",scsi_result, ((unsigned long*)scsi_result)[-1]);
 			if (res == SCSI_SCAN_LUN_PRESENT) {
 				BUG_ON(sdev == NULL);
 				if ((bflags & BLIST_KEY) != 0) {
@@ -1574,9 +1577,13 @@
 			}
 		}
 	}
+printk(KERN_INFO"scsi_result: %p, start %lxh.\n",scsi_result, ((unsigned long*)scsi_result)[-1]);
 	kfree(scsi_result);
+printk(KERN_INFO"after kfree\n");
 	scsi_release_request(sreq);
+printk(KERN_INFO"after release_request\n");
 	scsi_release_commandblocks(sdevscan);
+printk(KERN_INFO"after release_commandblocks\n");
 	return res;
 
 alloc_failed:

^ permalink raw reply	[flat|nested] 7+ messages in thread
* 2.5.40-ac4  kernel BUG at slab.c:1477!
@ 2002-10-06  6:58 Murray J. Root
  0 siblings, 0 replies; 7+ messages in thread
From: Murray J. Root @ 2002-10-06  6:58 UTC (permalink / raw)
  To: linux-kernel

ASUS P4S533 (SiS645DX chipset)
P4 2Ghz
1G PC2700 RAM
NVidia GeForce2 GTS (XFree86 driver, not nvidia binary)
hda: Maxtor 4G100J5, ATA DISK drive
hdc: LG CD-RW CED-8120B, ATAPI CD/DVD-ROM drive
hdd: SAMSUNG DVD-ROM SD-616T, ATAPI CD/DVD-ROM drive

This happens at random during boot when loading modules.
About half of the time ide-scsi works fine. 
The system continues to boot after the BUG with /dev/hdc unaccessible.

>From /var/log/messages:

 SCSI subsystem driver Revision: 1.00
 scsi0 : SCSI host adapter emulation for IDE ATAPI devices
 scsi_eh_offline_sdevs: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 0 lun 0
   Vendor:           Model:                   Rev:     
   Type:   Direct-Access                      ANSI SCSI revision: 00
 hdc: lost interrupt
 hdc: status timeout: status=0xd0 { Busy }
 hdc: DMA disabled
 hdc: drive not ready for command
 hdc: ATAPI reset complete
 ------------[ cut here ]------------
 kernel BUG at slab.c:1477!
 invalid operand: 0000
 ide-scsi scsi_mod rtc  
 CPU:    0
 EIP:    0060:[<c01365ee>]    Not tainted
 EFLAGS: 00010016
 EIP is at kmem_cache_free_one+0x7e/0x240
 eax: 5a2cf071   ebx: c1009c10   ecx: f7561e90   edx: c1b0d5fc
 esi: c038c080   edi: c038c000   ebp: f7561e28   esp: f7561e04
 ds: 0068   es: 0068   ss: 0068
 Process insmod (pid: 257, threadinfo=f7560000 task=f7599b00)
 Stack: 742f3073 65677261 6c2f3074 00306e75 c038c000 c1b0d5fc c1009c10 c038c084 
        00009c10 f7561e48 c0135bcf c1b0d5fc c038c084 00000286 f7cd3600 c1b616b4 
        c038c084 f7561e7c fa8eee32 c038c084 f7561e68 c1b616b4 c038c084 f7561e6c 
 Call Trace:
  [<c0135bcf>]kfree+0x5f/0xb0
  [<fa8eee32>]scsi_probe_and_add_lun+0x92/0x190 [scsi_mod]
  [<fa8ef08e>]scsi_scan_target+0x4e/0x90 [scsi_mod]
  [<fa8ef301>]scan_scsis+0x91/0x17c [scsi_mod]
  [<fa8f8d92>].rodata.str1.32+0x392/0x3e6 [ide-scsi]
  [<fa8e79d2>]scsi_register_host_Rb0dc194c+0x222/0x350 [scsi_mod]
  [<fa8f84fe>]init_module+0x1e/0x30 [ide-scsi]
  [<fa8f96c0>]idescsi_template+0x0/0x80 [ide-scsi]
  [<c011ab1c>]sys_init_module+0x53c/0x690
  [<fa8f7060>]idescsi_discard_data+0x0/0x40 [ide-scsi]
  [<fa8f89cf>]__ksymtab+0x0/0x31 [ide-scsi]
  [<fa8f8fac>].kmodtab+0x0/0xc [ide-scsi]
  [<fa8f7060>]idescsi_discard_data+0x0/0x40 [ide-scsi]
  [<c010781b>]syscall_call+0x7/0xb
 
 Code: 0f 0b c5 05 07 ba 2e c0 8b 4d f0 89 f2 b8 71 f0 2c 5a 8b 59 

-- 
Murray J. Root
------------------------------------------------
DISCLAIMER: http://www.goldmark.org/jeff/stupid-disclaimers/
------------------------------------------------
Mandrake on irc.freenode.net:
  #mandrake & #mandrake-linux = help for newbies 
  #mdk-cooker = Mandrake Cooker 


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-10-08  2:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-06 13:31 2.5.40-ac4 kernel BUG at slab.c:1477! Manfred Spraul
2002-10-06 22:43 ` Murray J. Root
2002-10-08  2:58   ` Murray J. Root
2002-10-06 23:15 ` Murray J. Root
2002-10-07  1:48 ` Andre Hedrick
2002-10-07 15:43   ` Manfred Spraul
  -- strict thread matches above, loose matches on Subject: below --
2002-10-06  6:58 Murray J. Root

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).