xmcd now requires ATAPICAM for IDE CD-ROM?

Daniel Eischen eischen at vigrid.com
Sun Apr 18 09:45:48 PDT 2004


On Sun, 18 Apr 2004, Conrad J. Sabatier wrote:

> The latest version of xmcd segfaults when I try to run cda (under 
> FreeBSD 5.2-CURRENT), just after reading (or attempting to read) 
> /etc/nsswitch.conf, it looks like.
> 
> I'm not using ATAPICAM in my kernel, but browsing through the port, it looks 
> like there may be a dependency on CAM(?).
> 
> Any ideas, anyone?

It seems to segfault at cdinfo_d/cdinfo_x.c at line 3177:

			if (newmenu) {
->				if (cdinfo_dbp->wwwwarp_list == NULL)
					cdinfo_dbp->wwwwarp_list = wp1 = wp;
				else {
					wp1->nextmenu = wp;
					wp1 = wp;
				}
			}

with a null pointer dereference.

I poked around a little and cdinfo_dbp is setup by calling
cdinfo_init() which seems to be done after cdinfo_wwwwarp_parmload()
is called (where it segfaults).

This patch seems to fix it for me, but the author should take
a look at it.  Perhaps we're doing something else wrong...

-- 
Dan Eischen

[ add the patch to ports/audio/xmcd/patch-ai ]

--- cda_d/cda.c.orig	Sun Apr 18 12:02:09 2004
+++ cda_d/cda.c	Sun Apr 18 12:02:39 2004
@@ -7716,9 +7716,6 @@
 	(void) sprintf(path, USR_CMCFG_PATH, hd);
 	di_common_parmload(path, FALSE, FALSE);
 
-	/* Set up basic wwwWarp structure */
-	cdinfo_wwwwarp_parmload();
-
 	if (app_data.device != NULL &&
 	    (int) strlen(app_data.device) >= FILE_PATH_SZ)
 		CDA_FATAL(app_data.str_longpatherr);
@@ -7757,6 +7754,9 @@
 	cdinfo_cldata.fatal_msg = cda_fatal_msg;
 	cdinfo_cldata.warning_msg = cda_warning_msg;
 	cdinfo_init(&cdinfo_cldata);
+
+	/* Set up basic wwwWarp structure */
+	cdinfo_wwwwarp_parmload();
 
 #ifndef NOVISUAL
 	if (visual) {




More information about the freebsd-ports mailing list