Found the problem!

It seams, that there is a must have operation before every initstate_r 
function:

 >>memset(random_state, 0, sizeof(random_state));
 >>memset(&random_buf, 0, sizeof(random_buf));
     if (initstate_r(synth->random(), random_state,
                     sizeof(random_state), &random_buf))

adding these 2 first operations solved the problem. How it worked 
before? don't know what to say... :)
I've added those 2 memsets before every initstate_r call (in 
SynthEngone.cpp and OscilGen.cpp)


Will, can you update and retest again?

Regards,
Andrew

> Hi, Will!
>> On Thu, 30 Oct 2014 21:56:32 +0400
>> Andrew Deryabin <andrewderya...@gmail.com> wrote:
>>
>>> Hi, all!
>>>
>>>       I've merged my recent commits to lv2_plugin branch into master.
>>> Before actual work on lv2 plugin interface (though core lv2 methods
>>> already implemented in pre-alpha state) I want to optimize and expand
>>> yoshimi in several ways.
>>>
>>>       One of them - multi instance support. Now there is possibility to
>>> run many instances of yoshimi in single process. There is a cut from
>>> modified changelog:
>>>
>>> - Made yoshimi support multiple in-process instances:
>>>     1) Added "New instance" menu item in "Yoshimi" submemu.
>>>     2) Jack/alsa midi/audio port names are named "yoshimi" + postfix
>>>        (empty for the first instance and -1,-2,-3 etc.. for the next).
>>>     3) Windows names (main window, panel, keyboad) are named according
>>>        to instance number with unique postfix.
>>>     4) Only main window of the first instance exits process.
>>>
>>> Many testers are welcome! :)
>>>
>>> Regards,
>>> Andrew
>>
>> OK, some first tests.
>>
>> When I first compiled and ran this, I loaded up a patch set then as 
>> soon as I
>> tried to start another instance it failed with a segfault. Start the 
>> second
>> instance *before* loading any parameter sets and it seems to be OK.
>>
>> On one occasion opening then closing the panel window while running 
>> MIDI from
>> Rosegarden also segfaulted, but I can't reliably repeat this one.
>>
>> Having 3 instances, but only using the first 2 seemed to run very 
>> reliably,
>> and that was with me doing quite a lot of GUI stuff while the music 
>> was playing,
>> so I wonder if this is some kind of memory allocation problem.
>>
>> I can't close instances once they are running! Neither the windows 
>> close button
>> nor the menu one works. However, closing the 'master' one closed them 
>> all
>> cleanly.
>>
>> Nevertheless, this looks a very impressive start!
> It's good, that you've successfully tested core functions. I also have 
> random crashes, and it seems that the reason is in initstate_r 
> function and friends. Now searching for a problem in this code. It 
> successfully worked for single instance, but somehow goes wrong in 
> multi-instance setups.
>
> P.S. Now made last static vars in OscilGen per-instance ones and got 
> crash on yoshimi init. the crash was on initstate_r function. That's 
> may be the reason. It's very interesting to find he reason now :)
>
>>
>> P.S.
>> Rosegarden picked up the instances in exactly the same way as it does 
>> when I
>> launch them individually from file.
>>
> Good! It seams that I made right naming scheme.
>
> Regards,
> Andrew
>


------------------------------------------------------------------------------
_______________________________________________
Yoshimi-devel mailing list
Yoshimi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/yoshimi-devel

Reply via email to