Bug in Windows BoA? Related to HLPM

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).

Pages

AuthorTopic: Bug in Windows BoA? Related to HLPM
Infiltrator
Member # 154
Profile #0
OK. I run Kelandon's HLPM with a freshly created party. I clicked OK to the factory options on the Make Party screen, except changing the last character to a Nephil and setting the difficulty to Easy.

About three steps after I have stepped on the runes that give experience, BoA crashes with two messages:

EDIT: After some more testing, I realise I made a mistake describing it. Three steps after using the runes, I get a dialogue box with more information which works fine. FIVE steps after that, proceeding in the same direction, the following error happens and BoA quits.

"Unhandled Exception: c0000005
At address: 004399c0"

then

"Blades of avernum

This program has performed an illegal operation and will be shut down.

If the problem persists, contact the program vendor.

BLADES OF AVERNUM caused an invalid page fault in
module BLADES OF AVERNUM.EXE at 0167:004399c0.
Registers:
EAX=8d160000 CS=0167 EIP=004399c0 EFLGS=00010297
EBX=00000000 SS=016f ESP=00edf150 EBP=00edf194
ECX=00cb3090 DS=016f ESI=00000000 FS=1d17
EDX=0000007c ES=016f EDI=8d16aa23 GS=0000
Bytes at CS:EIP:
8a 0b 80 f9 ff 75 0c 80 7b 01 ff 75 06 80 7b 02
Stack dump:
000000ec 00000001 00000038 00edf253 ffffffff 00000000 00000037 0000002e 00000000 ffff13b8 808080ff ff404040 ff000000 ff000000 00edf1f0 00edf1f0
"

I'm using Win98SE and have tried both the 'God' and 'Level 95' experience options.
I have registered BoA.

EDIT: After some testing, this happens irreguardless of what level I select.

[ Friday, June 04, 2004 12:09: Message edited by: Grey-Eyed Stranger ]

--------------------
Apparently still annoying.
Posts: 612 | Registered: Saturday, October 13 2001 07:00
Off With Their Heads
Member # 4045
Profile Homepage #1
My hope is that this copy is corrupted because of extracting the .sit with a weird emulator program. I just uploaded a .zip for Windows users.

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Infiltrator
Member # 154
Profile #2
No such luck. This AIM log may be beneficial to Jeff:

UWHugo: http://www.ironycentral.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic;f=15;t=000542#000000 Ehh
tomsterthemonstr: Huh.
tomsterthemonstr: That's really, really weird.
UWHugo: Yeah.
tomsterthemonstr: Three steps after the runes is another special. Let me check what it does...
UWHugo: Lemme test some more, hang on#
tomsterthemonstr: It's a standard message_dialog. I have no idea what's going on here.
UWHugo: OK, wait..
UWHugo: Three steps after the runes I get 'Isn't this fun?' and it works fine.
UWHugo: FIVE steps after that (proceeding in the same direction) it crashes.
tomsterthemonstr: huh
tomsterthemonstr: I think that's another special.
tomsterthemonstr: Actually, it's not.
tomsterthemonstr: Hrm.
tomsterthemonstr: Your copy might be corrupted somehow. I just put a .zip on the web site for Windows users. Not sure if it works, but it might be worth a shot.
UWHugo: OK
tomsterthemonstr: http://my.sanbrunocable.com/tomwatts/public_html/hlpm.html
UWHugo: Well, if you uploaded it corruptly, redownloading won't help.
tomsterthemonstr: I am out of my element here. Mac users have used the .sit without trouble, but I put the .zip on there a couple of minutes ago, so no one's tried it yet.
UWHugo: Ooh
UWHugo: Yeah, I used some special extractor for the sit
UWHugo: Nope, still happening.
tomsterthemonstr: Huh.
tomsterthemonstr: Let me check where five steps is in the scenario.
tomsterthemonstr: I've run into a harmless graphics glitch in the Mac version that I think is related to the custom script for the creatures.
tomsterthemonstr: It may be related.
UWHugo: ok
UWHugo: Let me do some more tests
UWHugo: I step on the runes - goes fine. I double back and wander round the corridoor. No crash.
UWHugo: I go in the direction of the door to the main room. Standing on the rune, I take... 10 steps until crash.
tomsterthemonstr: So the number of steps varies.
UWHugo: Yeah..weird.
UWHugo: Hang on, testing..
tomsterthemonstr: The graphics glitch in the Mac version happened when the creatures turned around to face north again.
UWHugo: This time I got six steps from on the runes before crash.
UWHugo: But first time it crashed I wasn't heading in the same direction, I turned around about when i got beside the first NPC and it still crashed.
tomsterthemonstr: I mean when the NPCs, the shopkeepers, turn to face north. They start facing north, turn, and then the glitch occurs when they face north again.
UWHugo: Weird. Why?
tomsterthemonstr: It's just a little line to the left of them.
tomsterthemonstr: I have no idea.
tomsterthemonstr: I e-mailed Jeff.

