TeamFlos / phira

GNU General Public License v3.0
1.27k stars 108 forks source link

[Fatal Error] 一个谱面使Phira崩溃并无法启动 #430

Open qaqFei opened 2 weeks ago

qaqFei commented 2 weeks ago

错误与MuMu模拟器无关, 错误来源: https://www.bilibili.com/video/BV1pS1vYxECT 下的评论

YuevUwU commented 1 week ago

Reproduction Method

  1. Import this chart
  2. Close/Kill Phira forcely (emulate phira crash)
  3. Reopen phira, it will freeze at a black screen for a while
  4. Wait for about 4 minutes, phira opened successfully
  5. info.yml wasn't generate

Interesting Log Test Environment: Linux Mint 21.3, self-built binary, v0.6.4 release

$ ./phira-main
GL_VERSION: 3.3 (Compatibility Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2
2024-10-19T10:37:33.633821722Z  WARN prpr::fs: none of info.yml, info.txt and info.csv is found, inferring
thread 'tokio-runtime-worker' panicked at /home/alan54692/.cargo/git/checkouts/prpr-macroquad-34ad6757d053bc13/19119d6/src/exec.rs:52:9:
macroquad does not support waking futures, please use coroutines, otherwise your pending future will block until the next frame
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2024-10-19T10:41:31.939649598Z DEBUG prpr::ui::text: creating cache texture: 2048x2048
qaqFei commented 1 week ago

On Windows, PHIRA doesn't crash immediately, it just crashes while it's being opened.

This is not the same as the phenomenon on Android.

20b628d94fc23a9347b439658e79895 when i open the chart: 4de237309f512e459b17e64f936aa3b

so, I recommend trying it on Android anyway.

YuevUwU commented 1 week ago

I tried on my POCO M5/M5s, it can successfully import restart forcely will cause ~20s blackscreen, and then I have to delete the chart ASAP and let it crash again to avoid it crash for several seconds by lowmemory

Full Log: restart-phira.log clear-and-enter-chart.log

Interesting log: clear-and-enter-chart.log#L1733

10-19 20:12:17.818   540   540 D lowmemorykiller: thrashing (74%) old_min_score_adj 0 new_min_score_adj 0 cur_min_score_adj 0
10-19 20:12:17.820   540   540 I lowmemorykiller: Kill 'org.flos.phira' (10324), uid 10423, oom_score_adj 0 to free 3952940kB rss, 1079204kB swap; reason: device is in direct reclaim and thrashing (74%)
qaqFei commented 1 week ago

so, how to fix it. Back up and delete beatmaps when crashing multiple times due to low memory?

qaqFei commented 1 week ago

Also, I have a question. Why can't I play a beatmap when it works fine on Windows? 😨

YuevUwU commented 1 week ago

so, how to fix it. Back up and delete beatmaps when crashing multiple times due to low memory?

Or Root and Delete /data/data/org.flos.phira/data/charts/custom/[chart_id] And I have no idea😓

Also, I have a question. Why can't I play a beatmap when it works fine on Windows? 😨

It's weird. Or if you mean why cannot upload the score, that is intended

qaqFei commented 1 week ago

It's weird. Or if you mean why cannot upload the score, that is intended

I mean the loading phase before playing the beatmap crashes Phira

qaqFei commented 1 week ago

两中国人为什么要用英文ヾ(•ω•`)o

EastCation commented 1 week ago

那我就拿中文说吧: 在我导入RPE时发现无法导入,经文件排查发现json谱面文件大小居然高达360MiB 不知道是不是Phira无法处理如此大的谱面文件 image

qaqFei commented 1 week ago

导入崩溃时内存导致的,而加载崩溃是assert

YuevUwU commented 1 week ago

主要我懒得切拼音输入法了(doge) (危,先給台灣人表明立場,我只希望兩岸能和平相處,要噴去DC群的off-topic噴,我不想提及我的意識型態)

qaqFei commented 1 week ago

这个项目可以打开谱面文件: https://github.com/MisaLiu/phi-chart-render 帧率能跑满

qaqFei commented 1 week ago

导入崩溃时内存导致的,而加载崩溃是assert

我之前尝试编译没有那个assert的版本, 经过一个上午的努力后失败了...

qaqFei commented 1 week ago

RPE内存没吃满就崩了 42232e6116863e208d729d9799fa16d

EastCation commented 1 week ago

RPE内存没吃满就崩了 42232e6116863e208d729d9799fa16d

我的PRE直接由于丢失info.txt而屏蔽了该谱面(或许是1.6 RPE的锅? image

qaqFei commented 1 week ago

我用的1.4

qaqFei commented 1 week ago

所以这个bug会修吗, 不然可能会有人导入了这样的谱面之后就只能重装phira了, 损失有点大(っ °Д °;)っ

YuevUwU commented 1 week ago

啊这...实不相瞒...我在安卓进不去这谱面呜呜呜 我所能做的只有把Linux log貼這邊了 https://gist.github.com/YuevUwU/0c564704cfe47ea05222c62118ceff5c 上次 video background freeze了還有報錯,這次我卡了10分鐘也不吭聲...

qaqFei commented 1 week ago

我不会rust,只会py 所以我可能拉不了pr

EastCation commented 1 week ago

所以这个bug会修吗, 不然可能会有人导入了这样的谱面之后就只能重装phira了, 损失有点大(っ °Д °;)っ

Linux不好说……毕竟我这边用的Arch和RHEL,比较麻烦 Windows有一个治标不治本的办法:删除谱面 导航到/data/charts/custom文件夹,里面有一堆文件夹,然后找到出问题谱面删掉即可

另提一嘴,我也是学Python NLP的。不过有过编写Minecraft java mod的经验,我可以试试修改源码并提交PR(

qaqFei commented 1 week ago

ヾ(≧▽≦*)o

qaqFei commented 1 week ago

主要还是android端的问题, 不root几乎无法删除谱面

YuevUwU commented 1 week ago

Bruh...花了2小时划水,结果问题挺明显的... 我该练练我代码能力了... Phira认为speedEvents不该是空Vector Phi Chart Render 觉得"Hmm...OK" Code from phi-chart-render 请问这是RPE的特性吗?或旧版的?

YuevUwU commented 1 week ago

Phira 兼容版:https://files.catbox.moe/rfp8vk.zip RPE 兼容版:https://files.catbox.moe/lbfgfa.zip (RPE 兼容版需自行将.zip后缀改为.pez) (RPE版本未测试,因为wine爆内存了...)

修复代码

sed -i 's/, "[^"]*": \[\]//g' chart.json

还得是您

感谢qaq_fei这次的谱面制作,这是我Phira生中的第一个φ [doge]

qaqFei commented 1 week ago

Phira认为speedEvents不该是空Vector

这可能涉及到rpe谱面规范的问题了,说实话还是挺乱的,目前谱面中仍存在许多令大多数以至于所有模拟器都无法兼容的选项。

至于speedEvents, 我的模拟器的计算方法是: 找到一个时间区间(例如Note当前的话,就是零到现在的时间。) 然后寻找符合的事件, 都是计算重合的部分, 考虑到存在变速, 对其积分, 然后加至结果中, 遍历完成后返回即可。

NuanRMxi commented 1 week ago

oh god.

qaqFei commented 1 week ago

这是我对于speedEvents的计算实现: image 我认为空的speedEvents理应返回值永远为0

qaqFei commented 1 week ago

https://github.com/qaqFei/PhigrosPlayer/blob/main/Chart_Objects_Rpe.py#L254

EastCation commented 1 week ago

一大清早就被邮箱轰炸了,~所以适当写个屏蔽规则有助于休息(什么~

复盘一下

本次问题很有可能是Phi谱面不规范的问题,所以我只能给出如下解决方案

因为我是midi作者,学过一段时间钢琴,所以我更推荐使用后者

qaqFei commented 1 week ago

我认为最好编写一套规范, 并给出各个语言的示例代码

qaqFei commented 1 week ago
  • 使用现有的通用标准进行改善,例如midi

摒弃现有的谱面格式难以实施 (?

EastCation commented 1 week ago
  • 使用现有的通用标准进行改善,例如midi

摒弃现有的谱面格式难以实施 (?

进行向下兼容,midi功能很强大的(什

qaqFei commented 1 week ago

本issue本身是因为phira导入谱面导致内存占用过多崩溃, 并且重启后仍继续导入

NuanRMxi commented 1 week ago

你好,经过检查,若SpeedEvent列表为空,那么这条线就没有SpeedEvents这个字段了

qaqFei commented 1 week ago

神奇

NuanRMxi commented 1 week ago

另外,Phira-docs有我编写的RPE谱面文档,至少有谱面的结构,但是十分粗糙请谅解。

qaqFei commented 1 week ago
  • 使用现有的通用标准进行改善,例如midi

摒弃现有的谱面格式难以实施 (?

进行向下兼容,midi功能很强大的(什

使用midi作为谱面听起来, (荒诞?)

qaqFei commented 1 week ago

另外,Phira-docs有我编写的RPE谱面文档,至少有谱面的结构,但是十分粗糙请谅解。

粗略看了一下, 不够详细, 但是对于一个要求不大的模拟器够用了 是否有完善文档的计划?

NuanRMxi commented 1 week ago

另外,Phira-docs有我编写的RPE谱面文档,至少有谱面的结构,但是十分粗糙请谅解。

粗略看了一下, 不够详细, 但是对于一个要求不大的模拟器够用了 是否有完善文档的计划?

文档一直都在不断完善,欢迎所有人向文档提交pr

qaqFei commented 1 week ago

我可以提交python的示例代码吗 q(≧▽≦q)

EastCation commented 1 week ago

我可以提交python的示例代码吗 q(≧▽≦q)

同,因为我也是Python学者,或许java也可以(思考

qaqFei commented 1 week ago

使用代码进行表达几乎不可能会产生歧义

NuanRMxi commented 1 week ago

欢迎写示例代码,我自己的模拟器还处于适配官谱阶段,所以并没有RPE谱面的示例代码片段

qaqFei commented 1 week ago

https://github.com/TeamFlos/phira-docs/pull/21

qaqFei commented 1 week ago

我想, 或许phira不应因为谱面不规范而不进行播放 或许可以增加一些逻辑以自动在播放之前修复一些谱面 (仅在内存中)

typed-sigterm commented 1 week ago

我想, 或许phira不应因为谱面不规范而不进行播放 或许可以增加一些逻辑以自动在播放之前修复一些谱面 (仅在内存中)

这会增加制谱的心智负担吧,除非是为了兼容性。就像 rust 哲学一样,能运行就是可靠的(unsafe: ?)

qaqFei commented 1 week ago

我想, 或许phira不应因为谱面不规范而不进行播放 或许可以增加一些逻辑以自动在播放之前修复一些谱面 (仅在内存中)

这会增加制谱的心智负担吧,除非是为了兼容性。就像 rust 哲学一样,能运行就是可靠的(unsafe: ?)

目前phira直接拒绝播放的方式已经导致部分官谱无法播放

NuanRMxi commented 1 week ago

修复谱面功能其实在prpr时代存在,但是不知道什么原因这个功能在phira中被删除了

NuanRMxi commented 1 week ago

我想, 或许phira不应因为谱面不规范而不进行播放 或许可以增加一些逻辑以自动在播放之前修复一些谱面 (仅在内存中)

RPE谱面文档很明显比phira晚了几辈子,我们根本就不知道什么是“规范的谱面”。

typed-sigterm commented 1 week ago

目前phira直接拒绝播放的方式已经导致部分官谱无法播放

我觉得这属于兼容问题的范围,修复(或者叫转换?)的范围仅限于为了向本家兼容