fluid-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [fluid-dev] Disable network at compile time.


From: Carlo Bramini
Subject: Re: [fluid-dev] Disable network at compile time.
Date: Sat, 9 Dec 2017 12:26:28 +0100 (CET)

Hello,
I was implementing it, but I noticed a strange thing.
Here:

https://github.com/FluidSynth/fluidsynth/blob/master/src/fluidsynth.c#L693

there is a piece of code that it is not emitted for MACOS.
And here:

https://github.com/FluidSynth/fluidsynth/blob/master/src/fluidsynth.c#L738

for some unknown reason (bug?), those network resources are not release also on 
WIN32.
So, I tried to remove WIN32 from that #ifdef.
Result: crash on quit.
After some debugging, I have seen that delete_fluid_server_socket():

https://github.com/FluidSynth/fluidsynth/blob/master/src/utils/fluid_sys.c#L1155

is closing the socket and then it frees 'server_socket' before the thread could 
reach this line:

https://github.com/FluidSynth/fluidsynth/blob/master/src/utils/fluid_sys.c#L1035

so an exception is raised as soon as 'server_socket->cont' is executed in the 
thread.
I was able to solve it by adding:

fluid_thread_join(server_socket->thread);

into delete_fluid_server_socket().
Actually, here:

https://github.com/FluidSynth/fluidsynth/blob/master/src/fluidsynth.c#L742

there is a call to join, but it seems to me it is expected to work for a 
different purpose that I cannot understand very well, actually FluidSynth never 
exits when "-i" and "-s" options are both specified and I have to kill it with 
the TaskManager.

Since that code was commented with an #ifdef on WIN32, it was not possible to 
see the crash before, although I do not understand very well why it was not 
visible on other platforms (luck?).

Sincerely.



> Il 8 dicembre 2017 alle 14.52 "Tom M." <address@hidden> ha scritto:
> 
> > In my opinion, the network support should be a feature, not a requirement 
> > and FluidSynth is a synthesizer,
> 
> Ok then, I dont mind if we make this feature optional. In fact there already 
> is a WITHOUT_SERVER macro for MacOSX. You could start from there, however 
> this macro should then be called NETWORK_SUPPORT. And we would need a dummy 
> implementation of new_fluid_server() in order to not break ABI.
> 
> Could you file a PR?
> 
> Tom
> 
> _______________________________________________
> fluid-dev mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/fluid-dev



reply via email to

[Prev in Thread] Current Thread [Next in Thread]