--------

The scenario DOES NOT HAVE custom graphics.
I have tried deleting the readme file and converting the text files to UNIX (\n only) format from Mac format.

[ Sunday, June 06, 2004 02:17: Message edited by: Grey-Eyed Stranger ]

--------------------
Apparently still annoying.
Posts: 612 | Registered: Saturday, October 13 2001 07:00
Board Administrator
Member # 1
Profile Homepage #3
Could someone send me files I can use to repro this bug? Send me the scenario, a save file I can use to repro it, and instructions to make the crash happen. Send it to spidweb@spiderwebsoftware.com and I'll see what I can do on Monday.

- Jeff Vogel

--------------------
Official Board Admin
spidweb@spiderwebsoftware.com
Posts: 960 | Registered: Tuesday, September 18 2001 07:00
Infiltrator
Member # 154
Profile #4
Spidweb. On a windows platform, goto http://my.sanbrunocable.com/tomwatts/public_html/hlpm.html, get the HLPM .zip, install. Run it with a fresh-party (easy difficulty), select level 10 (level 95 and 'God' seems to work too - doesn't seem to depend on the level).

Turn sound off, step on the runes. Continue into the room, walk around a bit and wait for the crash.

Kelandon seems to think this is related with NPCs turning and I think I agree with him. Crash time seems to vary from 5 steps to 10 steps.

[ Friday, June 04, 2004 13:05: Message edited by: Grey-Eyed Stranger ]

--------------------
Apparently still annoying.
Posts: 612 | Registered: Saturday, October 13 2001 07:00
Off With Their Heads
Member # 4045
Profile Homepage #5
The scenario is at the site in the link in my sig. It's under "My Stuf," and "High Level Party Maker," specifically, here.

I've sent you an e-mail with the HLPM attached and an e-mail with a link to the web site. I'm not entirely clear why you haven't gotten it yet.

For the Mac graphics glitch, all you have to do is send a party (ANY party) into the scenario and walk around near the cave giant. Wait for him to turn away from facing north and then face north again. You will see a long, black line to his left. All of the creatures with the custom script do this, but it is most obvious with the cave giant.

As far as I can tell, for the PC error, all you need to do is take a party (ANY party) into the scenario and walk around for a bit. I haven't checked this on a PC, though; I'm just going from UA's report.

EDIT: UA got there first. Just for clarity: the cave giant is obvious. He's past the runes and to the northwest a little.

[ Friday, June 04, 2004 12:46: Message edited by: Kelandon ]

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Board Administrator
Member # 1
Profile Homepage #6
Problem solved. This line ...

set_character_facing(ME,get_ran(1,1,8));

Is bad juju. Don't give a character a facing of 8. Note ...

void set_character_facing(short which_char_or_group,short direction) - Changes a character which_char's facing. Values for direction: 0 - north, 1 - nw, 2 - west, 3 - sw, 4 - south, 5 - se, 6 - east, 7 - ne.

I don't know for sure that this will fix the Windows crash, but I'd be surprised if it didn't.

- Jeff Vogel

--------------------
Official Board Admin
spidweb@spiderwebsoftware.com
Posts: 960 | Registered: Tuesday, September 18 2001 07:00
Off With Their Heads
Member # 4045
Profile Homepage #7
Fixed. New version uploaded to website. Thanks, Jeff!

[ Friday, June 04, 2004 15:33: Message edited by: Kelandon ]

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Infiltrator
Member # 154
Profile #8
Spidweb. Sorry to pester on your coding of the scripting language, but perhaps implementing some failsafes on things like this? Maybe make 'debug mode' show details on scripting errors?

(Although those would likely be hard to track down and report.)

--------------------
Apparently still annoying.
Posts: 612 | Registered: Saturday, October 13 2001 07:00
Warrior
Member # 4238
Profile #9
quote:
Originally written by Grey-Eyed Stranger:

Spidweb. Sorry to pester on your coding of the scripting language, but perhaps implementing some failsafes on things like this? Maybe make 'debug mode' show details on scripting errors?

(Although those would likely be hard to track down and report.)

Yeah...it seems all you'd need are some try/catch blocks. Makes it easier to know who to blame ;)
Posts: 70 | Registered: Monday, April 12 2004 07:00
Off With Their Heads
Member # 4045
Profile Homepage #10
In this case, it just seems like BoA should've popped up one of its friendly error messages instead of fully crashing. That's the only issue I have with the way the engine worked in this case.

