[beagle] Fix frequent beagled crashes under mono-2.8 (#641270)
- From: Arun Raghavan <arunsr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beagle] Fix frequent beagled crashes under mono-2.8 (#641270)
- Date: Fri, 18 Feb 2011 04:55:54 +0000 (UTC)
commit 67306ce5bb971ed147f263ba8104e5ba8062a899
Author: Alexandre Rostovtsev <tetromino gmail com>
Date: Mon Feb 14 22:22:20 2011 -0500
Fix frequent beagled crashes under mono-2.8 (#641270)
Beagled frequently crashes under mono-2.8 due to uncaught exceptions
in UnixConnectionHandler.WatchCallback() (see Gnome bug #641270 and
http://bugs.gentoo.org/show_bug.cgi?id=353533).
These crashes have two origins.
First, probably due to threading changes in mono, when WatchCallback()
is called, client can be null, so we need to check for it.
Second, presumably due to the exception policy changes in mono-2.8,
client.GetStream().EndRead() legitimately - and fairly frequently -
throws an IOException with Message "Not connected" and with a
null InnerException (instead of a SocketException, as was the case
under previous versions of mono); so we need to catch it.
Signed-off-by: Alexandre Rostovtsev <tetromino gmail com>
beagle/beagled/Server.cs | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/beagle/beagled/Server.cs b/beagle/beagled/Server.cs
index 0892dd9..f2ad70f 100644
--- a/beagle/beagled/Server.cs
+++ b/beagle/beagled/Server.cs
@@ -462,9 +462,10 @@ namespace Beagle.Daemon {
int bytes_read = 0;
try {
- bytes_read = this.client.GetStream ().EndRead (ar);
+ if (this.client != null)
+ bytes_read = this.client.GetStream ().EndRead (ar);
} catch (IOException e) {
- if (! (e.InnerException is SocketException))
+ if (! (e.InnerException is SocketException) && e.Message != "Not connected")
throw e;
} catch (ObjectDisposedException) { }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]