Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Feb 2005 07:14:40 GMT
From:      Axel Gonzalez <loox@e-shell.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/77479: sysutils/lineakd fails to run on AMD64 [patch]
Message-ID:  <200502140714.j1E7Eext060510@www.freebsd.org>
Resent-Message-ID: <200502140720.j1E7KJTV081314@freefall.freebsd.org>

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

>Number:         77479
>Category:       ports
>Synopsis:       sysutils/lineakd fails to run on AMD64 [patch]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 14 07:20:19 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Axel Gonzalez
>Release:        5.3-STABLE
>Organization:
>Environment:
FreeBSD moonlight.e-shell.net 5.3-STABLE FreeBSD 5.3-STABLE #0: Thu Feb  3 23:08:02 CST 2005     loox@moonlight.e-shell.net:/usr/obj/usr/src/sys/LXAMD64  amd64
>Description:
Make and install of lineakd goes well, but when you try to run, you get endless messages like:

$ lineakd -l
Attempted to add an empty toggle name:  to object: Back
Attempted to add an empty toggle name:  to object: Back
Attempted to add an empty toggle name:  to object: Back
..

(listing the keyboards, or trying to run the daemon)

CPU usage goes to 100%
>How-To-Repeat:
Install lineakd from ports

$ lineakd -l

or

$ lineakd
>Fix:
The problem is due to a bug in the routine that loads the keyboards list (lineakkb.def).

At some point it tries to compare 32 unsigned int to 64 bit unsigned it, the result is 2^32-1 != 2^64-1, so it fails, and gets in an endless loop.

This patch fixes the problem (and should be ok with 32 bits platforms):

**** begin patch-lineak__defloader.cpp ***
--- lineak/defloader.cpp.orig   Sun Feb 13 23:54:36 2005
+++ lineak/defloader.cpp        Sun Feb 13 23:54:57 2005
@@ -157,13 +157,13 @@
                 //cout << akey;
                 /** Now determine if this is a toggleable key. We will have toparse
                     the name format name1|name2 if indeed it is a toggleable key. */
-                if ((unsigned int)key.find('|') != string::npos) {
+                if ((unsigned int)key.find('|') != (unsigned int)string::npos){
                    key+='|';
                    akey->setToggle(true);
                    int index;
                    string tmp;
                    //vector<string>names;
-                   while (((unsigned int)(index = key.find('|'))) != string::npos) {
+                   while (((unsigned int)(index = key.find('|'))) != (unsignedint)string::npos) {
                       tmp = key.substr(0,index);
                       //cout << "adding toggle name: " << tmp << " to " << akey->getName() << endl;
                        akey->addToggleName(tmp);
**** end patch-lineak__defloader.cpp ***
>Release-Note:
>Audit-Trail:
>Unformatted:



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