[Bug 3944] New: identically named symbols overlap and break at runtime

bugzilla-daemon at icculus.org bugzilla-daemon at icculus.org
Wed Jan 21 13:04:15 EST 2009


           Summary: identically named symbols overlap and break at runtime
           Product: Quake 3
           Version: SVN HEAD
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Misc
        AssignedTo: zakk at icculus.org
        ReportedBy: pip88nl at gmail.com
         QAContact: quake3-bugzilla at icculus.org

when using native code (vm_* = 0), the core loads qagame$platform.so (where
$platform is i386 on my machine). this shared library contains the symbol
bot_developer, which is an int, defined in game/ai_main.c.

the ioquake3 binary also contains a symbol with the same name, defined in
botlib/be_interface.c and used to store a configuration variable. the dynamic
loading overwrites references to the symbol and subsequent writes to the
configuration variable occur in the wrong memory, overwriting the bot_developer
int from "game" and 252 bytes after it. those bytes are part of "botimport",
used to export symbols to botlib. an attempt to use a function from botimport
(such as botimport.GetMemory) results in a segmentation fault or (depending on
compile flags and the actual bytes written (usually '\0') an assertion failure)

a workaround is to enable the compiler flag -fvisibility=hidden to only export
symbols that are explicitly marked with __attribute__ ((__visibility__

the real fix is probably to rename one of the symbols.

Configure bugmail: http://bugzilla.icculus.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the quake3-bugzilla mailing list