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

S3M module causes crash #71

Closed apollo18210 closed 1 year ago

apollo18210 commented 1 year ago

Hello,

I'm experiencing a crash when trying to play chiba city lights. This module plays just fine in other players, such as those using libopenmpt. I'm even able to play this in the DOS release of ocp.

Here is the config.log generated when I built ocp. config.log

I have also pasted the output below to help in pinpointing the cause. I have ocp built with debug enabled, but this crash doesn't trigger the debugger automatically so I have to run ocp through gdb from the start in order to provide the output requested in the crashreport.txt file.

$ gdb ocp
GNU gdb (GDB) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ocp...
(gdb) run
Starting program: /home/<user>/.local/src/opencubicplayer/ocp 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Setting to cfConfigDir to /home/<user>/.ocp/
Setting to cfDataDir to /usr/local/share/ocp/data/
Setting to cfProgramDir to /usr/local/lib/ocp/
Open Cubic Player for Unix v0.2.100, compiled on Oct  5 2022, 21:10:04
Ported to Unix by Stian Skjelstad
linking default objects...
running initializers...
initializing fileselector...
adbMetaInit: open(cfConfigDir/CPARCMETA.DAT): No such file or directory
Loading /home/<user>/.ocp/CPMODNFO.DAT .. Done
open(cfConfigDir/CPDIRDB.DAT): No such file or directory
Loading /home/<user>/.ocp/CPMUSBRN.DAT .. Empty database
Initing console... 
We have a PTY (so no need to test for framebuffer and/or vcsa)
[x11] X is online
[x11] rootwindow: width:1920 height:1080
[x11] xvidmode disabled in ocp.ini
Locating cdroms [.....]
[New Thread 0x7ffff53ff6c0 (LWP 167920)]
playerdevices:
 devpALSA: ALSA device driver.............. (#1)
 devpOSS : OSS player...................... not found: optimize ocp.ini!
 devpCA  : /usr/local/lib/ocp/devpcoreaudio.so: cannot open shared object file: No such file or directory
link error
 devpSDL2: SDL Player...................... (#3 p0 q0)
 devpSDL : /usr/local/lib/ocp/devpsdl.so: cannot open shared object file: No such file or directory
link error
 devpNone: Super High Quality Quiet Player. (#4)
 devpDisk: Disk Writer..................... (#5)
ALSA device driver selected...
[New Thread 0x7ffff46046c0 (LWP 167921)]
[New Thread 0x7ffff3e036c0 (LWP 167924)]
[New Thread 0x7ffff35f36c0 (LWP 167925)]
[New Thread 0x7ffff2df26c0 (LWP 167926)]

wavetabledevices:
 devwMixF: FPU Mixer....................... (#1 t0)
 devwMix : Mixer........................... (#2 t0)
 devwmixQ: Mixer........................... (#3 t1)
 devwNone: None............................ (#4)
FPU Mixer selected...
[devwmixf] INIT, using dwmixfa.c C version

loading chiba_city_lights.s3m... (187k)
double free or corruption (!prev)

Thread 1 "ocp" received signal SIGABRT, Aborted.
0x00007ffff7e3d49c in ?? () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff7e3d49c in ?? () from /usr/lib/libc.so.6
#1  0x00007ffff7ded958 in raise () from /usr/lib/libc.so.6
#2  0x00007ffff7dd753d in abort () from /usr/lib/libc.so.6
#3  0x00007ffff7e3163e in ?? () from /usr/lib/libc.so.6
#4  0x00007ffff7e4722c in ?? () from /usr/lib/libc.so.6
#5  0x00007ffff7e4936c in ?? () from /usr/lib/libc.so.6
#6  0x00007ffff7e4b9f3 in free () from /usr/lib/libc.so.6
#7  0x00007ffff6fae65a in LoadS3M (cpifaceSession=0x7ffff7b2d760 <cpifaceSessionAPI>, m=0x7ffff6fbd840 <mod>, file=0x555555806010) at gmdls3m.c:780
#8  0x00007ffff6f8ecc1 in gmdOpenFile (cpifaceSession=0x7ffff7b2d760 <cpifaceSessionAPI>, info=0x7ffff7cd17a0 <plModuleInfo>, file=0x555555806010, loader=0x7ffff6fac1c9 <LoadS3M>) at gmdpplay.c:269
#9  0x00007ffff6f8f439 in gmdOpenFileS3M (cpifaceSession=0x7ffff7b2d760 <cpifaceSessionAPI>, info=0x7ffff7cd17a0 <plModuleInfo>, file=0x555555806010) at gmdpplay.c:389
#10 0x00007ffff7a33d2d in plmpOpenFile (info=0x7ffff7cd17a0 <plModuleInfo>, fi=0x555555806010, cp=0x7ffff6fbace0 <gmdPlayerS3M>) at cpiface.c:2265
#11 0x00007ffff7a86218 in _fsMain (argc=1, argv=0x7fffffffe538) at pfsmain.c:299
#12 0x00007ffff7a22828 in init_modules (argc=1, argv=0x7fffffffe538) at pmain.c:932
#13 0x00007ffff7a22a90 in _bootup (argc=1, argv=0x7fffffffe538, ConfigDir=0x55555555a2a0 "/home/<user>/.ocp/", DataDir=0x55555556f5f0 "/usr/local/share/ocp/data/", ProgramDir=0x55555556f400 "/usr/local/lib/ocp/")
    at pmain.c:1001
#14 0x0000555555556b00 in runocp (handle=0x55555555a330, argc=1, argv=0x7fffffffe538) at kickload.c:545
#15 0x0000555555556c3d in main (argc=1, argv=0x7fffffffe538) at kickload.c:589
mywave82 commented 1 year ago

The last pattern in that S3M file is flooded with global commands