Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Feb 2007 14:53:52 -0500 (EST)
From:      Jason DiCioccio <jd@ods.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        misc@ods.org
Subject:   ports/109260: sysutils/installwatch Bus Error
Message-ID:  <20070217195352.5568FC9A50@update.ods.org>
Resent-Message-ID: <200702172020.l1HKK3F3057445@freefall.freebsd.org>

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

>Number:         109260
>Category:       ports
>Synopsis:       sysutils/installwatch Bus Error
>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:   Sat Feb 17 20:20:02 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Jason DiCioccio
>Release:        FreeBSD 6.2-RELEASE i386
>Organization:
Open Domain Service
>Environment:
System: FreeBSD update.ods.org 6.2-RELEASE FreeBSD 6.2-RELEASE #4: Mon Jan 15 18:22:54 EST 2007 geniusj@update.ods.org:/usr/obj/usr/src/sys/UPDATE i386


	
>Description:
	
When compiling installwatch from ports, the following warnings appear:
installwatch.c: In function `open':
installwatch.c:577: warning: `mode_t' is promoted to `int' when passed through `...'
installwatch.c:577: warning: (so you should pass `int' not `mode_t' to `va_arg')
installwatch.c:577: note: if this code is reached, the program will abort

The threat made by gcc on the last line is not an empty one.  When using
installwatch, it will exit with a bus error.

>How-To-Repeat:
	
Install installwatch on FreeBSD 6.2, try to use it.
>Fix:
	
There's probably a better way to fix this, but as mode is defined as an int
in vfs_syscalls.c, I figured I'd just duplicate it here.  It quickly alleviated
the issue on my end.

diff -urN installwatch.orig/files/patch-installwatch.c installwatch/files/patch-installwatch.c
--- installwatch.orig/files/patch-installwatch.c	Wed Dec 31 19:00:00 1969
+++ installwatch/files/patch-installwatch.c	Sat Feb 17 14:46:14 2007
@@ -0,0 +1,11 @@
+--- installwatch.c.orig	Sat Feb 17 14:45:22 2007
++++ installwatch.c	Sat Feb 17 14:45:47 2007
+@@ -574,7 +574,7 @@
+ 
+ 	REFCOUNT;
+ 	va_start(ap, flags);
+-	mode = va_arg(ap, mode_t);
++	mode = va_arg(ap, int);
+ 	va_end(ap);
+ 	canonicalize(pathname, canonic);
+ 



!DSPAM:2756,45d75d51678051410918767!


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



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