davy7125 / polyphone

A soundfont editor for quickly designing musical instruments.
https://www.polyphone.io
GNU General Public License v3.0
370 stars 49 forks source link

segmentation fault in ModulatedParameter::computeValue() #191

Closed coderofsalvation closed 6 months ago

coderofsalvation commented 7 months ago

after auditing samples (via midi or onscreen keyboard) on linux x64 (nixos) it segfaults at random times:

(btw. if you're using nix, you can reproduce exactly the same build here )

gdb output

Thread 1 ".polyphone-wrap" received signal SIGSEGV, Segmentation fault.                                                        
0x000000000065ca38 in ModulatedParameter::computeValue() ()                                                                    
(gdb) bt                                                                                                                       
#0  0x000000000065ca38 in ModulatedParameter::computeValue() ()                                                                                                                                                                                               
#1  0x000000000065cb09 in ModulatedParameter::getIntValue() () 
#2  0x0000000000664088 in VoiceParam::getInteger(AttributeType) ()                                                             
#3  0x00000000006628c9 in Voice::getPresetNumber() ()
#4  0x00000000006669de in SoundEngine::addVoice(Voice*, QList<Voice*>) ()                                                      
#5  0x000000000065daca in Synth::playSmpl(int, int, int, int, int, EltID, EltID) ()                                            
#6  0x000000000065df84 in Synth::playInst(int, int, int, int, int, EltID) ()                                                   
#7  0x000000000065e3bf in Synth::playPrst(int, int, int, int, int) ()                                                          
#8  0x000000000065e638 in Synth::play(EltID, int, int, int) () 
#9  0x00000000006c4786 in PagePrst::keyPlayedInternal2(int, int) ()                                                            
#10 0x00000000005ecc17 in PageTable::keyPlayedInternal(int, int) ()                                                            
#11 0x00007ffff610258c in void doActivate<false>(QObject*, int, void**) ()                                                     
   from /nix/store/0acd4cnpgm06lhq4v95lw5qy4bipnha1-qtbase-5.15.11/lib/libQt5Core.so.5                                         
#12 0x0000000000832715 in MidiDevice::keyPlayed(int, int) ()   
#13 0x00000000005d860c in MidiDevice::customEvent(QEvent*) ()
#14 0x00007ffff60f69bd in QObject::event(QEvent*) ()                                                                           
   from /nix/store/0acd4cnpgm06lhq4v95lw5qy4bipnha1-qtbase-5.15.11/lib/libQt5Core.so.5                                         
#15 0x00007ffff6f7103e in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()                                             
   from /nix/store/0acd4cnpgm06lhq4v95lw5qy4bipnha1-qtbase-5.15.11/lib/libQt5Widgets.so.5                                      
#16 0x00007ffff60cb058 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()                                              
   from /nix/store/0acd4cnpgm06lhq4v95lw5qy4bipnha1-qtbase-5.15.11/lib/libQt5Core.so.5                                         
#17 0x00007ffff60ce091 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()                            
   from /nix/store/0acd4cnpgm06lhq4v95lw5qy4bipnha1-qtbase-5.15.11/lib/libQt5Core.so.5                                         
#18 0x00007ffff6123413 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) ()                                         
   from /nix/store/0acd4cnpgm06lhq4v95lw5qy4bipnha1-qtbase-5.15.11/lib/libQt5Core.so.5                                         
#19 0x00007ffff7baf0d7 in g_main_dispatch ()                   
   from /nix/store/5qxy21wbd1n391y8wrf2djyjkiz1bs16-glib-2.78.1/lib/libglib-2.0.so.0                                           
#20 0x00007ffff7bb1ff7 in g_main_context_iterate_unlocked.constprop ()                                                         
   from /nix/store/5qxy21wbd1n391y8wrf2djyjkiz1bs16-glib-2.78.1/lib/libglib-2.0.so.0                                           
#21 0x00007ffff7bb25cc in g_main_context_iteration ()                                                                          
   from /nix/store/5qxy21wbd1n391y8wrf2djyjkiz1bs16-glib-2.78.1/lib/libglib-2.0.so.0                                           
#22 0x00007ffff6122bf6 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()                        
   from /nix/store/0acd4cnpgm06lhq4v95lw5qy4bipnha1-qtbase-5.15.11/lib/libQt5Core.so.5  
davy7125 commented 6 months ago

It's been fixed in commit 6d41073.