From nobody@FreeBSD.org  Sun Aug  7 18:27:19 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 79EF416A42D
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  7 Aug 2005 18:27:19 +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 2A23A43ED3
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  7 Aug 2005 18:06:38 +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 j77I6bu2030110
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 7 Aug 2005 18:06:37 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j77I6b20030109;
	Sun, 7 Aug 2005 18:06:37 GMT
	(envelope-from nobody)
Message-Id: <200508071806.j77I6b20030109@www.freebsd.org>
Date: Sun, 7 Aug 2005 18:06:37 GMT
From: Andreas Eder <andreas_eder@gmx.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: kbdmap -r dumps core
X-Send-Pr-Version: www-2.3

>Number:         84652
>Category:       amd64
>Synopsis:       kbdmap -r dumps core
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-amd64
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 07 18:30:21 GMT 2005
>Closed-Date:    Thu Jul 06 11:22:20 GMT 2006
>Last-Modified:  Thu Jul 06 11:22:20 GMT 2006
>Originator:     Andreas Eder
>Release:        5.4-STABLE FreeBSD
>Organization:
>Environment:
FreeBSD staffa.eder.de 5.4-STABLE FreeBSD 5.4-STABLE #0: Sun Jul 31 00:12:59 CEST 2005     root@staffa.eder.de:/usr/obj/usr/src/sys/STAFFA  amd64

>Description:
kbdmap -r gets a segmentation fault and dumps core

gdb /usr/sbin/kbdmap kbdmap.core prints out
Core was generated by `kbdmap'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libc.so.5...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.5
Reading symbols from /libexec/ld-elf.so.1...(no debugging symbols found)...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x00000008006e0fb3 in strdup () from /lib/libc.so.5

>How-To-Repeat:
simply repeat the program invocation
>Fix:
      
>Release-Note:
>Audit-Trail:

From: Vasil Dimov <vd@datamax.bg>
To: bug-followup@FreeBSD.org
Cc: andreas_eder@gmx.net
Subject: Re: amd64/84652: kbdmap -r dumps core
Date: Mon, 10 Oct 2005 15:35:00 +0300

 This problem is not amd64 specific,
 instead it should be in the `bin' category.
 
 parse_args() uses font_current before it is initialized.
 
 --- kbdmap.c-r.diff begins here ---
 --- usr.sbin/kbdmap/kbdmap.c.orig	Mon Oct 10 15:13:05 2005
 +++ usr.sbin/kbdmap/kbdmap.c	Mon Oct 10 15:11:50 2005
 @@ -823,12 +823,12 @@
  
  	program = extract_name(argv[0]);
  
 -	/* Parse command line arguments */
 -	parse_args(argc, argv);
 -
  	font_current = get_font();
  	if (font_current == NULL)
  		font_current = font_default;
 +
 +	/* Parse command line arguments */
 +	parse_args(argc, argv);
  
  	if (strcmp(program, "kbdmap"))
  		dir = fontdir;
 --- kbdmap.c-r.diff ends here ---

From: "Devon O'Dell" <dodell@offmyserver.com>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: amd64/84652: kbdmap -r dumps core
Date: Fri, 4 Nov 2005 20:40:42 -0800

 I have the same issue in -CURRENT/amd64 and it is indeed not specific to
 the amd64 architecture. The patch attached by Vasil Dimov fixes the
 issue for me. The bug should be refiled under bin and the patch supplied
 by Vasil works fine and should be applied :)
 
 --Devon
State-Changed-From-To: open->closed 
State-Changed-By: arved 
State-Changed-When: Thu Jul 6 11:21:41 UTC 2006 
State-Changed-Why:  
This one was committed by flz in January. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=84652 
>Unformatted:
