From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Sep 20 11:00:26 2005 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 165AF16A421 for ; Tue, 20 Sep 2005 11:00:26 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 94BB243D53 for ; Tue, 20 Sep 2005 11:00:24 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j8KB0OcV014251 for ; Tue, 20 Sep 2005 11:00:24 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j8KB0Osn014250; Tue, 20 Sep 2005 11:00:24 GMT (envelope-from gnats) Resent-Date: Tue, 20 Sep 2005 11:00:24 GMT Resent-Message-Id: <200509201100.j8KB0Osn014250@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Fred Wheeler Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E444416A41F for ; Tue, 20 Sep 2005 10:51:51 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 94D5643D46 for ; Tue, 20 Sep 2005 10:51:51 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j8KAppNn081465 for ; Tue, 20 Sep 2005 10:51:51 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j8KApp1g081464; Tue, 20 Sep 2005 10:51:51 GMT (envelope-from nobody) Message-Id: <200509201051.j8KApp1g081464@www.freebsd.org> Date: Tue, 20 Sep 2005 10:51:51 GMT From: Fred Wheeler To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: ports/86365: port audio/vsound vsound.c fix to prevent abort X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2005 11:00:26 -0000 >Number: 86365 >Category: ports >Synopsis: port audio/vsound vsound.c fix to prevent abort >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Sep 20 11:00:23 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Fred Wheeler >Release: FreeBSD 5.4-RELEASE i386 >Organization: none >Environment: System: FreeBSD mobile.earthlink.net 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Sun May 8 10:21:06 UTC 2005 root@harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: vsound-0.6 seems to have a bug that causes a program run with vsound to bus error if that program opens any file. I see the same problem in the vsound-0.6 source and the audio/vsound port. The problem is with the type given to va_arg. gcc notices the problem and suggests a fix that works for me. >How-To-Repeat: The native audio/vsound port led to a Bus error no matter how I used it. Example: sndfile-play dq.wav would work fine, but vsound sndfile-play dq.wav would Bus error. I have lost the output of the above command. Running vsound on any program that opened a file led to a Bus error, even if the program did not use /dev/dsp. After debugging to isolate the problem at vsound.c line 213 I finally noticed that gcc had already found and solved the problem by giving the following warning. # cd /usr/ports/audio/vsound # make [...] cc -DHAVE_CONFIG_H -I. -I. -I. -g -O -pipe -Wall -Wstrict-prototypes -pipe -c vsound.c -fPIC -DPIC -o .libs/vsound.lo vsound.c: In function `open': vsound.c:213: warning: `mode_t' is promoted to `int' when passed through `...' vsound.c:213: warning: (so you should pass `int' not `mode_t' to `va_arg') vsound.c:213: note: if this code is reached, the program will abort [...] >Fix: I have verified that the following patch fixes the problem on my machine. However, to the level I understand this problem, I don't see how vsound would have worked for anyone on FreeBSD, so I'm suspicious that the problem/fix is really this simple. Perhaps something about gcc or mode_t has changed to create this problem? # diff -C4 vsound.c.bad vsound.c *** vsound.c.bad Mon Sep 19 15:06:43 2005 --- vsound.c Mon Sep 19 15:07:09 2005 *************** *** 209,217 **** dsp_init () ; va_start (args, flags) ; ! mode = va_arg (args, mode_t) ; va_end (args) ; if (strcmp (pathname, "/dev/dsp")) { fd = func_open (pathname, flags, mode) ; --- 209,217 ---- dsp_init () ; va_start (args, flags) ; ! mode = va_arg (args, int) ; va_end (args) ; if (strcmp (pathname, "/dev/dsp")) { fd = func_open (pathname, flags, mode) ; Building vsound from http://www.zorg.org/vsound/vsound-0.6.tar.gz has the exact same proble/fix on my system. >Release-Note: >Audit-Trail: >Unformatted: