Crash using filter.GetBonus("Exploration")

Case number:845829-2005887
Topic:Crash/Hang
Opened by:bertro
Status:Open
Type:Bug
Opened on:Wednesday, September 26, 2018 - 16:04
Last modified:Monday, October 22, 2018 - 23:27

In a Partition puzzle, a recipe with this single line:

print(filter.GetBonus("Exploration"))

will crash the client everytime with:

log.txt:

UNHANDLED EXCEPTION
1: interactive::util::FilterResultCacheable::get_result_bonus_value +57 bytes (no line)
2: standalone::application::luaV2_filter_GetBonus +368 bytes (no line)
3: luaD_precall +425 bytes (no line)
4: luaV_execute +3242 bytes (no line)
5: luaD_call +99 bytes (no line)
6: lua_call +83 bytes (no line)
7: luaD_rawrunprotected +76 bytes (no line)
8: luaD_pcall +53 bytes (no line)
9: lua_pcall +93 bytes (no line)
10: interactive::application::shared::lua::LuaScripter::exec_string +93 bytes (no line)
11: interactive::application::shared::lua::LuaExec::on_exec +88 bytes (no line)
12: boost::detail::function::void_function_obj_invoker0,std::allocator > const &>,boost::_bi::list2,boost::_bi::value,std::allocator > > > >,void>::invoke +22 bytes (no line)
13: boost::function0::operator() +120 bytes (no line)
14: interactive::util::Thread::thread_entry_func +69 bytes (no line)
15: interactive::util::Thread::win32_thread_startup_helper +11 bytes (no line)
16: BaseThreadInitThunk +36 bytes (no line)
17: RtlValidSecurityDescriptor +282 bytes (no line)
18: RtlValidSecurityDescriptor +234 bytes (no line)

(Wed, 09/26/2018 - 16:04  |  8 comments)


Susume's picture
User offline. Last seen 1 week 3 days ago. Offline
Joined: 10/02/2011

You are trying to get the value of a bonus that does not exist. Exploration is not a score bonus in these puzzles; it is a condition (yes/no). Try this:

print(filter.ConditionSatisfied("Exploration"))

Admittedly, the game should just put a lua error in the script output rather than crashing!

bertro's picture
User offline. Last seen 7 weeks 2 days ago. Offline
Joined: 05/02/2011
Groups: Beta Folders

Exactly or return the value of 'Explored' (which would be useful in itself).

Please notice that if you interrogate filter.GetNames(), it will return "Exploration" as a valid FilterName.

And this works (except the last line obviously):

FilterNames = filter.GetNames()

if #FilterNames > 0 then
print("There are filter in this puzzle:")
for i=1,#FilterNames do
msg = " '"..FilterNames[i].."' is "
state = "DISABLED"
if filter.IsEnabled(FilterNames[i]) then state = "ENABLED" end
msg = msg..state.." and the condition is "
condition = "NOT MET"
if filter.ConditionSatisfied(FilterNames[i]) then condition = "MET" end
msg = msg..condition
print(msg)
--print(" with a score of "..filter.GetBonus(FilterNames[i])) --this crashes the client 09/23/2018
end
end

Joined: 09/24/2012
Groups: Go Science

and the old "AreConditionsMet()" doesn't work anymore for this.

jeff101's picture
User offline. Last seen 1 day 23 hours ago. Offline
Joined: 04/20/2012
Groups: Go Science

Is there a LUA command to get the RMSD value for a structure in the Partition Function Puzzles?

Joined: 09/24/2012
Groups: Go Science

apparently not

bertro's picture
User offline. Last seen 7 weeks 2 days ago. Offline
Joined: 05/02/2011
Groups: Beta Folders

Could we get this bug/crash function working?

Even if it is not technically a "bonus", it could help in identifying if our solutions are far enough from original and direct recipes...

Thanks

rmoretti's picture
User offline. Last seen 2 days 23 min ago. Offline
Joined: 01/15/2010
Groups: None

Okay, I think I have a patch for this.

The current behavior of the fix is to raise a Lua error (the same sort of error as if you misspell a filter name, with different wording) if you attempt to call GetBonus() on a filter which is a pass/fail only filter. Additionally, the patch would add a function (filter.HasBonus()) which returns true only if GetBonus will succeed.

Does that seem like a reasonable fix? Or are the use cases surrounding GetBonus() that I'm not anticipating?

jeff101's picture
User offline. Last seen 1 day 23 hours ago. Offline
Joined: 04/20/2012
Groups: Go Science

Can you make a LUA command to get the RMSD value for a structure,
like the RMSD values reported in the Score Window in the recent
Partition Function Puzzles? Then we can use this LUA command in
Recipes to record, report, & optimize based on the RMSD value.

Sitemap

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, RosettaCommons