rncbc / synthv1

synthv1 - an old-school polyphonic synthesizer
https://synthv1.sourceforge.io
GNU General Public License v2.0
40 stars 10 forks source link

Another bug when working with a special preset #17

Closed AnClark closed 2 years ago

AnClark commented 3 years ago

I'm continue testing SynthV1 with REAPER. Today I've found another bug.

Preset with issue

Preset file ```xml 3 0.99904084205627441 0 -0 2 1 0 -0 0.00459640845656395 0.12084111571311951 0.24624323844909668 0.69593149423599243 0 0 0.53395593166351318 0.5 1 0.049604400992393494 0 -0 2 0.52650606632232666 0.12538035213947296 0.5547826886177063 0.69639170169830322 0.56676125526428223 1 -0 1 96.970710754394531 0.60932046175003052 0 0.16489776968955994 -0.44400355219841003 -0.83026361465454102 0.065328940749168396 -0.082021772861480713 -1 -0.36444777250289917 -0.016584195196628571 0.023350061848759651 0.75658077001571655 0.98371082544326782 0.33027938008308411 1 0.47323614358901978 0.17921185493469238 1 0.48525571823120117 0 0 1 0.37999999523162842 0.20000000298023224 0.20000000298023224 0.20000000298023224 0.20000000298023224 0 0 1 0.95175236463546753 0 0 2 0.85896515846252441 -0 -0 0.16226750612258911 0.00879296101629734 0.60693609714508057 0 -2 0 0.6011883020401001 0.5 1 0.17431449890136719 0.061738401651382446 0 1 1 0.071791119873523712 0.45163959264755249 0.54555881023406982 0.59177297353744507 1 3 0.52772045135498047 293.73703002929687 0.26580163836479187 -0 -0.6928020715713501 0.40426778793334961 0.086928427219390869 0.40468224883079529 -0.21630749106407166 0.61858391761779785 -0.62312740087509155 0.045989662408828735 0.002971498528495431 0.29200303554534912 1 0.37740409374237061 0.22757060825824738 0 0.043900132179260254 0.68884670734405518 0.13113300502300262 0 0 1 0.40000000596046448 0.20000000298023224 0.20000000298023224 0.20000000298023224 0.20000000298023224 0 0 0 0.5 0.5 0.5 0.5 0 0.5 0.5 0 0 0.5 0.5 0.5 0 0 0.5 0.5 180 0.5 0.5 0.5 0.5 0 0 1 0 127 ```

How to reveal this bug

  1. Load this preset;
  2. Play note Db7 -> E3 -> Db7.

GDB Backtrace

Thread 9 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16832.0xe00]
--Type <RET> for more, q to quit, c to continue without paging--
synthv1_wave::interp (this=0x3268fd0, i=4294967277, itab=8, alpha=-4.2949673e+09) at ../src/synthv1_wave.h:144
144                     const float x0 = frames[i];
(gdb) bt
#0  synthv1_wave::interp (this=0x3268fd0, i=4294967277, itab=8, alpha=-4.2949673e+09) at ../src/synthv1_wave.h:144
#1  0x00007ffaa061f207 in synthv1_wave::sample (this=0x3268fd0, phase=..., freq=-235.58374)
    at ../src/synthv1_wave.h:135
#2  0x00007ffaa01bd220 in synthv1_oscillator::sample (this=0x1225b6b8, freq=-235.58374) at ../src/synthv1_wave.h:295
#3  0x00007ffa9fef6685 in synthv1_impl::process (this=0x3268fd0, ins=0xb43ea60, outs=0xb43ea50, nframes=2048)
    at ../src/synthv1.cpp:2509
#4  0x00007ffaa04a0bda in synthv1::process (this=0x3267f50, ins=0xb43ea60, outs=0xb43ea50, nframes=2048)
    at ../src/synthv1.cpp:2878
#5  0x00007ffa9fe467b7 in synthv1_lv2::run (this=0x3267f50, nframes=2048) at ../src/synthv1_lv2.cpp:362
#6  0x00007ffa9fd199ed in synthv1_lv2_run (instance=0x3267f50, nframes=2048) at ../src/synthv1_lv2.cpp:828
#7  0x000000014005afde in ?? ()
#8  0x00000001403a2943 in ?? ()
#9  0x00000001403cca72 in ?? ()
#10 0x000000014076a101 in ?? ()
#11 0x000000014077211f in ?? ()
#12 0x0000000140761a9d in ?? ()
#13 0x00000001408c5d28 in ?? ()
#14 0x00000001408e5397 in ?? ()
#15 0x00000001408e546f in ?? ()
#16 0x00007ffb0aed7034 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#17 0x00007ffb0c0c2651 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#18 0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
rncbc commented 3 years ago

maybe fixed by cb59435, in develop branch

thanks

AnClark commented 3 years ago

My pleasure!

AnClark commented 3 years ago

Bug still exists. Simply swipe the keyboard from high keys (>=C8) to lower keys, then SynthV1 will crash again.

Here's my debugger screenshot. (The Chinese word above "Segmentation Fault" means "Exception occured".)

image

rncbc commented 3 years ago

maybe mitigated again with 37cbccd on develop branch

many thanks again for your precious reports cheers

AnClark commented 3 years ago

Both bug resolved, great!


What's more, sometimes both SynthV1 and PadthV1 may go mute after switching about 8~10 presets (by host's preset manager, not Vee-One's).

At that time, MIDI lamp still blinks, but with no sound. Only if I reload an instance it can play sound again.