ports/77479: sysutils/lineakd fails to run on AMD64 [patch]
Axel Gonzalez
loox at e-shell.net
Mon Feb 14 07:20:20 UTC 2005
>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 at 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:
More information about the freebsd-ports-bugs
mailing list