TADS3 Workbench (and now my game) keep crashing

Hey, I’ve been playing with TADS3 for a few weeks now, but ever since the first day I’ve had the same problem: It keeps crashing. How frequent tends to vary, and when it does crash it’s almost always on running a game, exiting a game, or compiling a game. It generally just locks up completely, and I have to force quit. A game that’s run fine once will crash it another time, even with no changes. Since it takes only a couple seconds to reopen, and it crashes only on actions where I’ve saved right before, I’ve learned to live with it. I tried a couple clean installs, but no luck.

However, after recently adding a chunk of code, it now also crashes when running my game. After traveling through a few rooms, it locks up right after inputting a travel command.

Has anyone else had this kind of problem? I can post the code for the game, but it’s kinda long (and honestly, I’m not sure how readable), but since the workbench as a whole was crashing earlier I’m wondering how much is TADS or Windows (when it does crash in game, it also crashes the whole workbench, unlike most of the errors I’ve encountered).

Thanks.

This sounds pretty unusual. Can you post a zip of your project somewhere? And what OS version are you on?

Windows 7, with whatever the most recent updates are.

And yeah I can. Do you have any good suggestions for a hosting site? (MegaUpload was my old go to, but now they’re gone, and nothing I can find doesn’t require account and looks legit.)

Don’t know about anonymous uploads, but you might be able to upload the file or zip here as an attachment to the post? Also we have spoiler tags here, so you could just put the code in code and spoiler tags like this,

My T3 code

Okay, I’ve attached the file. It’s only the workbench and .t files, since with the object folder it ends up to big to upload. Just tell me if you want the full version, and I’ll upload it offsite somewhere.

Once in game, just “sleep” then wander around until you’ve discovered every room, then “wake” and repeat. It crashes pretty much guaranteed every time the area ends up more than 6 rooms (and maybe even 6), seemingly regardless of any pattern the rooms generate in.

If it crashes for you I’ll post the code here, and try to tidy it up a bit (although of course you’re welcome to look at it in the game files).
REM.rar (14.6 KB)

Yeah, it crashes for me too. It appears you’re creating rooms dynamically. I’ve never attempted that, but to be honest I’m not surprised that such a procedure could produce hard-to-spot bugs.

Workbench has stack trace and watch expression windows; I suspect you’ll have more luck than I would using them to discover where your code is running off the rails.

Thank you, at least I know it’s not the workstation giving me problems.

I changed adjNextRooms != nil to adjNextRooms.length() != 0 (and a couple other list == nil s) and that seemed to fix the majority of crashes (I also made sure to reduce adjNextRooms in the loop, although I think that was less of the issue in this case).

It still crashes on occasion, when two rooms each lead into the same space. At least though I know where this problem is likely to be (the findAdjRoom method and around where it’s called) although there’s nothing horribly obvious on a quick look over.

If you set a couple of breakpoints, execution will stop when a breakpoint is hit. You can then use the Step Into (F11) command in the Debug menu to advance line by line through the code. If you have the Watch Expressions window open during this process, you can choose some value that you think might be causing a problem (by being nil when it shouldn’t be, for instance) and watch its value change as you step through the code.

My other error seems to have fixed itself, which worries me, but I also fixed a non-crash related issue in the same code-related section and improved the code a bit, so I’m hoping it won’t come back.

And I’ll defiantly keep the Break Points in mind, there was a point where I was tempted to intentionally crash my code just so I could actually look at the status of a lot of things. Although due to the recursive nature of some of what I’m doing, it does make it kinda more painful.

Workbench still crashes though :neutral_face:

If you can get a reliable test case for Workbench crashing at this point it’d be worth it to file an issue:

tads.org/bugtips.htm