Bug 8763 - loadkeys dumps core with german keymaps in 6.1
Summary: loadkeys dumps core with german keymaps in 6.1
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: console-tools
Version: 6.1
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-01-23 10:07 UTC by Toni Andjelkovic
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-02-05 18:43:19 UTC
Embargoed:


Attachments (Terms of Use)

Description Toni Andjelkovic 2000-01-23 10:07:27 UTC
this has been tested on i386 Redhat 6.1

the german keymaps in /usr/lib/kbd/keymaps/i386/qwertz
have include statements for files that don't exist, e.g.

include "qwertz-layout" in de.kmap.gz

when "loadkeys" reads the keymap from stdin, like in

$ zcat /usr/lib/kbd/keymaps/i386/qwertz/de.kmap.gz | ./loadkeys

it will dump core due to duplicating a NULL pointer
in find_standard_incl_file()

analyze.l:214
t = xstrdup(filename);

$ gdb loadkeys
[...]
(gdb) set args < de.kmap
(gdb) run
Starting program:
/usr/src/redhat/BUILD/console-tools-1999.03.02/kbdtools/loadkeys < de.kmap

Program received signal SIGSEGV, Segmentation fault.
0x4007568d in __strdup (s=0x0) at strdup.c:42
42      strdup.c: No such file or directory.

(gdb) info stack
#0  0x4007568d in __strdup (s=0x0) at strdup.c:42
#1  0x804f18c in xstrdup ()
#2  0x804d60c in find_standard_incl_file (s=0x80627b8 "qwertz-layout")
    at analyze.l:219
#3  0x804d83d in find_incl_file (s=0x80627b8 "qwertz-layout") at
analyze.l:276
#4  0x804d881 in open_include (s=0x80627b8 "qwertz-layout") at
analyze.l:286
#5  0x804c0fa in yylex () at analyze.l:73
#6  0x804944e in yyparse () at /usr/share/misc/bison.simple:387
#7  0x8049f58 in main (argc=1, argv=0xbffff964) at loadkeys.y:388


this bug is very annoying for german-speaking users.

a quick fix is to comment the include statements in
the german keymap-files, this bug happens only when
loadkeys has to read the map from stdin.

a quick and dirty fix:

--- analyze.l   Mon May 18 23:33:11 1998
+++ analyze.l.new       Sun Jan 23 11:10:37 2000
@@ -211,6 +211,9 @@
     return f;

   /* Try D and D/../include and D/../../include */
+    if(filename == NULL)
+      return (FILE *) 0;
+
   t = xstrdup(filename);
   te = rindex(t, '/');
   if (te)

Comment 1 Bill Nottingham 2000-02-05 18:43:59 UTC
This works OK in the console-tools in Raw Hide.


Note You need to log in before you can comment on or make changes to this bug.