Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing Music in TOUR.ZZT crashes KevEdit #42

Open
sneakernets opened this issue Jul 15, 2021 · 4 comments
Open

Testing Music in TOUR.ZZT crashes KevEdit #42

sneakernets opened this issue Jul 15, 2021 · 4 comments

Comments

@sneakernets
Copy link

in KevEdit 1.1.2, Testing the Title Board music contained in the music playing object (the 2 in the corner) can crash the program. I'm using the Windows version.

@cknave
Copy link
Owner

cknave commented Jul 16, 2021

I was afraid of something like this when I updated the audio code. Could you let me know what version of Windows, what audio device, and what the default format is set to? (control panel > manage audio devices > [select your audio device] > properties > advanced)

@sneakernets
Copy link
Author

Windows 10 21H1, Speakers (Conexant 20672 SmartAudio HD), default format is 16bit 48kHz.

@computirman
Copy link
Contributor

computirman commented Aug 30, 2022

Windows 10 21H2, using the Generic USB Audio driver, default format is 16bit 48khz.

To repro:
Have a series of #play statements with 241 32nd notes. no problem.
Add a 242nd 32nd note. Crash.

It will crash on fewer, but 242 is the limit. Testing 80 32nd notes will crash after the 11th attempt.

if you take a line of 8 32nd notes and paste it 19 times, and don't hit up, down, PgUp or PgDown after pasting and test it, it will crash.

if you take a line of 8 32nd notes and paste it 19 times, hit PgDn, and test, it will be fine, and then PgUp to the top and test, it will be fine. PgDown and test again, crash.

I can do all of these very consistently on my machine.

@cknave
Copy link
Owner

cknave commented Mar 10, 2023

I can reproduce this with the pasting method on Windows 11. Stack trace:

(gdb) bt
#0  0x000000000041f76a in AudioCallback (userdata=0x7cf6d0, stream=0xb29a5c0 "", len=10584) at sdl_synth.c:228
#1  0x00007ffbf79e44d5 in ?? () from c:\Users\kvance\Desktop\SDL2.dll
#2  0x00007ffbf7a8c4c7 in SDL_DYNAPI_entry () from c:\Users\kvance\Desktop\SDL2.dll
#3  0x00007ffbf7b419ce in SDL_DYNAPI_entry () from c:\Users\kvance\Desktop\SDL2.dll
#4  0x00007ffc86d126bd in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#5  0x00007ffc87b6dfb8 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#6  0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) list
223
224     void AudioCallback(void *userdata, Uint8 *stream, int len)
225     {
226             int i;
227             for(i = 0; i < len && playbufferloc < playbuffermax; i++) {
228                     stream[i] = masterplaybuffer[playbufferloc];
229                     playbufferloc++;
230             }
231             for(; i < len; i++)
232                     stream[i] = ((SDL_AudioSpec *)userdata)->silence;

The source address is invalid?

(gdb) p i
$11 = 0
(gdb) p playbufferloc
$12 = 0
(gdb) p playbuffermax
$10 = 4689888
(gdb) p masterplaybuffer
$9 = (Uint8 *) 0xb54f040 <error: Cannot access memory at address 0xb54f040>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants