tildearrow / furnace

a multi-system chiptune tracker compatible with DefleMask modules
GNU General Public License v2.0
2.68k stars 210 forks source link

Attempting to open a specific XM module crashes Furnace #1978

Closed aquamarine-axo closed 5 months ago

aquamarine-axo commented 5 months ago

Steps to reproduce:

log:

[info] loading module...
[debug] trying zlib...
[debug] zlib inflate: incorrect header check
[debug] not zlib. loading as raw...
[trace] Extended Module
[trace] made with FastTracker v2.00   
[trace] version 104
[trace] channels: 28
[trace] repeat pos: 0
[trace] reading orders...
[trace] seeking to 150...
[debug] reading patterns...
[trace] pattern 0
[trace] total rows: 128
[trace] seeking to 159...
[trace] seeking to 1ac7...
[trace] pattern 1
[trace] total rows: 128
[trace] seeking to 1ad0...
[trace] seeking to 348a...
[trace] pattern 2
[trace] total rows: 64
[trace] seeking to 3493...
[trace] seeking to 3e31...
[trace] pattern 3
[trace] total rows: 128
[trace] seeking to 3e3a...
[trace] seeking to 5124...
[trace] pattern 4
[trace] total rows: 128
[trace] seeking to 512d...
[trace] seeking to 66e7...
[trace] pattern 5
[trace] total rows: 128
[trace] seeking to 66f0...
[trace] seeking to 7f3a...
[trace] pattern 6
[trace] total rows: 128
[trace] seeking to 7f43...
[trace] seeking to 97cc...
[trace] pattern 7
[trace] total rows: 128
[trace] seeking to 97d5...
[trace] seeking to abfa...
[trace] pattern 8
[trace] total rows: 128
[trace] seeking to ac03...
[trace] seeking to c0db...
[trace] pattern 9
[trace] total rows: 137
[trace] seeking to c0e4...
[trace] seeking to d4a2...
[trace] pattern 10
[trace] total rows: 131
[trace] seeking to d4ab...
[trace] seeking to eed3...
[trace] pattern 11
[trace] total rows: 128
[trace] seeking to eedc...
[trace] seeking to 108a2...
[trace] pattern 12
[trace] total rows: 128
[trace] seeking to 108ab...
[trace] seeking to 117ac...
[trace] pattern 13
[trace] total rows: 128
[trace] seeking to 117b5...
[trace] seeking to 13159...
[trace] pattern 14
[trace] total rows: 128
[trace] seeking to 13162...
[trace] seeking to 14934...
[trace] pattern 15
[trace] total rows: 128
[trace] seeking to 1493d...
[trace] seeking to 1620b...
[trace] pattern 16
[trace] total rows: 128
[trace] seeking to 16214...
[trace] seeking to 17c04...
[trace] pattern 17
[trace] total rows: 33
[trace] seeking to 17c0d...
[trace] seeking to 18148...
[trace] pattern 18
[trace] total rows: 128
[trace] seeking to 18151...
[trace] seeking to 19555...
[trace] pattern 19
[trace] total rows: 128
[trace] seeking to 1955e...
[trace] seeking to 1aed8...
[trace] pattern 20
[trace] total rows: 128
[trace] seeking to 1aee1...
[trace] seeking to 1ca06...
[trace] pattern 21
[trace] total rows: 128
[trace] seeking to 1ca0f...
[trace] seeking to 1e172...
[trace] pattern 22
[trace] total rows: 128
[trace] seeking to 1e17b...
[trace] seeking to 1f92c...
[trace] pattern 23
[trace] total rows: 128
[trace] seeking to 1f935...
[trace] seeking to 20739...
[trace] pattern 24
[trace] total rows: 32
[trace] seeking to 20742...
[trace] seeking to 20c11...
[trace] pattern 25
[trace] total rows: 128
[trace] seeking to 20c1a...
[trace] seeking to 223cb...
[trace] pattern 26
[trace] total rows: 128
[trace] seeking to 223d4...
[trace] seeking to 236a8...
[trace] pattern 27
[trace] total rows: 128
[trace] seeking to 236b1...
[trace] seeking to 24875...
[trace] pattern 28
[trace] total rows: 128
[trace] seeking to 2487e...
[trace] seeking to 26238...
[trace] pattern 29
[trace] total rows: 33
[trace] seeking to 26241...
[trace] seeking to 2671c...
[trace] pattern 30
[trace] total rows: 33
[trace] seeking to 26725...
[trace] seeking to 26cc2...
[trace] instrument 0
[trace] type: 24
[trace] 5 samples
[trace] sample header size: 40
[trace] 6
[trace] 6
[trace] 2
[trace] 3
[trace] 5
[trace] 2
[trace] 3
[trace] 5
[trace] 0
[trace] 0
[trace] 0
[trace] 0
[trace] 0
[trace] 0
[trace] 0
[trace] 0 128 5
[trace] initInternal(8,12170)
[trace] -1 255 246
[trace] initInternal(16,-851982)
terminate called after throwing an instance of 'std::bad_array_new_length'
  what():  std::bad_array_new_length
Stack trace (most recent call last):
#16   Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in 
#15   Object "./furnace", at 0x60227b0f69f4, in _start
#14   Object "/usr/lib/libc.so.6", at 0x78207d74ed4b, in __libc_start_main
#13   Object "/usr/lib/libc.so.6", at 0x78207d74ec87, in 
#12   Object "./furnace", at 0x60227b0ecb85, in main
#11   Object "./furnace", at 0x60227b1ae75d, in DivEngine::load(unsigned char*, unsigned long, char const*)
#10   Object "./furnace", at 0x60227b227992, in DivEngine::loadXM(unsigned char*, unsigned long)
#9    Object "./furnace", at 0x60227b29d475, in DivSample::init(unsigned int)
#8    Object "./furnace", at 0x60227b0a9f52, in 
#7    Object "/usr/lib/libstdc++.so.6", at 0x78207da97345, in __cxa_throw_bad_array_new_length
#6    Object "/usr/lib/libstdc++.so.6", at 0x78207daae1d5, in __cxa_throw
#5    Object "/usr/lib/libstdc++.so.6", at 0x78207da97509, in std::terminate()
#4    Object "/usr/lib/libstdc++.so.6", at 0x78207daadf19, in 
#3    Object "/usr/lib/libstdc++.so.6", at 0x78207da97b0b, in 
#2    Object "/usr/lib/libc.so.6", at 0x78207d74d4c2, in abort
#1    Object "/usr/lib/libc.so.6", at 0x78207d765a2f, in gsignal
#0    Object "/usr/lib/libc.so.6", at 0x78207d7bde44, in 
Aborted (Signal sent by tkill() 45176 1000)
zsh: IOT instruction (core dumped)  ./furnace ~/Music/jt_911.xm

also note that the file is indeed valid and does play under OpenMPT

the result:

https://github.com/tildearrow/furnace/assets/78063037/937ba02e-7d18-468e-abb0-6cf2d2e8f78c

tildearrow commented 5 months ago

Issue now fixed. Apparently sample headers are contiguous.