Bug #1022

avatar

NullReferenceException thrown in SqliteMessageBuffer.Add()

Added by Mirco Bauer 3578 days ago. Updated 3459 days ago.

Status:New Start:02/04/2015
Priority:Normal Due date:
Assigned to:avatarMirco Bauer % Done:

100%

Category:Engine
Target version:1.0.1
Complexity:

Medium

Found in Version:

Votes: 0

Description

2015-02-04 14:20:53,881 [-1281946768] DEBUG TRACE - [smuxi-engine-irc.dll] IrcProtocolManager.Dispose()
2015-02-04 14:20:53,881 [-1281946768] DEBUG TRACE - [smuxi-engine.dll] ProtocolManagerBase.Dispose()
2015-02-04 14:20:53,882 [-1281946768] DEBUG TRACE - [smuxi-engine.dll] Session.RemoveChat(chat = <IRC/GSDnet/IRC GSDnet>)
2015-02-04 14:20:54,536 [IrcProtocolManager (irc.gsd-software.net:6667) listener] DEBUG TRACE - [smuxi-engine.dll] Session.AddMessageToChat(chat = <IRC/GSDnet/IRC GSDnet>, msg = -!- Connection error! Reas
on: Thread was being aborted, ignoreFilters = False)
2015-02-04 14:20:54,536 [-1281946768] DEBUG TRACE - [smuxi-engine.dll] FrontendManager.NextProtocolManager()
2015-02-04 14:20:54,537 [-1281946768] DEBUG TRACE - [smuxi-engine.dll] Session.RemoveChat(chat = <IRC/GSDnet/#gsd>)
2015-02-04 14:20:54,830 [IrcProtocolManager (irc.gsd-software.net:6667) listener] ERROR Smuxi.Engine.Session - AddMessageToChat(<IRC/GSDnet/IRC GSDnet>, -!- Connection error! Reason: Thread was being abor
ted, False): chat.MessageBuffer.Add() threw exception:
2015-02-04 14:20:54,830 [IrcProtocolManager (irc.gsd-software.net:6667) listener] ERROR Smuxi.Engine.Session - AddMessageToChat(): 
System.NullReferenceException: Object reference not set to an instance of an object
  at Smuxi.Engine.SqliteMessageBuffer.Add (Smuxi.Engine.MessageModel msg) [0x0004a] in /usr/local/src/smuxi/src/Engine/MessageBuffers/SqliteMessageBuffer.cs:110 
  at Smuxi.Engine.Session.AddMessageToChat (Smuxi.Engine.ChatModel chat, Smuxi.Engine.MessageModel msg, Boolean ignoreFilters) [0x00057] in /usr/local/src/smuxi/src/Engine/Session.cs:1292 
2015-02-04 14:20:54,852 [IrcProtocolManager (irc.gsd-software.net:6667) listener] ERROR Smuxi.Engine.Session - AddMessageToChat(): Falling back to volatile message buffer...

Associated revisions

Revision b6a0133e0b1a3966c3287d8e4eabd9cff6fa45c5
Added by Mirco Bauer 3490 days ago

Engine: fixed NullReferenceException thrown in SqliteMessageBuffer.Count (closes: #1022)

There can be a race between SqliteMessageBuffer.Dispose() and .get_Count which
led to this exception:

Server stack trace:
at Smuxi.Engine.SqliteMessageBuffer.get_Count () [0x00000] in /usr/local/src/smuxi/src/Engine/MessageBuffers/SqliteMessageBuffer.cs:42
at Smuxi.Engine.ChatModel.GetSyncMessages () [0x0000d] in /usr/local/src/smuxi/src/Engine/Chats/ChatModel.cs:248
at Smuxi.Engine.ChatModel.get_Messages () [0x00000] in /usr/local/src/smuxi/src/Engine/Chats/ChatModel.cs:82

History

Updated by Mirco Bauer 3578 days ago

avatar

That looks like a race condition between Dispose() and Add()

Updated by Mirco Bauer 3490 days ago

avatar
  • Status changed from New to Closed
  • % Done changed from 0 to 100

Updated by Mirco Bauer 3490 days ago

avatar
  • Status changed from Closed to New

Closed wrong ticket number, bleh :/

Updated by Mirco Bauer 3459 days ago

avatar
  • Target version changed from 1.0 to 1.0.1

This issue is no longer a show stopper since this case is now handled by a84de167cd060b1412792964922caddb0fcaf712

Also available in: Atom PDF