Something wrong with the compiler

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Something wrong with the compiler

Post by Tdarcos »

All of a sudden the compiler has stopped working. I've compiled this game probably a hundred times, and the usual compile time is about 1 second. Except if I've forgotten to close the running executable, in which case it's on the order of about ten seconds, which I recognize instantly and because it takes me about 8 seconds to close the game and confirm I want to quit.

Now, all of a sudden for no reason, the compiler gets stuck somehow. It just sits there and won't compile. I'm not sure if I've created something defined recursively, but it all of a sudden just locks up and does not compile.

Found the problem. Eventually - about 30 seconds later - it finally comes back with a message it can't write "\\buffalo\programming\zenith\tripkey\tripkey.lst". Somehow the files on the directory on the file server got marked read only, and for some reason the executable was doing a "stay behind" when killed. This is a problem when running 32-bit applications on 64-bit Windows 7, some applications - notably Word Perfect 8 - fail to terminate cleanly when closed, and sometimes hold onto whatever files were open as a zombie process I have to terminate from Task Manager.

Usually I don't have a problem because I never usually close the compiler, I leave it running all the time while I'm working, make a change to the game source, recompile, play the game to see if the fix works, quit, make another change to the game source, recompile, play the game again, quit, make another fix, etc.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post by Tdarcos »

Definitely something wrong. Tried compiling on another machine, it just goes long time no action, with the progress bar more-or-less taking a long time. This is so sudden I'm wondering if maybe it's some damage or something. I think I'll get a fresh download of the compiler and all files.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post by Tdarcos »

I had made a change of the program to block out everything. This should have caused the compiler to stop in about 1 second and complain how nothing was defined.

Does the same "go on forever with the progress bar rolling," meaning the compiler isn't even looking at the source file.

I copy the entire Hugo directory from another computer and try it again. Even though everything looks the same, now it immediately flags an error. I think something must have gotten damaged somehow.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post by Tdarcos »

I copied the files over from the storage server, tried again. It's doing the same fuckin' shit, taking forever to compile. This is weird, this only just started within the last day, as far as I know I've changed nothing but it's acting strange, refusing to compile, taking forever and locking up, maybe it's a problem with networking, I'm moving everything local.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post by Tdarcos »

I created a dummy file, basically a "hello world" style .hug file with a print statement in Init and an empty main, and it compiles in about a half second.

I ran Combofix; it discovered and removed something called WxDFast. Tried the compiler again, it's going into slow mode.

The only thing I can think of is that I've created some sort of recursive definition or reference, the compiler doesn't recognize it and is spinning its wheels. I'll have to go through and check around.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post by Tdarcos »

I changed the main program to take each file off one at a time. Stalls on one file. I change that file - it's nothing but room declarations - give it a different name, turn it into basically a coimment block, each room is just

room someroom "title"
{
}

And it's still locking up. Make a new one with the minimum, 4 dummy rooms, and it's locking up. One of the other files is causing the problem. The compiler is running for over a minute and is still stalled. Something in the way I've declared something is causing a construct the compiler doesn't like. I'm presuming a recursive definition, but it could be anything. So I'll see what's going on.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post by Tdarcos »

Well, after a lot of unnecessary work, I found it. I tried replacing the ListObjects routine because I wanted to show merchandise in the store separately from other objects. But something I did in changing the code caused it to basically lock up the compiler. I thought I diked out the file it is in and had no change, but I diked it out, then restored the original of every file and the program compiled in about 1 second, same as usual.

Weird, <s>this isn't that big a change as far as I can tell</s>, I would never have believed what I'm doing to be that significant, and it seemed to work the last time, but it has something in it that causes the compiler to spin off into never-never land, never-never to return until the 12th of never. Or maybe not so much never to return, but more like 20 minutes, not sure.

----
Hear me cryin' out to you
You said, "Never, never would I leave"
Here's a tear from me to you
And maybe it will make you hear me
- The Jets, [i[Make It Real[/i]
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
pinback
Posts: 17672
Joined: Sat Apr 27, 2002 3:00 pm
Contact:

Post by pinback »

Wait, you mean it turns out that it WASN'T the compiler/runtime system that "just stopped working"? Which is a thing that doesn't actually happen in computers?
I don't have to say anything. I'm a doctor, too.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Found a bug in the compiler

Post by Tdarcos »

I was deciding to define a template for merchandise in the store, which I called merch. I had used that for the variable to count the number of items, which I changed to merch_count.

But I missed a spot. One of the places checking for merchandise increased the count with merch++ instead of merch_count++, and this is acceptable for compilation but it crashes the run-time system when an object of that class is so manipulated. So I suspect the compiler shouldn't allow a class name to be used as a global variable.

Simple answer: don't use a class name as a variable. The compiler will allow it, and when that class is referenced the runtime will crash. Although, it does provide an interesting way to cheat the player out of a win...
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post by Tdarcos »

pinback wrote:Wait, you mean it turns out that it WASN'T the compiler/runtime system that "just stopped working"? Which is a thing that doesn't actually happen in computers?
Nevertheless, the compiler went off into nowhere and froze. A compiler is a text processing program, with a set of rules. If a compiler comes across a bad construct, it's supposed to fault the construct and give an error.

For example, better compilers now know about "crock recursion" and have a flag so if they trip it more than, say, five times, it faults the condition as an infinite recursion loop.

If you had an include file that included itself, will it keep going forever or does it notice it's been included more than say, five nesting levels?

That wasn't the error in my case, but apparently some construct I was using confused the compiler and it went off the rails.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

Post Reply