Closed xfangfang closed 1 year ago
I'm sorry to bother you again, but I think the issue with MPV should be related to the changes in newlib. The location of each crash may not be the same, but ultimately it is vsnprintf
that reports an error. If I use the previous image(devkitpro/devkita64:20221113) to compile, there is no such issue.
Crash report: 2168-0002
crash always at main thread
# this is my code to call mpv to draw on the screen
$ aarch64-none-elf-addr2line -e wiliwili.elf -f -p -C -a 0x24a7a0
0x000000000024a7a0: MPVCore::openglDraw(brls::Rect, float) at :?
$ aarch64-none-elf-addr2line -e wiliwili.elf -f -p -C -a 0x7a2254
0x00000000007a2254: mpv_render_context_render at :?
# mpv internal calls
$ aarch64-none-elf-addr2line -e wiliwili.elf -f -p -C -a 0x7c08e4
0x00000000007c08e4: render at :?
$ aarch64-none-elf-addr2line -e wiliwili.elf -f -p -C -a 0x7b0194
0x00000000007b0194: gl_video_render_frame at :?
$ aarch64-none-elf-addr2line -e wiliwili.elf -f -p -C -a 0x7aed24
0x00000000007aed24: pass_draw_to_screen at :?
$ aarch64-none-elf-addr2line -e wiliwili.elf -f -p -C -a 0x7ae78c
0x00000000007ae78c: pass_render_frame_dumb at :?
$ aarch64-none-elf-addr2line -e wiliwili.elf -f -p -C -a 0x7a896c
0x00000000007a896c: copy_image at :?
$ aarch64-none-elf-addr2line -e wiliwili.elf -f -p -C -a 0x7ba9a0
0x00000000007ba9a0: gl_sc_addf at :?
$ aarch64-none-elf-addr2line -e wiliwili.elf -f -p -C -a 0x80fe48
0x000000000080fe48: bstr_xappend_vasprintf at :?
$ aarch64-none-elf-addr2line -e wiliwili.elf -f -p -C -a 0x14f3610
0x00000000014f3610: vsnprintf at :?
$ aarch64-none-elf-addr2line -e wiliwili.elf -f -p -C -a 0x14f3560
0x00000000014f3560: _vsnprintf_r at :?
$ aarch64-none-elf-addr2line -e wiliwili.elf -f -p -C -a 0x14ec9c0
0x00000000014ec9c0: _svfprintf_r at :?
$ aarch64-none-elf-addr2line -e wiliwili.elf -f -p -C -a 0x1515c40
0x0000000001515c40: _dtoa_r at :?
# PC
$ aarch64-none-elf-addr2line -e wiliwili.elf -f -p -C -a 0x1517068
0x0000000001517068: _Balloc at :?
fixed with devkitA64 r22.1
Previous feedback
Details
vsnprintf
. Now it keeps throw errors (data abort) in vsnprintf. This function should be thread safe, I suspect there may be a problem with it .switch-mpv
relies on SDL to play audio, and updates toswitch-sdl2
cause audio noise when switching videos. This issue disappeared after downgradingswitch-sdl2
to2.0.14-1
. It seems that a better solution is to reimplement audio playback from within MPV instead of relying on SDL. I will implement this when I have time.