milkytracker / MilkyTracker

An FT2 compatible music tracker
http://milkytracker.github.io/
Other
1.69k stars 162 forks source link

Issues running MilkyTracker under UBSAN #225

Open SoniEx2 opened 3 years ago

SoniEx2 commented 3 years ago

Compiled milkytracker with -fsanitize=undefined. This happened:

$ milkytracker 
Available Renderers: opengl opengles2 software 
Vendor     : X.Org
Renderer   : AMD CAYMAN (DRM 2.50.0 / 5.9.11-1-ck-ivybridge, LLVM 11.0.0)
Version    : OpenGL ES 3.1 Mesa 20.2.3
SDL: Minimum window size set to 1920x1080.
SDL: Using accelerated renderer.
SDL: Renderer supports rendering to texture.
ALSA: Period size = 1024 frames (requested 768), buffer size = 3072 frames
ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred
SDL: Using audio driver: alsa
SDL: Buffer size = 768 samples (requested 768)
ALSA: Period size = 1024 frames (requested 768), buffer size = 3072 frames
ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred
/home/soniex2/builds/milkytracker-git/src/milkytracker/src/tracker/PatternEditorControlEventListener.cpp:461:8: runtime error: load of value 94, which is not a valid value for type 'bool'
/home/soniex2/builds/milkytracker-git/src/milkytracker/src/tracker/Undo.h:83:11: runtime error: null pointer passed as argument 2, which is declared to never be null
/home/soniex2/builds/milkytracker-git/src/milkytracker/src/ppui/ListBox.cpp:380:22: runtime error: load of value 135, which is not a valid value for type 'bool'
/home/soniex2/builds/milkytracker-git/src/milkytracker/src/ppui/DialogFileSelector.cpp:270:84: runtime error: load of misaligned address 0x7ffe5211dc14 for type 'struct PPString *', which requires 8 byte alignment
0x7ffe5211dc14: note: pointer points here
  26 00 00 00 b0 5e c1 8d  38 56 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
              ^ 

(Ignore the underruns and whatnot, that's just computer being kinda crap.)

A few things we noticed:

  1. Loading XM and then playing on midi keyboard didn't output anything. This didn't output any UBSAN errors.
  2. At some point a note being played (on midi keyboard) stopped playing. This was about when we noticed the first and second UBSAN errors.
  3. We noticed errors 3 and 4 upon closing milkytracker, but they may have showed up when we used "save as" instead.