Icon representing a recipe

Recipe: band_1747_wacky_atoms_crasher

created by LociOiling

Profile


Name
band_1747_wacky_atoms_crasher
ID
103169
Shared with
Public
Parent
None
Children
None
Created on
October 20, 2019 at 20:18 PM UTC
Updated on
October 20, 2019 at 20:18 PM UTC
Description

Demonstrates a crash with band.AddBetweenSegments. When invalid atoms are specified, the client crashes. No messages appear in log.txt. The recipe first add three normal bands between the two segments, then crashes when it attempts to band the invalid atoms.

Best for


Code


-- -- crasher for puzzle 1747 -- print ( "adding three normal bands between cysteines 24 and 40" ) bdx = band.AddBetweenSegments ( 24, 40 ) -- backbone, should be OK if bdx ~= nil then print ( "added first band, backbone 24-40" ) else print ( "banding backbone 24-40 failed!" ) end band.AddBetweenSegments ( 24, 40, 5, 5 ) -- beta carbons, should be OK if bdx ~= nil then print ( "added second band, beta carbons 24-40" ) else print ( "banding beta carbons 24-40 failed!" ) end band.AddBetweenSegments ( 24, 40, 6, 6 ) -- beta carbons, should be OK if bdx ~= nil then print ( "added third band, sulfurs 24-40" ) else print ( "banding sulfurs 24-40 failed!" ) end print ( "done with reasonable bands" ) print ( "attempt to band invalid atoms of 24 and 40" ) bdx = band.AddBetweenSegments ( 24, 40, 52, 99 ) -- wacky atoms! if bdx ~= nil then print ( "added fourth band, wacky atoms 24-40" ) else print ( "banding wacky atoms failed!" ) end

Comments


LociOiling Lv 1

This recipe demonstrates the issue reported in the feedback "banding invalid atoms crashes client".

The function band.AddBetweenSegments crashes the client if the atom numbers specified are not valid.

Previously, invalid atom numbers resulted in an error, which terminated the recipe without causing a crash.

The recipe references the cysteines at 24 and 40 in puzzle 1747, but it can be tried on any puzzle. The first three bands should be successful on puzzles with at least 40 segments. The last band should fail on all puzzles.