Bug - Not A Bug Hanging issues when calling scripts

zarqon

Well-known member
A while back, my routine scripts started hanging whenever they reached a point where another script was called using cli_execute("<script> <parameter>").

Using only the script name still works, but as soon as you also pass the first parameter (something I commonly did) mafia will hang. By hang, I mean consume full CPU but appear to do nothing. Further commands can be entered but they are queued.

Some ways to duplicate this error:

1) Call a nonexistent script, i.e. "call thisisnotascriptname".
2) Call a script and pass a parameter on the same line, i.e. "call bounty go" or "call getpipes 1".

Based on when this started happening, my guess is that it's related to the "Java is not ASH" change for strings.

It would be nice if I could continue passing parameters to scripts in the CLI, but regardless of whether or not that functionality is retained, the hanging is undesirable behavior.
 

roippi

Developer
Why in the world would that cause a problem like this?

It wouldn't.

I'm unable to reproduce any issue here, using any permutation of call or cli_execute():

Code:
> call zlib.ash 4

Copy/paste/modify/enter any of the following lines in the CLI to edit settings:

zlib threshold = 4
(If no values were shown, no settings or values matched your input text. Type "zlib vars" to see all.)

> zlib 4

Copy/paste/modify/enter any of the following lines in the CLI to edit settings:

zlib threshold = 4
(If no values were shown, no settings or values matched your input text. Type "zlib vars" to see all.)

> ash cli_execute("zlib 4");

Copy/paste/modify/enter any of the following lines in the CLI to edit settings:

zlib threshold = 4
(If no values were shown, no settings or values matched your input text. Type "zlib vars" to see all.)
Returned: true

> call asdf

Unable to invoke asdf

All behaved as I'd expect.
 

zarqon

Well-known member
Weird, because this consistently and repeatably happens for me, with all of the last 20 or so daily builds. Win XP, Java 6 Update 31.

I tried generating a debug log but all it contained was this:

> call notascriptname

> <b>CURRENT</b>: call notascriptname
> <b>QUEUED 1</b>: print what?

KoLmafia declares world peace.
KoLmafia declares world peace.

Yet, as soon as I made the first call to a nonexistent script, the CPU was racing at full, no matter how many times I mashed the ESC key, and mafia queued any further commands.

@Bale: I also have no idea, but when I noticed the problem, that was the only recent change which I could see having a link to this problem. I may be off the mark -- it may be something else entirely -- but it was working before, and I didn't change anything other than update mafia.
 

zarqon

Well-known member
Yes.

And for 10881.

And 10878.

It looks like perhaps the problem is only on my system, but at the moment I have no idea what I could have changed, and that's a very odd trigger. I have no idea how calling a script with just the (existing) name would be fine but calling it with a parameter would freeze it up. Can anyone give me any clues about what I should look into?

For now, I guess I'll try reinstalling Java, see if that does anything to help.

EDIT: A reinstall of Java did not solve anything. I scanned my computer for malware using several scanning tools, none found. On a lark, I moved the .jar to a fresh directory and ran it there (didn't have to login, the problem manifests from a blank CLI just as well). No hang. Aha! I then tried copying over each subdirectory one by one, running mafia anew each time until the problem reoccurred. I found the problem in the relay folder -- I'd extracted the .zip for DataTables (a jQuery plugin) into its own subdirectory of the relay folder. Evidently something in there was making mafia very unhappy when searching for scripts (but only with parameters...?). So I was wrong when I said I didn't change anything -- I added a bunch of files (none of them .txt, and none of them .ash, which is why I thought it wouldn't matter).

You can almost certainly duplicate this problem yourself if you unzip the DataTables package into your relay folder. I painstakingly narrowed it down to the "extras" sub-sub-sub-sub-sub-folder before I accidentally perma-deleted something which may have been the problem, and then gave up in frustration. Regardless, I've solved the problem on my end so this can be marked Not a Bug unless someone else wants to narrow it down and make mafia more robust against this kind of hangup.

Despite this rather major distraction from my gaming happiness, I harbor exactly no ill will towards DataTables because it is just that awesome. You shall see for yourself, soon.
 
Last edited:

roippi

Developer
Possibly worth tracking down whatever the problem is if some HTML or javascript isn't playing well with the gCLI. I'll close, if someone wants to investigate further we'll reopen.
 
Top