[Mono-list] crash in... mcs/class/corlib/System.Resources/ResourceManager.cs:123

David Jeske jeske at gmail.com
Wed Nov 14 19:36:57 UTC 2012


I'm seeing this exception sporadically when using a threaded http server
that opens a bunch of MySQL connections. I'm not sharing the
MySqlConnection object between threads, but it looks to me like they share
some singleton resourcemanager and perfcounters.

What is the right way to fix this?

Do I have to thread-lock around every MySqlConnection.Open() because they
are sharing singleton resources?

System.NullReferenceException: Object reference not set to an instance of
an object
  at System.Array.Copy (System.Array sourceArray, Int32 sourceIndex,
System.Array destinationArray, Int32 destinationIndex, Int32 length)
[0x00104] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System/Array.cs:975
  at System.Collections.ArrayList.CopyTo (Int32 index, System.Array array,
Int32 arrayIndex, Int32 count) [0x0002d] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System.Collections/ArrayList.cs:3064
  at System.Collections.ArrayList.CopyTo (System.Array array, Int32
arrayIndex) [0x00000] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System.Collections/ArrayList.cs:3046
  at System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider
obj, System.Type attributeType, Boolean inherit) [0x0028f] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System/MonoCustomAttrs.cs:252
  at System.Reflection.Assembly.GetCustomAttributes (System.Type
attributeType, Boolean inherit) [0x00000] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System.Reflection/Assembly.cs:225
  at System.Resources.ResourceManager.GetNeutralResourcesLanguage
(System.Reflection.Assembly a) [0x00000] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System.Resources/ResourceManager.cs:450
  at System.Resources.ResourceManager..ctor (System.String baseName,
System.Reflection.Assembly assembly) [0x00063] in
/private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System.Resources/ResourceManager.cs:123
  at MySql.Data.MySqlClient.Properties.Resources.get_ResourceManager ()
[0x00000] in <filename unknown>:0
  at MySql.Data.MySqlClient.Properties.Resources.get_PerfMonCategoryName ()
[0x00000] in <filename unknown>:0
  at MySql.Data.MySqlClient.PerformanceMonitor..ctor
(MySql.Data.MySqlClient.MySqlConnection connection) [0x00000] in <filename
unknown>:0
  at MySql.Data.MySqlClient.MySqlConnection.Open () [0x00000] in <filename
unknown>:0
  at KingOfDrawServer.SqlUtils.QuickSqlQuery (System.String sqlstatement,
System.Collections.Generic.Dictionary`2 parms,
KingOfDrawServer.MySqlQueryRowDelegate rowHandler) [0x0000b] in
/Users/jeske/Projects/KingOfDraw2/KingOfDrawServer/KingOfDrawServer/SqlUtils.cs:28
  at KingOfDrawServer.GuessHandler.getMyPendingDrawings
(Bend.Util.HttpProcessor p) [0x00060] in
/Users/jeske/Projects/KingOfDraw2/KingOfDrawServer/KingOfDrawServer/GuessHandler.cs:145
  at KingOfDrawServer.KingOfDrawHTTPServer.handleGETRequest
(Bend.Util.HttpProcessor p) [0x0018f] in
/Users/jeske/Projects/KingOfDraw2/KingOfDrawServer/KingOfDrawServer/KingOfDrawHTTPServer.cs:100
  at Bend.Util.HttpProcessor.handleGETRequest () [0x00000] in
/Users/jeske/Projects/KingOfDraw2/httpserver/SimpleHttpServer/SimpleHttpServer.cs:119
  at Bend.Util.HttpProcessor.process () [0x00052] in
/Users/jeske/Projects/KingOfDraw2/httpserver/SimpleHttpServer/SimpleHttpServer.cs:60
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20121114/d9c4d54e/attachment.html>


More information about the Mono-list mailing list