Ongoing Lua V2 Bug List

Case number:845813-991496
Topic:Game: Tools
Opened by:brow42
Opened on:Saturday, January 7, 2012 - 00:17
Last modified:Tuesday, July 24, 2012 - 20:54

As part of our New Year's feedback clean up, may I suggest an ongoing bug post? With Lua V2 in the main we should see a fresh crop of them. I suspect this one from 2010 is mostly full of resolved issues:

(Sat, 01/07/2012 - 00:17  |  11 comments)

brow42's picture
User offline. Last seen 1 year 37 weeks ago. Offline
Joined: 09/19/2011
Groups: None

Here's my first two:

d = dialog.CreateDialog(test)
d.AddTextbox('Label',nil) -- crash
error(nil) -- crash

Joined: 09/22/2011
Groups: None

Reality check - the second parameter in the dialog.AddTextbox function is meant to be a string value.
You know this, right? (use two double quotation marks for nothing - "")

I tested dialog.AddButton, dialog.AddCheckbox, dialog.AddLabel, dialog.AddSlider, dialog.AddTextbox, and dialog.CreateDialog functions, replacing expected strings with nul, and it crashes. One would therefore assume that this will occur with any functions that are passed a nul, when they expect a string.

Joined: 09/21/2011
Groups: Void Crushers

I was bitten by this today.
It took me 3 crashes and a lot of headscratching to figure out that I made an error in a variable name, ListH instead of listH.
Anyhow this kind of error should be catched, the script may crash but the game shouldn't.

brow42's picture
User offline. Last seen 1 year 37 weeks ago. Offline
Joined: 09/19/2011
Groups: None

Assertion crasher -- band.GetLength() on any band created with band.Add() or band.AddToBandEndpoint() to a band created with band.Add(). Both main and beta client, the GetLength fix from has not been applied in either, yet.

ERROR: seqpos >= 1
ERROR:: Exit from: D:\scooper\foldit\release_server\mini-interactive-main\rosetta_source\src\core/conformation/Conformation.hh line: 288

17: BaseThreadInitThunk +18 bytes (no line)
18: RtlInitializeExceptionChain +99 bytes (no line)
19: RtlInitializeExceptionChain +54 bytes (no line)

Joined: 09/21/2011
Groups: Void Crushers

Actualy there should be 2 lists.
And these should be pinned down on the feedback at the top.
Both lists should be maintained by the foldit group.
List 1: Known errors, with information about the status. Solved ones should stay there for a couple of months, so reappearence can be noted.
List 2: Known non errors. F.i. that it is possible that scores jump very wildly during scripts. (That happened to me and I thought it was a bug, but later rerunning and checking showed it was 1 clash that caused it)
And maybe also something like that for the suggestions.

brow42's picture
User offline. Last seen 1 year 37 weeks ago. Offline
Joined: 09/19/2011
Groups: None

Bug from 1/28/2012 has been fixed.

spvincent's picture
User offline. Last seen 8 hours 52 min ago. Offline
Joined: 12/07/2007
Groups: Contenders

A couple of things that need addressing:

1) Fix the parameter to structure.RebuildSelected () so that it does the correct number of rebuilds. If this is impractical for some weird reason, or if there's major overhead in setting up a rebuild, then a function that lets you step back through the Undo graph would be a perfectly acceptable alternative.

2) If Lua's exception handling allows it, allow a "Cleanup" function to be called on unexpected termination, such as when the user cancels a script. This has assumed additional importance with all the new behaviour sliders: cancelling a script often leaves CI, WAcc, etc, in an indeterminate state and there is currently no way for a script to set these back to their initial state.

Joined: 09/21/2011
Groups: Void Crushers

Tried to use IsFrozen on 537, it does not find the not frozen parts.
Same with IsMutable, does not find the not mutable parts.

Tlaloc's picture
User offline. Last seen 17 weeks 8 hours ago. Offline
Joined: 08/04/2008
Groups: Mojo Risin'

It turns out that you can create a Cleanup function already in Lua V2. V2 supports the xpcall function (see the Lua documentation). Clicking the Cancel button actually generates an error that can be trapped. Here is an example of using a cleanup function in V2 to reset the clash importance back to 1.00 if you hit cancel. Try hitting the Cancel button while it is performing the WiggleAll and watch it reset back to 1.00.

function test()
	print("In test")

function cleanup()
	print("Cleaning up")

xpcall(test, cleanup)
Joined: 08/24/2011

no crash but i found that fun one :
when foldit functions are passed by reference the script panel (where one can cancel a script) shows the new name


shows "a"
as table fields are anonymous it gets funnier


shows "?"

now, if you want to play with the ones using your scripts you may guess what's next :


et voilĂ  !

Joined: 06/17/2010

Lua should at least check type of passing parameter and throw an error to output window not killing client... One typo in variable name and we pass nil to function and we can say goodbye to client.


Developed by: UW Center for Game Science, UW Institute for Protein Design, Northeastern University, Vanderbilt University Meiler Lab, UC Davis
Supported by: DARPA, NSF, NIH, HHMI, Amazon, Microsoft, Adobe, Boehringer Ingelheim, RosettaCommons