But I *do* have an issue with the way the error messages work in general. I can never figure out which line is line 1267, and it takes a fair amount of experimenting to do. When the error comes from that I'm missing parentheses and I have about 248578923478237593953 "if" calls, it is next to impossible to figure out what's gone wrong.

Thus I think it would be great if BoA would PRINT THE LINE THAT IS GIVING THE ERROR, so that when it says "Error [whatever] in line 987," it prints the text of line 987 right beneath that.

This would make debugging so much easier.

[ Saturday, June 05, 2004 13:46: Message edited by: Kelandon ]

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Warrior
Member # 4238
Profile #11
quote:
When the error comes from that I'm missing parentheses and I have about 248578923478237593953 "if" calls, it is next to impossible to figure out what's gone wrong.
This is another situation where we can apply an XP technique: test often. Write a little code, then test it thoroughly. Repeat.
Posts: 70 | Registered: Monday, April 12 2004 07:00
Apprentice
Member # 4118
Profile Homepage #12
The if I was using set_character_facing function I'd make a enum or define for all the different directions.

set_character_facing(ME,get_ran(1,1,CF_NORTH) something like that.

It ends up being much more readable and its harder to make mistakes. I'm only starting to learn the stripting but it seems like you would have to use regular variables for that sort of thing. It might waste a small bit of memory but it would be more readable. Comments would work too. Make it really clear before the call what it can take as arguments.

Errors that involve memory getting trashed are the worst to debug in C. You don't know where the error is. The actual crash could happen almost anywhere memory is handled. You kinda have to read carefully and backtrack commenting out stuff systematically. Having actual debugger helps a lot too. Logging helps too. I'm not sure how to do that in scripts yet.
Posts: 27 | Registered: Thursday, March 18 2004 08:00
Warrior
Member # 4238
Profile #13
quote:
Originally written by coreyh:

The if I was using set_character_facing function I'd make a enum or define for all the different directions.
You're missing a ')' :)
And if you're really having trouble with parantheses, you might want to do something like this:

set_character_facing( ME, get_ran(1,1,CF_NORTH) );

quote:
Errors that involve memory getting trashed are the worst to debug in C. You don't know where the error is. The actual crash could happen almost anywhere memory is handled. You kinda have to read carefully and backtrack commenting out stuff systematically.
Sure, but memory leaks simply shouldn't happen with BoA scripting unless you're doing something terribly wrong, or Jeff screwed up. Seems unlikely either way.
Posts: 70 | Registered: Monday, April 12 2004 07:00
Warrior
Member # 286
Profile #14
Kelandon - try using a text editor with a "go to line" function and which lists the line number in the status bar. :)

--------------------
Z: "I just feel so insignificant."
Psych: "You ARE. You're an ANT."
--Antz
Posts: 104 | Registered: Saturday, November 17 2001 08:00
Off With Their Heads
Member # 4045
Profile Homepage #15
Flamefiend, namely what program? Word doesn't do it correctly, so I don't have much faith in anything. Also I have a Mac, so I'm normally using TextEdit, which to the best of my knowledge doesn't do that.

And Nasarius, the "test often" approach doesn't usually matter. I can narrow it down to one set of calls and then test until I'm blue in the face only to find out that I'm testing the wrong line. I'm learning debug techniques, but it is painfully slow and hard.

Btw Flamefiend, have I mentioned that we've met before? You were my beta tester back in the day. Check my website if you don't know what I'm talking about.

[ Saturday, June 05, 2004 17:25: Message edited by: Kelandon ]

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Apprentice
Member # 4118
Profile Homepage #16
That wasn't actual code I was using. I just cut and pasted that without thinking :) The constant part was the only important part of that example.

I wasn't talking about a memory leak. I was talking about trashing memory. Which seems like something you actually have to worry about with scripting. There was another thread

http://www.ironycentral.com/cgi-bin/ubb/ubb/ultimatebb.php?ubb=get_topic;f=18;t=000165

quote:
Some of the calls bounds check everything the designer does, and some don't. In general, though, you shouldn't be checking the terrain for non-existant spaces, modifying the inventory for non-existant characters, and so on.

- Jeff

That made it sound like it was quite possible. Its the sort of thing that happens with memcpy and arrays. Buffer overruns, that kinda thing. We don't have those but its quite possible we can pass garbage input to a function we do have and get that sort of result.

The Random crashes symptoms to the set_character_facing bug in the script reminded me of the experiences I've had with memory trashing. Thats why I talked about it.

