[quake3] Re: Quake3 client + server on Solaris/Sparc

vincent at cojot.name vincent at cojot.name
Thu Nov 10 14:56:44 EST 2005


Hi Ludwig and Tim,

On Wed, 9 Nov 2005, Ludwig Nussel wrote:

> A note about possible miscompilation/undiscovered bugs triggered by
> optimizations belong to the README. I vote against this ugly thing
> in the Makefile.

I agree, how about this patch? Can we at least get this into the Makefile 
so it makes the 'release' builds work on Sparc until we can fix the 
problems and use heavier optimizations?

> Did you run the optimized version through purify? Maybe it helps us
> to get a clue about what happens.

Yes, I ran it and with the optimized version and purify, I got a lot more 
UMR's (Uninitialized Memory Read) than with the debug version.

I ran it with:
releasesparc/SunOSquake3 +set vm_game 1 +set vm_cgame 1 +set vm_ui 1 +set sv_pure 1 +set ttycon 0 +map q3dm17

It died inside the botlib initialization. Purify shows 'MAW' (Misaligned 
Memory Write) just before the crash. I got the following trace but I 
cannot make anything of it:

       MAW: Misaligned memory write
       This is occurring while in:
             PC_ClearTokenWhiteSpace [l_precomp.c:1103]
                void PC_ClearTokenWhiteSpace(token_t *token)
                {
                        token->whitespace_p = NULL;
             =>         token->endwhitespace_p = NULL;
                        token->linescrossed = 0;
                } //end of the function PC_ClearTokenWhiteSpace

//============================================================================
             PC_ReadDirective [l_precomp.c:2540]
                                {
                                        if (!strcmp(directives[i].name, token.string))
                                        {
             =>                                 return directives[i].func(source);
                                        } //end if
                                } //end for
                        } //end if
             PC_ReadToken   [l_precomp.c:2724]
                #endif //QUAKC
                                        {
                                                //read the precompiler directive
             =>                                 if (!PC_ReadDirective(source)) return qfalse;
                                                continue;
                                        } //end if
                                } //end if
             LoadWeaponConfig [be_ai_weap.c:240]
                        wc->numweapons = max_weaponinfo;
                        wc->numprojectiles = 0;
                        //parse the source file
             =>         while(PC_ReadToken(source, &token))
                        {
                                if (!strcmp(token.string, "weaponinfo"))
                                {
             BotSetupWeaponAI [be_ai_weap.c:509]
                        char *file;

                        file = LibVarString("weaponconfig", "weapons.c");
             =>         weaponconfig = LoadWeaponConfig(file);
                        if (!weaponconfig)
                        {
                                botimport.Print(PRT_FATAL, "couldn't load the weapon config\n");
             Export_BotLibSetup [be_interface.c:155]
                        if (errnum != BLERR_NOERROR) return errnum;
                        errnum = EA_Setup();                    //be_ea.c
                        if (errnum != BLERR_NOERROR) return errnum;
             =>         errnum = BotSetupWeaponAI();    //be_ai_weap.c
                        if (errnum != BLERR_NOERROR)return errnum;
                        errnum = BotSetupGoalAI();              //be_ai_goal.c
                        if (errnum != BLERR_NOERROR) return errnum;
       Misaligned write of 8 bytes to 0xc18a04 in the heap.
       Address 0xc18a04 is 1177756 bytes into a malloc'd block at 0xaf9168 of 16777216 bytes.
       This block was allocated from:
             malloc         [rtlib.o]
             calloc         [rtlib.o]
             Com_InitZoneMemory [common.c:1397]
                        }

                        // bk001205 - was malloc
             =>         mainzone = calloc( s_zoneTotal, 1 );
                        if ( !mainzone ) {
                                Com_Error( ERR_FATAL, "Zone data failed to allocate %i megs", s_zoneTotal / (1024*1024) );
                        }
             Com_Init       [common.c:2382]
             main           [unix_main.c:1306]
             _start         [crt1.o]

Then there's the crash:
       SIG: Signal handled
       This is occurring while in:
             PC_ClearTokenWhiteSpace [l_precomp.c:1103]
             PC_ReadDirective [l_precomp.c:2540]
             PC_ReadToken   [l_precomp.c:2724]
             LoadWeaponConfig [be_ai_weap.c:240]
             BotSetupWeaponAI [be_ai_weap.c:509]
             Export_BotLibSetup [be_interface.c:155]
       Received signal 10 (SIGBUS - Bus Error)
       Faulting address = 0xc18a04
       Signal mask: (SIGHUP | SIGINT | SIGQUIT | SIGILL | SIGTRAP | \
           SIGABRT | SIGEMT | SIGFPE | SIGSEGV | SIGSYS | SIGPIPE | SIGALRM | \
           SIGTERM | SIGUSR1 | SIGUSR2 | SIGCHLD | SIGPWR | SIGWINCH | SIGURG | \
           SIGPOLL | SIGTSTP | SIGCONT | SIGTTIN | SIGTTOU | SIGVTALRM | \
           SIGPROF | SIGXCPU | SIGXFSZ | SIGWAITING | SIGLWP)
       Pending signals:


Best regards,

-- 
,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,
Vincent S. Cojot, Computer Engineering. STEP project. _.,-*~'`^`'~*-,._.,-*~
Ecole Polytechnique de Montreal, Comite Micro-Informatique. _.,-*~'`^`'~*-,.
Linux Xview/OpenLook resources page _.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'
http://step.polymtl.ca/~coyote  _.,-*~'`^`'~*-,._ coyote at NOSPAM4cojot.name

They cannot scare me with their empty spaces
Between stars - on stars where no human race is
I have it in me so much nearer home
To scare myself with my own desert places.       - Robert Frost

-------------- next part --------------
Index: i_o-q3-readme
===================================================================
--- i_o-q3-readme	(revision 323)
+++ i_o-q3-readme	(working copy)
@@ -116,6 +116,28 @@
 8. ????
 9. Profit!
 
+Compiling and Running under Solaris/x86 or Solaris/Sparc
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Follow the Linux instructions on installing, that should get you started.
+
+ioQ3 was tested on the the following systems:
+- Solaris Express on x86 using Software OpenGL.
+- Solaris 10/Sparc GA on a SunBlade 2000 with XVR-1000 graphics.
+- Solaris 9/U8 on a SunBlade 150 with XVR-600 graphics.
+
+The dedicated server and client work on x86.
+The dedicated server and client work on sparc
+
+Don't use anyting other than -O0 on sparc, otherwise it will crash due to alignment errors.
+We're investigating this issue (Nov 10th 2005).
+
+The executables survive some less global optimization flags. So we're getting
+this ugly 'OPTIMIZE' for the release build until we get the other stuff fixed..
+Verified on:
+SunOS 5.9 Generic_118558-14 sun4u SUNW,Sun-Blade-100 / gcc3 (GCC) 3.3.5
+SunOS 5.10 Generic_118822-11 sun4u SUNW,Ultra-5_10 / gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
+SunOS 5.10 Generic_118822-11 sun4u SUNW,Sun-Blade-1000 / gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
+
 Creating mods compatible with Q3 1.32b
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 If you're using this package to create mods for the last official release of
Index: code/unix/Makefile
===================================================================
--- code/unix/Makefile	(revision 323)
+++ code/unix/Makefile	(working copy)
@@ -391,12 +391,13 @@
     GL_CFLAGS = -I/usr/openwin/include
   endif
 
-  OPTIMIZE = -O3 -ffast-math -funroll-loops -fomit-frame-pointer
-
   ifeq ($(ARCH),sparc)
-    OPTIMIZE = -O3 -fomit-frame-pointer -ffast-math -falign-loops=2 \
-      -falign-jumps=2 -falign-functions=2 -fstrength-reduce \
-      -funroll-loops
+    OPTIMIZE = -O0 -m32 -mptr32 -fomit-frame-pointer -munaligned-doubles \
+      -floop-optimize -fif-conversion -fmerge-constants -fthread-jumps \
+      -fexpensive-optimizations -frename-registers -fdelayed-branch \
+      -fschedule-insns -finline-functions -fstrength-reduce \
+      -funroll-loops -falign-loops=2 -falign-jumps=2 -fomit-frame-pointer \
+      -mcpu=ultrasparc -mtune=ultrasparc -mv8plus -ffast-math -mhard-float 
     BASE_CFLAGS += -DNO_VM_COMPILED
   else
   ifeq ($(ARCH),i386)
@@ -406,7 +407,7 @@
   endif
   endif
 
-  DEBUG_CFLAGS = $(BASE_CFLAGS) -g -O0
+  DEBUG_CFLAGS = $(BASE_CFLAGS) -ggdb -O0
 
   RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)
 


More information about the quake3 mailing list