Subject: bin/6431: Garbage text in sysinst error messages
To: None <gnats-bugs@gnats.netbsd.org>
From: Andreas Gustafsson <gson@araneus.fi>
List: netbsd-bugs
Date: 11/12/1998 13:17:34
>Number:         6431
>Category:       bin
>Synopsis:       Garbage text in sysinst error messages
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 12 03:20:01 1998
>Last-Modified:
>Originator:     Andreas Gustafsson
>Organization:
Araneus Information Systems Oy
>Release:        1.3.2
>Environment:

System: NetBSD guava.araneus.fi 1.3.2 NetBSD 1.3.2 (GUAVA) #2: Wed Aug 5 09:44:51 EEST 1998 root@guava.araneus.fi:/z/src-1.3/sys/arch/i386/compile/GUAVA i386


>Description:

When sysinst reports certain error conditions such as a missing
release set file, the error message contains garbage data instead of
the name of the missing file.

This happens because a parameter of type "char" is used as the last
parameter before the variable argument list in ask_ynquestion().
Apparently NetBSD's <stdarg.h> does not deal well with this case.

>How-To-Repeat:

Try to do a full install from a directory with no X11 release set
files.  You will see a confusing error message similar to this one:

   Extracting file /mnt2//i387/binary/sets/text.tgz ...
   Release set ector file is out of order does not exist
   : 

Depending on the phase of the moon, the text "ector file is out of
order" may be replaced with various other random characters.

>Fix:

Apply the following patch, and/or fix stdarg.h such that it works when
the last parameter before the variable argument list is of type "char".

*** src/distrib/utils/sysinst/defs.h~	Sun Jul 12 11:36:06 1998
--- src/distrib/utils/sysinst/defs.h	Thu Nov 12 09:21:46 1998
***************
*** 266,272 ****
  void	get_ramsize __P((void));
  void	ask_sizemult __P((void));
  void	reask_sizemult __P((void));
! int	ask_ynquestion __P((char *quest, char def, ...));
  void	run_makedev __P((void));
  int	get_via_floppy __P((void));
  int	get_via_cdrom __P((void));
--- 266,272 ----
  void	get_ramsize __P((void));
  void	ask_sizemult __P((void));
  void	reask_sizemult __P((void));
! int	ask_ynquestion __P((char *quest, int def, ...));
  void	run_makedev __P((void));
  int	get_via_floppy __P((void));
  int	get_via_cdrom __P((void));


*** src/distrib/utils/sysinst/util.c~	Sun Jul 12 11:36:09 1998
--- src/distrib/utils/sysinst/util.c	Tue Nov 10 14:22:14 1998
***************
*** 129,135 ****
  
  /* Returns 1 for "y" or "Y" and "n" otherwise.  CR => default. */
  int
! ask_ynquestion (char *quest, char def, ...)
  {
  	char line[STRSIZE];
  	va_list ap;
--- 129,135 ----
  
  /* Returns 1 for "y" or "Y" and "n" otherwise.  CR => default. */
  int
! ask_ynquestion (char *quest, int def, ...)
  {
  	char line[STRSIZE];
  	va_list ap;
>Audit-Trail:
>Unformatted: