I think this is a duplicate bug, but the old one was reported back in 2.3.1... Essentially the lua scripts tend to die with errors in a 64-bit environment. If you are really lucky, you can start a character and get along without a lot of problems, but if you save, you guarantee a messed up game, and usually at some point, the lua errors start coming fast and furious (with one Sorceror, upon attaining 20th level -- by dragon-scumming, the errors started coming with every move. It seems to have something to do with the binary representation of negative numbers -- this sorceror had suddenly found himself with a skill of 50 in stealth due to a reinterpretation of the negative...
So my question is, what should I look for in the source to correct this? I'm willing to slog through the code and recompile, etc., but the code is, shall we say, BIG, so without some direction, I would never have a chance of figuring out what the problem is...
Thanks for everything.
---
I found out how to compile a 32-bit version on x86_64, but it is now not compiling correctly (whereas an old ZAngband source now works). I hope this is an easy thing to fix -- it seems that something is not getting included properly. If this is from an external lib, I probably just have to install the 32-bit version, but I don't know what lib they are from. Here are some of the errors:
util.c:(.text+0x428c): undefined reference to `getlogin' util.c:(.text+0x429a): undefined reference to `getpwnam' util.c:(.text+0x42a3): undefined reference to `getuid' util.c:(.text+0x42b1): undefined reference to `getpwuid' util.c:(.text+0x42c7): undefined reference to `strcpy' util.c:(.text+0x42df): undefined reference to `strcat' util.o: In function `fd_open': util.c:(.text+0x4344): undefined reference to `open' util.o: In function `fd_make': util.c:(.text+0x4396): undefined reference to `open' util.o: In function `fd_move': util.c:(.text+0x4452): undefined reference to `rename' util.o: In function `fd_kill': util.c:(.text+0x44a5): undefined reference to `remove' util.o: In function `my_fopen': util.c:(.text+0x44f2): undefined reference to `fopen' util.o: In function `user_name': util.c:(.text+0x4512): undefined reference to `getpwuid' util.c:(.text+0x4524): undefined reference to `strcpy' util.c:(.text+0x452d): undefined reference to `ctype_b_loc' util.c:(.text+0x453e): undefined reference to `ctype_toupper_loc' collect2: ld returned 1 exit status make: *** [tome] Error 1
---
Solution found: The -m32 directive needs to be added to CFLAGS and to the actual compilation of the ToME exectuable (for some reason, CFLAGS is not used there). Maybe it would be worthwhile to go ahead and add these flags -- I assume they would be silently ignored on a 32bit architecture.
In detail, line 364 of Makefile.std would be
CFLAGS = $(COPTS) $(PROFILECOPTS) $(INCLUDES) $(DEFINES) -DDEFAULT_PATH=\"$(LIBDIR)\" -m32
and lines 410-411 should be
$(TARGET): $(OBJS)
$(CC) -m32 $(PROFILELDFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS
DarkGod: (continuing from the bug tracker) It seems that some people can run the game fine while others have it crash completly on 64bit systems. Pav since yours seems fine, can you tell exactly on which kind of proc/... it works? Diid you compile by hand, by ports, ... ? Same for mpolo
Thanks
---
mpolo: Sorry for getting so upset over on the other system... I just edited Makefile.std, renamed it Makefile, then 'make', followed by 'sudo make install'. This produces a working executable, but once you get to a certain level (depends on class, etc.) I start to get interminable Lua errors, presumably because negative numbers are being interpreted as big positive numbers. Once this starts, there's a whole Lua trace every time you take a step, which makes playing pretty much out of the question. One of the skills that a sorceror has at a negative value (Stealth or such) popped up to 50.0000 at the same time, presumably a symptom of the same problem.
With the workaround, I obviously have only a 32-bit executable, but everything works fine. (I have a 40-somethingth level sorceror running at the moment with no problems (other than no hitpoints to speak of
)
I'm on Fedora Core 6, gcc-4.1.1-51.
ElCuGo: I can confirm the above errors in my system: Gentoo Linux AMD64. The sugested "fix" works but it can be simplified a little. Just add "-m32" to your COPTS and to your LDFLAGS.
ToME Wiki