From nobody@FreeBSD.org  Thu Apr 26 19:28:01 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A14C5106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 26 Apr 2012 19:28:01 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 8C6CD8FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 26 Apr 2012 19:28:01 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q3QJS1qb012988
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 26 Apr 2012 19:28:01 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q3QJS1JC012987;
	Thu, 26 Apr 2012 19:28:01 GMT
	(envelope-from nobody)
Message-Id: <201204261928.q3QJS1JC012987@red.freebsd.org>
Date: Thu, 26 Apr 2012 19:28:01 GMT
From: "Michael L. Semon" <mlsemon35@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: cdcontrol: play nonexistent audio track causes kernel trap 12
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         167340
>Category:       kern
>Synopsis:       [panic] cdcontrol: play nonexistent audio track causes kernel trap 12
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    tijl
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 26 19:30:18 UTC 2012
>Closed-Date:    Tue Sep 25 15:47:49 CEST 2012
>Last-Modified:  Tue Sep 25 15:47:49 CEST 2012
>Originator:     Michael L. Semon
>Release:        9.0
>Organization:
>Environment:
(sorry, forgot this one, it's a default FreeBSD 9.0 install on a Pentium III/500 PC)
>Description:
Suppose I have an audio CD with 15 tracks on it.  To issue commands like "cdcontrol 16" or "cdcontrol 32" or "cdcontrol 'play 19'" causes FreeBSD to stop immediately.  Not copying the entire screen by hand, I boil it down to this:

kernel trap 12 with interrupts disabled

Fatal trap 12: page fault while in kernel mode

fault virtual address = 0x2c
fault code =  supervisor write, page not present

This PC is a boat anchor (Pentium III/500, ATAPI CD-ROM, all older ATA drives of the non-serial variety), so all I ask is that you try to duplicate the problem on your modern hardware.  If you can't reproduce the problem, I'll strive to be really careful when using cdcontrol.

Going back to FreeBSD 6.2 or 6.3, I've never had a crash of any kind from cdcontrol until now...and I've made many, many data entry mistakes with cdcontrol.
>How-To-Repeat:
1) Insert an audio disc into an older ATAPI CD-ROM drive.

2) Get cdcontrol to play a track that doesn't exist, like 'cdcontrol 180'.  You should get a healthy error message, not a halted PC.
>Fix:


>Release-Note:
>Audit-Trail:

From: Remko Lodder <remko@elvandar.org>
To: Michael L. Semon <mlsemon35@gmail.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: i386/167340: cdcontrol: play nonexistent audio track causes kernel trap 12
Date: Fri, 27 Apr 2012 08:14:40 +0200

 Hello Michael,
 
 It's difficult to reproduce such a thing when it can depend on many many =
 different factors (motherboard vendor, cd drive vendor, cpu vendor etc).
 What would be more reasonable is that you try to get a kernel dump, =
 which we can use to look into the problem you are mentioning, this =
 kernel
 dump includes information about what triggered the error, the code path =
 and the like.
 
 You can find more information here: =
 http://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug.html
 
 If you cannot do this, we need to suspend the ticket, till someone can =
 reproduce this and deliver the required information
 so that the developers can have a look at this :)
 
 Thank you very much for making FreeBSD better!
 
 
 --=20
 /"\   With kind regards,			| remko@elvandar.org
 \ /   Remko Lodder			| remko@FreeBSD.org
 X    FreeBSD					| =
 http://www.evilcoder.org
 / \   The Power to Serve		| Quis custodiet ipsos custodes
 
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Mon Jul 23 01:06:21 UTC 2012 
State-Changed-Why:  
reclassify and note that feedback was requested. 


Responsible-Changed-From-To: freebsd-i386->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Jul 23 01:06:21 UTC 2012 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=167340 
State-Changed-From-To: feedback->patched 
State-Changed-By: tijl 
State-Changed-When: Thu Sep 20 09:10:38 CEST 2012 
State-Changed-Why:  
Patch committed in r240701. 


Responsible-Changed-From-To: freebsd-bugs->tijl 
Responsible-Changed-By: tijl 
Responsible-Changed-When: Thu Sep 20 09:10:38 CEST 2012 
Responsible-Changed-Why:  
Patch committed in r240701. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/167340: commit references a PR
Date: Tue, 25 Sep 2012 13:32:20 +0000 (UTC)

 Author: tijl
 Date: Tue Sep 25 13:32:05 2012
 New Revision: 240919
 URL: http://svn.freebsd.org/changeset/base/240919
 
 Log:
   MFC r240701:
   
   Fix a panic when trying to play invalid audio tracks.
   
   PR:		kern/167340
   Reported by:	Michael L. Semon <mlsemon35 gmail com>
 
 Modified:
   stable/9/sys/cam/scsi/scsi_cd.c
 Directory Properties:
   stable/9/sys/   (props changed)
 
 Modified: stable/9/sys/cam/scsi/scsi_cd.c
 ==============================================================================
 --- stable/9/sys/cam/scsi/scsi_cd.c	Tue Sep 25 12:45:41 2012	(r240918)
 +++ stable/9/sys/cam/scsi/scsi_cd.c	Tue Sep 25 13:32:05 2012	(r240919)
 @@ -1990,6 +1990,7 @@ cdioctl(struct disk *dp, u_long cmd, voi
  			 	 || (st > (softc->toc.header.ending_track -
  				     softc->toc.header.starting_track))) {
  					error = EINVAL;
 +					cam_periph_unlock(periph);
  					break;
  				}
  				sentry = &softc->toc.entries[st].addr;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/167340: commit references a PR
Date: Tue, 25 Sep 2012 13:34:20 +0000 (UTC)

 Author: tijl
 Date: Tue Sep 25 13:34:09 2012
 New Revision: 240920
 URL: http://svn.freebsd.org/changeset/base/240920
 
 Log:
   MFC r240701:
   
   Fix a panic when trying to play invalid audio tracks.
   
   PR:		kern/167340
   Reported by:	Michael L. Semon <mlsemon35 gmail com>
 
 Modified:
   stable/8/sys/cam/scsi/scsi_cd.c
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/cam/   (props changed)
 
 Modified: stable/8/sys/cam/scsi/scsi_cd.c
 ==============================================================================
 --- stable/8/sys/cam/scsi/scsi_cd.c	Tue Sep 25 13:32:05 2012	(r240919)
 +++ stable/8/sys/cam/scsi/scsi_cd.c	Tue Sep 25 13:34:09 2012	(r240920)
 @@ -1962,6 +1962,7 @@ cdioctl(struct disk *dp, u_long cmd, voi
  			 	 || (st > (softc->toc.header.ending_track -
  				     softc->toc.header.starting_track))) {
  					error = EINVAL;
 +					cam_periph_unlock(periph);
  					break;
  				}
  				sentry = &softc->toc.entries[st].addr;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: tijl 
State-Changed-When: Tue Sep 25 15:45:50 CEST 2012 
State-Changed-Why:  
Merged to stable/9 and stable/8. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=167340 
>Unformatted:
