Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
qaqFei opened this issue Oct 18, 2024 · 60 comments
Open

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

qaqFei opened this issue Oct 18, 2024 · 60 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@qaqFei
Copy link

qaqFei commented Oct 18, 2024

  • 谱面文件 https://qaq-fei-bilibili.lanzouv.com/ilgP72buflza
  • Phira版本: 0.6.4
    视频: https://github.com/user-attachments/assets/db6c795f-586b-4e48-88af-1dcb9b730d37

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

@YuevUwU
Copy link
Contributor

YuevUwU commented Oct 19, 2024

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
Copy link
Author

qaqFei commented Oct 19, 2024

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
Copy link
Contributor

YuevUwU commented Oct 19, 2024

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
Copy link
Author

qaqFei commented Oct 19, 2024

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

@qaqFei
Copy link
Author

qaqFei commented Oct 19, 2024

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

@YuevUwU
Copy link
Contributor

YuevUwU commented Oct 19, 2024

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
Copy link
Author

qaqFei commented Oct 19, 2024

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
Copy link
Author

qaqFei commented Oct 19, 2024

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

@EastCation
Copy link

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

@qaqFei
Copy link
Author

qaqFei commented Oct 19, 2024

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

@YuevUwU
Copy link
Contributor

YuevUwU commented Oct 19, 2024

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

@qaqFei
Copy link
Author

qaqFei commented Oct 19, 2024

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

@qaqFei
Copy link
Author

qaqFei commented Oct 19, 2024

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

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

@qaqFei
Copy link
Author

qaqFei commented Oct 19, 2024

RPE内存没吃满就崩了
42232e6116863e208d729d9799fa16d

@EastCation
Copy link

RPE内存没吃满就崩了 42232e6116863e208d729d9799fa16d

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

@qaqFei
Copy link
Author

qaqFei commented Oct 19, 2024

我用的1.4

@qaqFei
Copy link
Author

qaqFei commented Oct 19, 2024

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

@YuevUwU
Copy link
Contributor

YuevUwU commented Oct 19, 2024

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

@qaqFei
Copy link
Author

qaqFei commented Oct 19, 2024

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

@EastCation
Copy link

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

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

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

@qaqFei
Copy link
Author

qaqFei commented Oct 19, 2024

ヾ(≧▽≦*)o

@qaqFei
Copy link
Author

qaqFei commented Oct 19, 2024

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

@YuevUwU
Copy link
Contributor

YuevUwU commented Oct 19, 2024

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

@YuevUwU
Copy link
Contributor

YuevUwU commented Oct 19, 2024

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
Copy link
Author

qaqFei commented Oct 19, 2024

Phira认为speedEvents不该是空Vector

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

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

@NuanRMxi
Copy link
Member

oh god.

@qaqFei
Copy link
Author

qaqFei commented Oct 19, 2024

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

@qaqFei
Copy link
Author

qaqFei commented Oct 19, 2024

@EastCation
Copy link

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

复盘一下

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

  • 像国际标准化组织那样直接写一套标准,所有模拟器需强制支持(欧盟:勿cue)
  • 使用现有的通用标准进行改善,例如midi,详情可见我的这篇文章[与我的星雨引擎

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

@qaqFei
Copy link
Author

qaqFei commented Oct 19, 2024

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

@NuanRMxi
Copy link
Member

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

@qaqFei
Copy link
Author

qaqFei commented Oct 19, 2024

神奇

@NuanRMxi
Copy link
Member

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

@qaqFei
Copy link
Author

qaqFei commented Oct 19, 2024

  • 使用现有的通用标准进行改善,例如midi

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

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

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

@qaqFei
Copy link
Author

qaqFei commented Oct 19, 2024

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

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

@NuanRMxi
Copy link
Member

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

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

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

@qaqFei
Copy link
Author

qaqFei commented Oct 19, 2024

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

@EastCation
Copy link

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

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

@qaqFei
Copy link
Author

qaqFei commented Oct 20, 2024

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

@NuanRMxi
Copy link
Member

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

@NuanRMxi NuanRMxi added bug Something isn't working documentation Improvements or additions to documentation help wanted Extra attention is needed labels Oct 20, 2024
@qaqFei
Copy link
Author

qaqFei commented Oct 20, 2024

TeamFlos/phira-docs#21

@qaqFei
Copy link
Author

qaqFei commented Oct 20, 2024

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

@typed-sigterm
Copy link

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

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

@qaqFei
Copy link
Author

qaqFei commented Oct 20, 2024

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

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

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

@NuanRMxi
Copy link
Member

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

@NuanRMxi
Copy link
Member

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

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

@typed-sigterm
Copy link

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

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

@qaqFei
Copy link
Author

qaqFei commented Oct 20, 2024

lchzh3473的文档中详细描述了phigros在面对不规范的谱面时的表现
https://docs.lchzh.net/learning/phigros/metrics
https://docs.lchzh.net/learning/phiediter/exception

@NuanRMxi
Copy link
Member

以下是个人发言不代表TeamFlos
不建议导入官谱到phira中,我认为这是一种“盗版”

@qaqFei
Copy link
Author

qaqFei commented Oct 20, 2024

image

@qaqFei
Copy link
Author

qaqFei commented Oct 20, 2024

以下是个人发言不代表TeamFlos 不建议导入官谱到phira中,我认为这是一种“盗版”

我们在此仅讨论数据格式, 而不是 谱面、音频、曲绘

@qaqFei
Copy link
Author

qaqFei commented Oct 20, 2024

总结一下

  • 该issue涉及到的phira bug/?有2个
    • phira在加载过大的谱面时内存不足导致崩溃, 随后启动时继续导入, 陷入死循环
    • phira在加载谱面时由于一些字段为空数组而导致闪退, 而直接删除键值却可以正常运行
  • 谱面格式规范问题
    • 目前除了官谱格式, 其他所有谱面格式几乎都没有明确的规范和一个完全的模拟器实现
  • 没有了

@YuevUwU
Copy link
Contributor

YuevUwU commented Oct 20, 2024

言下之意,他想透过参考现有的谱面规范(lchzh3473的官谱规范)来制定自制谱的谱面规范

@qaqFei
Copy link
Author

qaqFei commented Oct 20, 2024

言下之意,他想透过参考现有的谱面规范(lchzh3783的官谱规范)来制定自制谱的谱面规范

他的规范也不是他制定的, 而是通过技术手段从phigros测量得到的

@qaqFei
Copy link
Author

qaqFei commented Oct 20, 2024

lchzh 3792 3473目前的docs仅仅简单描述了部分rpe谱面键值

@NuanRMxi
Copy link
Member

NuanRMxi commented Oct 20, 2024

总之我不会修,我就一臭写文档的,同时也不建议参考lchzh3473的文档,为什么?就是觉得膈应,自己搜一下吧

@qaqFei
Copy link
Author

qaqFei commented Oct 21, 2024

image
不用搜了 (放了2个图片, 等一下加载)image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants