Skip site navigation (1)Skip section navigation (2)
Date:      Fri,  1 Sep 2000 07:25:34 -0700 (PDT)
From:      O.Hodson@cs.ucl.ac.uk
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/20979: audio/ports/grip - dumping core when CD replaced
Message-ID:  <20000901142534.34DA637B423@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         20979
>Category:       ports
>Synopsis:       audio/ports/grip - dumping core when CD replaced
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 01 07:30:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Orion Hodson
>Release:        4.1R
>Organization:
University College London
>Environment:
FreeBSD adelie.btinteractive.net 4.1-RELEASE FreeBSD 4.1-RELEASE #7: Fri Aug 18 09:24:12 BST 2000     oh@adelie.btinternet.com:/usr/src/sys/compile/ADELIE  i386

>Description:
Grip dumps core when the CD in the ATAPI CD-ROM drive is ejected and replaced.  The CDIOREADTOCHEADER ioctl fails on the second CD, but failures in CD status queries are not checked in the main application.  In this case it leads to a bus error.

Problem experienced with Creative CD2422E and HP CD-RW Plus 7500.

[Apologies if two copies of this pr arrive - no auto response from the first submission]
>How-To-Repeat:
Problem repeats every time user presses eject on the UI and replaces the CD.
>Fix:
Looking at cdcontrol source code it closes and re-opens the device before each CD operation.  Re-opening the device when a new CD is detected fixes the problem with the ATAPI CD drives described.

--- grip-2.94-orig/grip.h       Fri Sep  1 13:36:47 2000
+++ grip-2.94/grip.h    Fri Sep  1 13:44:25 2000
@@ -257,6 +257,7 @@
 /* Low-level cd control routines -- found in cd.c */
 
 int CDInitDevice(char *device_name);
+void CDCloseDevice(int cd_desc);
 int CDStat(int cd_desc,struct disc_info *disc,gboolean read_toc);
 int CDPlayFrames(int cd_desc,int startframe,int endframe);
 int CDPlayTrackPos(int cd_desc,struct disc_info *disc,int starttrack,
--- grip-2.94-orig/cd.c Fri Sep  1 13:36:46 2000
+++ grip-2.94/cd.c      Fri Sep  1 13:42:55 2000
@@ -98,6 +98,11 @@
   return cd_desc;
 }
 
+void CDCloseDevice(int cd_desc)
+{
+  close(cd_desc);
+}
+
 /* Update a CD status structure... because operating system interfaces vary
    so does this function. */
 
--- grip-2.94-orig/grip.c       Fri Sep  1 13:36:47 2000
+++ grip-2.94/grip.c    Fri Sep  1 13:43:37 2000
@@ -1279,6 +1279,12 @@
     CDStat(cd_desc,&info,FALSE);
 
     if(info.disc_present) {
+    /* FreeBSD CD ioctl CDIOREADTOCHEADER fails when old disk is ejected
+     * and a new disk one entered. Re-opening device fixes this.
+     */
+      CDCloseDevice(cd_desc);
+      cd_desc = CDInitDevice(cddevice);
+
       CDStat(cd_desc,&info,TRUE);
 
       Debug("CDStat found a disc, checking tracks\n");


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000901142534.34DA637B423>