You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When simultaneously receiving serial messages from norns and i2c query commands from Teletype, crow will eventually crash.
Crow can also be made to crash immediately by redefining the ii.self.query0 function while this is happening.
Example real-world application: adding an option to dreamsequence to synchronize its scale with teletype (branch)
The crash is observable in both crow 3.0.0 and crow 4.0.5.
Example repro script (this is not totally minimal, I believe one coroutine calling crow.send is sufficient, but more crash sooner.)
-- minimal script to reproduce teletype-crow-norns crash issue-- steps to reproduce:-- connect crow to teletype via i2c-- put N.B CROW.Q0 in M script (default M 1000 is sufficient, but faster Ms crash sooner)-- connect crow to norns via usb-- run this script-- crow will generally crash within 20-30 seconds. norns is hung until crow is disconnected or power cycled.crow_updates= {}
functioninit()
redraw()
clock.run(function()
whiletruedoupdate_crow(1)
clock.sleep(0.5)
endend)
clock.run(function()
whiletruedoupdate_crow(2)
clock.sleep(0.17)
endend)
-- uncomment this to crash immediately -- clock.run(function()-- clock.sleep(1)-- crow.send("ii.self.query0 = function() print('query0*') end")-- end)endfunctionredraw()
screen.clear()
screen.level(15)
screen.move(2,8)
screen.text("crow stress test " ..os.clock())
fori=1, #crow_updatesdoifcrow_updates[i] thenscreen.move(12, 20+ (i-1) *12)
screen.text("ran crow update " ..i)
crow_updates[i] =falseendendscreen.update()
endfunctionrefresh()
redraw()
update_crow(3)
endfunctionupdate_crow(n)
norns.crow.send("foo = " ..n)
crow_updates[n] =trueend
The text was updated successfully, but these errors were encountered:
I had a chance to look at the i2c code and I see that based on the danger/fixme comments that this isn’t expected to work yet. I’d be happy to work on a PR to make the i2c queries safe, but I can imagine several different possible strategies with different tradeoffs, did anyone already have a plan in mind?
When simultaneously receiving serial messages from norns and i2c query commands from Teletype, crow will eventually crash.
Crow can also be made to crash immediately by redefining the
ii.self.query0
function while this is happening.Example real-world application: adding an option to dreamsequence to synchronize its scale with teletype (branch)
The crash is observable in both crow 3.0.0 and crow 4.0.5.
Example repro script (this is not totally minimal, I believe one coroutine calling crow.send is sufficient, but more crash sooner.)
The text was updated successfully, but these errors were encountered: