From nobody@www.freebsd.org  Fri Jun  7 07:20:32 2002
Return-Path: <nobody@www.freebsd.org>
Received: from nwww.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by hub.freebsd.org (Postfix) with ESMTP id 247F937B407
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  7 Jun 2002 07:20:32 -0700 (PDT)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by nwww.freebsd.org (8.12.2/8.12.2) with ESMTP id g57EKUhG008513
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 7 Jun 2002 07:20:30 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.2/8.12.2/Submit) id g57EKTvX008512;
	Fri, 7 Jun 2002 07:20:30 -0700 (PDT)
Message-Id: <200206071420.g57EKTvX008512@www.freebsd.org>
Date: Fri, 7 Jun 2002 07:20:30 -0700 (PDT)
From: Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Kernel fails to access disk
X-Send-Pr-Version: www-1.0

>Number:         38983
>Category:       kern
>Synopsis:       Kernel fails to access disk
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 07 07:30:02 PDT 2002
>Closed-Date:    Fri Nov 16 11:19:37 UTC 2007
>Last-Modified:  Fri Nov 16 11:20:02 UTC 2007
>Originator:     Aggelos Economopoulos
>Release:        FreeBSD -stable
>Organization:
>Environment:
FreeBSD erwin.gr 4.6-RC FreeBSD 4.6-RC #0: Tue Jun  4 07:05:31 EEST 2002 root@erwin.gr:/usr/obj/usr/src/sys/CUSTOM i386

>Description:
On attempting to access a new 40G ide disk(ad3) from my -stable installation on ad0,
I get a kernel error message about "excessive recursion in search for slices". This occurs
in *any* access e.g. read(2) on /dev/ad3, mount(2) /dev/ad3s1, fdisk -s /dev/ad3 etc.
However,
a) there does not seem be a hardware problem, since I have a fully functioning linux
installation on ad3
b) the mbr partition table of ad3 and the extended partition tables of ad3 are valid. Using
a userspace partition viewer, I can get sane results and identical to those of the linux kernel.
But, the same program when run under FreeBSD gets into an infinite loop (since it does not use
recursion like sys/kern/subr_diskmbr.c does), while I (of course) get the kernel error messages.
Do _not_ consider this a fact, but I think that a read(2) while following the extended pt chain returns
sector 0 (that is, the mbr of ad3)
c) the kernel seems to get the disk characteristics right. Inserting a printf in subr_diskmbr.c I
have verified that the d_secperunit field in the disklabel for ad3 is the same value as the one
reported by the linux kernel.
d) This is not a cvsup at a bad time. I have been able to repeat the problem with all the kernels
I have built in the two weeks I have spent in subr_diskmbr.c thinking it was a problem with the
partition handling code.

So, I can only attribute this to a bug in the block i/o layer or the ide code. Right now, I am without
a clue about how to go on in search of the cause of this.
>How-To-Repeat:
I haven't tried to repeat the problem using the disk on another freebsd installation.
>Fix:
!clue
>Release-Note:
>Audit-Trail:

