Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 238929

Summary: net-irc/eggdrop: Portability issue with brain files for megahal module
Product: Gentoo Linux Reporter: Torbjörn Lönnemark <tobbez>
Component: Current packagesAssignee: Louis Sautier (sbraz) <sbraz>
Status: RESOLVED OBSOLETE    
Severity: enhancement CC: net-irc, proxy-maint
Priority: High Keywords: NeedPatch
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Torbjörn Lönnemark 2008-09-28 10:42:16 UTC
When trying to use a brain file generated on x86 on amd64 eggdrop segfaults.

Reproducible: Always

Steps to Reproduce:
1. Create brain file on x86.
2. Move brain file to amd64 and try to load it.
Actual Results:  
Segfaults, or exits with the following error if compiled with USE="debug":
[12:36] Creating megahal (type 1)
[12:36] Creating learnall (type 1)
[12:36] Creating freespeak (type 1)
[12:36] *** MEMORY TABLE FULL: megahal:megahal.c (1275)
[12:36] * Memory table full


Expected Results:  
The file should load fine.

This error is because of the following code in megahal.h(75):
#define BYTE4 unsigned long
This should instead be
#define BYTE4 uint32_t
and an additional include of stdint.h should be added.
Comment 1 Pacho Ramos gentoo-dev 2012-10-06 12:52:16 UTC
Still valid with 1.6.21?
Comment 2 Torbjörn Lönnemark 2012-10-06 16:49:46 UTC
Should be. The source for the megahal module is in a patch provided by Gentoo and not by upstream, and that patch has not changed.

That patch is patch/10_all_megahal.mod-2.7.patch from eggdrop-patches-${PATCHSET_V}.tar.bz2.
Comment 3 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2012-10-17 19:19:12 UTC
Looks like this currently applies to all versions.

Compounding this problem is that the megahal module also forgets to htonl() and ntohl(). I think this should cause the same problem when going between big and little endian machines.
Comment 4 Louis Sautier (sbraz) gentoo-dev 2018-10-26 08:37:11 UTC
All thirdparty modules has been removed.
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=758962f595fd876bef0d00e5ba392c1b925aa0c8
Author: Louis Sautier <sbraz@gentoo.org>
Date:   Fri Oct 26 10:32:23 2018 +0200

    net-irc/eggdrop: remove ancient version

    Signed-off-by: Louis Sautier <sbraz@gentoo.org>
    Package-Manager: Portage-2.3.51, Repoman-2.3.11