-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Description
本来发在 discuss 不过进一步验证觉得应该就是 bug 。
最近我在用 soluna 的时候发现运行一段时间后会卡死,在 Linux 和 macOS 尤其容易发生。
以下是最小 demo, 在 Linux 下持续运行一段时间后, 就会停止打印,同时窗口点击也无响应。持续时间长短不一,可能二十来分钟,可能几分钟就发生。但是在 Windows 不会(我预计还是会的,只是概率低时间长)。
local callback = {}
function callback.frame(_count)
print "frame"
end
return callback加上取自 deepfuture 的 flow 后, Windows 版本也会发生卡住,但是要很久,比如我今天尝试挂了两个半小时发生了卡住的情况。这个 demo 2 在 Linux 卡住的情况更快一点,十分钟左右发生:
local flow = require "src.core.flow"
local ltask = require "ltask"
local callback = {}
local game = {}
function game.idle()
print "idle"
flow.sleep(58)
return flow.state.idle
end
flow.load(game)
flow.enter(flow.state.idle)
local last_cs
local accumulator = 0
local MAX_DT = 0.25
local TICK = 1 / 60
function callback.frame(_count)
local _, now_cs = ltask.now()
if not last_cs then
last_cs = now_cs
end
local dt = (now_cs - last_cs) / 100.0
last_cs = now_cs
if dt > MAX_DT then
dt = MAX_DT
end
accumulator = accumulator + dt
while accumulator >= TICK do
flow.update()
accumulator = accumulator - TICK
end
end
return callback我把代码回滚到添加 mainthread 之前,目前没有观察到异常。
我怀疑是 mainthread wait 的时候卡住。猜测如下:
lmessage_send 在消息队列满时静默丢弃数据, send_message 无法把帧事件送入 lua,boot.mainthread_wait() 因此被永久阻
塞。
不过我尝试在丢弃时加了个 fprintf, 复现卡死的时候并没有打印出来。
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels