Stupid issue with T1

Everything and anything else, speak about it here!

Moderator: Moderator

Post Reply
Message
Author
Lord Estraven
Uruivellas
Posts: 718
Joined: Tue Dec 13, 2005 12:35 am

Stupid issue with T1

#1 Post by Lord Estraven »

So I'm playing a mage in T1, aka Pernband. (Yes I know it's old. :P ) I hit m, a for my first spellbook, and then a for the first spell - while holding down the shift key, which *should* display the information on the spell, as with browsing the book. Instead, it causes T1 to crash immediately. If I invoke T1 from the console I get this rather cryptic error when it crashes:

Code: Select all

./tome: software bug 99 33
What does this mean and how can I fix it?

Lord Estraven
Uruivellas
Posts: 718
Joined: Tue Dec 13, 2005 12:35 am

Re: Stupid issue with T1

#2 Post by Lord Estraven »

Update: GDB tells me this, for whatever it's worth:

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
0xb7d4ea6d in vfprintf () from /lib/libc.so.6
Also, this is on Zenwalk 6.4, but the bug is observable on Slackware 13 and Arch Linux current.

Yottle
Reaper
Posts: 1753
Joined: Sun Jan 26, 2003 11:49 pm
Location: West Virginia

Re: Stupid issue with T1

#3 Post by Yottle »

I have no idea of what the problem is.

But your post reminded me of what a great game T1 was. I especially liked playing lost souls. I don't think a game ever lasted more than 15 minutes. And the more times I died, the harder it got.

Lord Estraven
Uruivellas
Posts: 718
Joined: Tue Dec 13, 2005 12:35 am

Re: Stupid issue with T1

#4 Post by Lord Estraven »

Argh, this happens on the precompiled Windows version too. "tome.exe has experienced a severe error and must close" or whatever. Bleh.

Lord Estraven
Uruivellas
Posts: 718
Joined: Tue Dec 13, 2005 12:35 am

Re: Stupid issue with T1

#5 Post by Lord Estraven »

Okay I think I found it. GDB backtrace says this:

Code: Select all

#3  0x0814e751 in vstrnfmt (
    buf=0xbfffeecf "Level 136049245 ?¤\211\"\bpy\"\b8???", max=78, 
    fmt=0x81a5020 "Level %d %s %s (%d mana, %d%% fail)? ", 
    vp=0xbfffee84 "pb\034\b\001") at z-form.c:567
And look what's just above line 567?

Code: Select all

				/* Hack -- convert NULL to EMPTY */
				if (!arg) arg = "";
I'm not sure, but I THINK there ought to be a space between those quotes. Let's see if that fixes it.

Lord Estraven
Uruivellas
Posts: 718
Joined: Tue Dec 13, 2005 12:35 am

Re: Stupid issue with T1

#6 Post by Lord Estraven »

... Nope, no fix. Dang.

Devorius
Cornac
Posts: 41
Joined: Fri Dec 09, 2011 4:19 pm

Re: Stupid issue with T1

#7 Post by Devorius »

It looks like the code assumes that arg is guaranteed to exist at this point, and is inadvertently writing to some random memory that probably doesn't belong to the program. Also:

Code: Select all

fmt=0x81a5020 "Level %d %s %s (%d mana, %d%% fail)? ",
vp=0xbfffee84 "pb\034\b\001") at z-form.c:567
The format list is calling 5 variables: int, string, string, int, int
Yet the argument buffer contains only 4 arguments. So something is not getting passed correctly.

Post Reply