From: Ian Dowse <iedowse@maths.tcd.ie>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/38983: Kernel fails to access disk 
Date: Fri, 07 Jun 2002 18:21:33 +0100

 In message <200206071420.g57EKTvX008512@www.freebsd.org>, Aggelos Economopoulos
  writes:
 >On attempting to access a new 40G ide disk(ad3) from my -stable installation o
 >n ad0,
 >I get a kernel error message about "excessive recursion in search for slices".
 
 If these commands work, could you post the output of `fdisk ad3'
 and `fdisk ad3sX' where `X' is each extended partition in ad3?
 
 I haven't looked at the code, but the most likely explanation is
 that you have an extended partition within an extended partition
 that has the `start' set to 0. That would cause this error because
 the extended partition points at itself.
 
 Ian

From: =?iso-8859-7?b?tuPj5evv8iDP6erv7e/s/PDv9evv8g==?= <aoiko@cc.ece.ntua.gr>
To: freebsd-gnats-submit@FreeBSD.org
Cc: iedowse@maths.tcd.ie
Subject: Re: kern/38983: Kernel fails to access disk
Date: Sat, 8 Jun 2002 10:09:36 +0300

 Ian Dowse wrote:
 
 (being cc'ed would be nice, thanks)
 
 >  >On attempting to access a new 40G ide disk(ad3) from my -stable
 >  >installation o n ad0,
 >  >I get a kernel error message about "excessive recursion in search for
 >  >slices".
 > =20
 >  If these commands work, could you post the output of `fdisk ad3'
 >  and `fdisk ad3sX' where `X' is each extended partition in ad3?
 
 
 This does not lead anyware. As I have pointed out in the pr,
 a piece of code which can parse the partition structure under linux, gets=
 =20
 confused when run under freebsd, so the problem has to be at a lower
 level. But, here you go anyway:
 
 this is the output for /dev/ad3s5
 /dev/ad3s5: 1 cyl 1 hd 1 sec
 Part        Start        Size Type Flags
    1:          63     3905937 0x83 0x00
    2:    62500032     5859504 0x83 0x00
    3:    68359536     9805824 0x83 0x00
    4:     3906000    28395360 0x05 0x00
 same for sX, X>5, since fdisk fails with "can't get disk parameters"(fail=
 ed=20
 ioctl) when run on *any* slice (s1, s2, ...) but does not fail for ad3:
 /dev/ad3: 77545 cyl 16 hd 63 sec
 Part        Start        Size Type Flags
    1:          63     3905937 0x83 0x00
    2:    62500032     5859504 0x83 0x00
    3:    68359536     9805824 0x83 0x00
    4:     3906000    28395360 0x05 0x00
 
 but failure getting slice geometry seems natural to me...(anyway,you aske=
 d=20
 for it, you got it)
 
 > =20
 >  I haven't looked at the code, but the most likely explanation is
 >  that you have an extended partition within an extended partition
 >  that has the `start' set to 0. That would cause this error because
 >  the extended partition points at itself.
 
 No. All my extended partition tables point to 0x05 and have start set to =
 63.
 Somewhat trimmed kernel messages follow:
 ########################################################
 Jun  7 22:21:59 erwin /kernel: ad3s7: slice extends beyond end of disk:=20
 truncating from 9805824 to 5899824 sectors
 Jun  7 22:21:59 erwin /kernel: ad3s10: slice extends beyond end of disk:=20
 truncating from 9805824 to 1993824 sectors
 Jun  7 22:21:59 erwin /kernel: ad3s13: slice extends beyond end of disk:=20
 truncating from 9805824 to 1993824 sectors
 Jun  7 22:21:59 erwin /kernel: ad3s16: slice extends beyond end of disk:=20
 truncating from 9805824 to 1993824 sectors
 Jun  7 22:21:59 erwin /kernel: ad3s19: slice extends beyond end of disk:=20
 truncating from 9805824 to 1993824 sectors
 Jun  7 22:21:59 erwin /kernel: ad3s22: slice extends beyond end of disk:=20
 truncating from 9805824 to 1993824 sectors
 Jun  7 22:21:59 erwin /kernel: ad3s25: slice extends beyond end of disk:=20
 truncating from 9805824 to 1993824 sectors
 Jun  7 22:21:59 erwin /kernel: ad3s28: slice extends beyond end of disk:=20
 truncating from 9805824 to 1993824 sectors
 Jun  7 22:21:59 erwin /kernel: ad3s31: too many slices
 =2E..
 Jun  7 22:21:59 erwin /kernel: ad3s49: too many slices
 Jun  7 22:21:59 erwin /kernel: ad3: excessive recursion in search for=20
 slices; aborting search
 ##########################################################
 
 Thanks for trying to help anyway!
 
 --=20
 Use self-identifying input.  Allow defaults.  Echo both on output.
             - The Elements of Programming Style (Kernighan & Plaugher)
 

From: Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: kern/38983: Kernel fails to access disk
Date: Tue, 18 Jun 2002 02:25:32 +0300

 Just to address all the ideas that seem to take over in people's heads=20
 (partition code gives error message? you must have linuxisms on your=20
 partition tables, else it is corrupt) preventing them from thinking,
 I can reproduce the bogus results from accesses to my functioning ide dis=
 k=20
 using a 3-entry partition table in the mbr.
 
State-Changed-From-To: open->feedback 
State-Changed-By: kmacy 
State-Changed-When: Fri Nov 16 04:32:43 UTC 2007 
State-Changed-Why:  

May no longer apply. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=38983 
State-Changed-From-To: feedback->closed 
State-Changed-By: kmacy 
State-Changed-When: Fri Nov 16 11:19:03 UTC 2007 
State-Changed-Why:  

Submitter says that the hardware in question has long since died. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=38983 

From: Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>
To: bug-followup@freebsd.org
Cc: kmacy@freebsd.org
Subject: Re: kern/38983: Kernel fails to access disk
Date: Fri, 16 Nov 2007 13:58:16 +0300

 Well, the motherboard in question died in 2004, I think, and the disk didn't 
 last much longer either. So, no, it's not still a problem. Except sometimes 
 when a similar hardware problem brings back the memories and I remember how 
 young I was back then. Snif. Why did you have to remind me? ;)
>Unformatted:
Is this still a problem?
