On Thu, 9 Jul 2009, Sebastian Moors wrote:

> Hi everyone,
>
> i'm getting a quite reproducable segfault when using the alsa driver.
>
> The following steps work for me to get the bug on different systems:
>
> 1. Start jackd --driver alsa ( so it blocks the alsa device for hydrogen )
> 2. Start hydrogen --driver alsa
> 3. see Backtrace below ..
>
> I can't get it everytime, but it happens one in two times.
> - Sebastian
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00007ffff5664cb3 in __dynamic_cast () from /usr/lib/libstdc++.so.6
> (gdb) bt
> #0  0x00007ffff5664cb3 in __dynamic_cast () from /usr/lib/libstdc++.so.6
> #1  0x0000000000553850 in H2Core::Sampler::makeTrackOutputQueues (
>    this=0x9d9be0) at libs/hydrogen/src/sampler/sampler.cpp:752

I think the attached patch will fix this.  However, please don't apply it 
to SVN because I'd like to review this section of code.  I think I may 
have seen another subtle error.  I also want to make sure we're not 
sharing the pointer with anyone else.

Peace,
Gabriel

diff --git a/libs/hydrogen/src/hydrogen.cpp b/libs/hydrogen/src/hydrogen.cpp
index 1529058..baa0007 100644
--- a/libs/hydrogen/src/hydrogen.cpp
+++ b/libs/hydrogen/src/hydrogen.cpp
@@ -1666,6 +1666,7 @@ void audioEngine_startAudioDrivers()
                        delete m_pAudioDriver;
                        m_pAudioDriver = new NullDriver( audioEngine_process );
                        mx.unlock();
+                       
AudioEngine::get_instance()->get_sampler()->set_audio_output( m_pAudioDriver );
                        m_pAudioDriver->init( 0 );
                        m_pAudioDriver->connect();
                }

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Hydrogen-devel mailing list
Hydrogen-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel

Reply via email to