Debugging is a pain always. I'm not sure the best ways to do it in these scripts yet. Logging is what I did when I didn't have a debugger. You can sometimes notice random variable values when memory was trashed. *shrug* I'm not a expert and I've mostly used regular C.
Posts: 27 | Registered: Thursday, March 18 2004 08:00
Apprentice
Member # 4118
Profile Homepage #17
http://www.barebones.com/index.shtml

bbedit is the best programming editor for mac as far as I know. The lite version should probably be plenty for you. Its free.
http://www.barebones.com/products/bblite/index.shtml

If you have OS X there are probably more options. There are many good unix Text editors.

The problem with error line numbers is a error can have happened before the place it notices it. The error can just be a symptom of another error or the place where a syntax error finally showed up.
Posts: 27 | Registered: Thursday, March 18 2004 08:00
Off With Their Heads
Member # 4045
Profile Homepage #18
Um, I assume you know that BBEdit Lite is no longer available, according to the link you just gave.

(EDIT: Yes, Thuryl's right. I was looking for a place to download it and couldn't find it, but there it is.)

I haven't had a problem with BoA giving a line number that was terribly far away from the line that was causing the problem (although frequently the error "Bad term in expression" gives the line number after the problem expression), but for a number of reasons, it would be far easier to debug if BoA would just print the line that is causing the problem.

The reason that I bring this up is that it seems like it would be fairly easy to program.

[ Saturday, June 05, 2004 20:39: Message edited by: Kelandon ]

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
...b10010b...
Member # 869
Profile Homepage #19
BBEdit Lite is no longer supported, but it's still available for download from that site.

--------------------
The Empire Always Loses: This Time For Sure!
Posts: 9973 | Registered: Saturday, March 30 2002 08:00
Off With Their Heads
Member # 4045
Profile Homepage #20
Wow, having mucked around with this program for a bit, I can say it's really good. It will save me some serious time. It does text document line numbers correctly, which Word doesn't.

I do think it would help if BoA printed the line that it thinks is the problem, but this is the next best thing.

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Triad Mage
Member # 7
Profile Homepage #21
But BoA's error line numbers are often way off and horribly wrong.

--------------------
"At times discretion should be thrown aside, and with the foolish we should play the fool." - Menander
====
Drakefyre's Demesne - Happy Happy Joy Joy
Encyclopedia Ermariana - Trapped in the Closet
====
You can take my Mac when you pry my cold, dead fingers off the mouse!
Posts: 9436 | Registered: Wednesday, September 19 2001 07:00
Warrior
Member # 286
Profile #22
Kelandon - I didn't mention any specific program, because I'm on Windows and I suspected you were on a Mac. But you've got some good suggestions from other people, so that's all good.

Oh, yeah... I remember that scenario! Man, that was a long time ago. Heh. And here I was thinking you'd only arrived during my long absence. :)

BTW, Word sucks. :D And yeah, it would be nice if it printed the line, except that doing so would be misleading if the line numbers are as messed up as people are saying they are.

--------------------
Z: "I just feel so insignificant."
Psych: "You ARE. You're an ANT."
--Antz
Posts: 104 | Registered: Saturday, November 17 2001 08:00
Infiltrator
Member # 154
Profile #23
quote:
Originally written by Drakefyre:

But BoA's error line numbers are often way off and horribly wrong.
Yes. But I know another, much, much more powerful scripting language - it's line numbers are often way off too.

The problem is the interpreter doesn't know WHERE the problem is. If you miss a semicolon on one line, the interpreter still thinks it's handling the same command. So when on the next line it sees some other character it wasn't expecting (it was expecting a semicolon), it calls THAT line the problem, instead of the line missing the semicolon, which is the line you need to fix.

So it's pretty hard for the interpreter to figure out where you've coded yourself a muddle. :)

--------------------
Apparently still annoying.
Posts: 612 | Registered: Saturday, October 13 2001 07:00
Warrior
Member # 4238
Profile #24
quote:
And Nasarius, the "test often" approach doesn't usually matter. I can narrow it down to one set of calls and then test until I'm blue in the face only to find out that I'm testing the wrong line. I'm learning debug techniques, but it is painfully slow and hard.
*shrug*
Well, formal education in CS always helps :)
Or just lots of practice until you figure out the kinds of things that can go wrong. Again, don't write more than ~10 lines of code in between tests. And test thoroughly, so you know your code is as bug-free as possible before moving on.

You can't rely on line numbers with C/C++ compilers either.

[ Sunday, June 06, 2004 07:01: Message edited by: Nasarius ]
Posts: 70 | Registered: Monday, April 12 2004 07:00

Pages