Page 1 of 1

Prevent MPD crash

Posted: November 21st, 2014, 4:46 am
by oispkc
In SocketMonitor.cxx source file

void
SocketMonitor::Dispatch(unsigned flags)
{
flags &= GetScheduledFlags();

if (flags != 0 && !OnSocketReady(flags) && IsDefined())
Cancel();
}

This function should be modified like below because sometimes segmentation fault occurs in this function
especially when using named pipe output.

void
SocketMonitor::Dispatch(unsigned flags)
{
flags &= GetScheduledFlags();

if (flags == 0) return;
if (!IsDefined()) return;
if (!OnSocketReady(flags))
Cancel();
}

Am I right?

Re: Prevent MPD crash

Posted: November 21st, 2014, 11:40 am
by max
No idea. You did not provide any information about what this tries to solve, and you did not explain why you want this change.