mywave82 / opencubicplayer

Open Cubic Player (unix fork). Music visualizer for various tracked music formats (amiga modules, S3M, IT), chiptunes and other formats related to demoscene
https://stian.cubic.org/project-ocp.php
GNU General Public License v2.0
280 stars 19 forks source link

Segfault when playing specific broken(?) files from playlist #118

Closed tsr closed 1 month ago

tsr commented 1 month ago

I'm currently using the most recent version v0.2.109 (with ancient lib on v2.2.0) and noticed when i play specific broken/faulty files from a playlist (with other files in it), ocp will print the error which normally should be shown in the UI in the console, and also immediately segfault. Interestingly, when i play the file on it's own, i get the proper error message in the UI with what is likely wrong with the file [GMD/S3M] too many orders and/or patterns error: file structure corrupted without segfaulting.

You can try by downloading the folder /pub/modules/Screamtracker 3/Gravedigger from ftp.modland.com, there are (sadly) some files which are broken and trigger this, e.g. next magic.s3m.

Segfault:

Segmentation Fault
rax=0x00007fb2e04d7a80 rbx=0x00007ffd171383c8 rcx=0x0000000000000000 rdx=0x00007ffd171383c0
rdi=0x0000000000000293 rsi=0x000055b12550ab80 rbp=0x00007fb2e04d7a80 rsp=0x00007fb2e04d7a80
 r8=0x0000000000000007  r9=0x0000000000000000 r10=0x0000000000000000 r11=0x00007fb200000002
r12=0x0000000000000000 r13=0x000000000000ffe0 r14=0x0000000000000001 r15=0x0000000000000000
cs=0x5d00 fs=0x7fb2 gs=0xdef9
eip=0x0000000000000000
eflags=0x0000000000000018
err=0 trapno=0x0167ffd171382a8 cr2=0x0000000000010246 oldmask=0x0000000000000000

I'm also not sure if it's just with s3m files, i also had some broken mod files in the playlist some days ago, which properly only showed the error in UI without segfaulting, so maybe it's really only s3m, but might be worth to look into it deeper.

A bit offtopic: I would also wish that there was a config option to simply skip those files instead of showing the error in the UI so it keeps playing without interrupting.. ;)

mywave82 commented 1 month ago

I am not able to recreate the crash. Did you compile this yourself, if so could you run ocp with either valgrind or gdb?

valgrind ocp

or

gdb ocp              # Start GDB, it might ask you to download debugging information, hit yes
r                    # run
bt                   # when it has crashed, performing this step will generate a backtrace (what was the program doing when it crashed)
mywave82 commented 1 month ago

I think I was able to recreate your bug now :-)

tsr commented 1 month ago

Ok thank you! I'll retry in the next version then. Otherwise i will check with gdb/valgrind and let you know! And yes, i compiled by myself.