Bug 12197 - crash in System.Resources.ResourceManager.GetObject (or GetString)
Summary: crash in System.Resources.ResourceManager.GetObject (or GetString)
Status: RESOLVED NORESPONSE
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-05-10 13:43 UTC by Stephen McConnel
Modified: 2015-03-25 10:09 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
The attached patch file appears to cleanly solve the crash by swallowing the exceptions being thrown. Other places in the same file already have try/catch blocks to swallow exceptions. (1017 bytes, patch)
2013-05-10 13:43 UTC, Stephen McConnel
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description Stephen McConnel 2013-05-10 13:43:49 UTC
Created attachment 3946 [details]
The attached patch file appears to cleanly solve the crash by swallowing the exceptions being thrown.  Other places in the same file already have try/catch blocks to swallow exceptions.

When loading localized resources, attempting to load a picture for a button caused an exception to be thrown with the following stack trace:

System.IO.BinaryReader.FillBuffer (numBytes=4) in /home/steve/fwrepo/mono/mono/mcs/class/corlib/System.IO/BinaryReader.cs:119
System.IO.BinaryReader.ReadInt32 () in /home/steve/fwrepo/mono/mono/mcs/class/corlib/System.IO/BinaryReader.cs:432
System.Resources.ResourceReader.ReadHeaders () in /home/steve/fwrepo/mono/mono/mcs/class/corlib/System.Resources/ResourceReader.cs:144
System.Resources.ResourceReader..ctor (stream={System.IO.UnmanagedMemoryStream}) in /home/steve/fwrepo/mono/mono/mcs/class/corlib/System.Resources/ResourceReader.cs:127
System.Resources.ResourceSet..ctor (stream={System.IO.UnmanagedMemoryStream}) in /home/steve/fwrepo/mono/mono/mcs/class/corlib/System.Resources/ResourceSet.cs:82
System.Resources.RuntimeResourceSet..ctor (stream={System.IO.UnmanagedMemoryStream}) in /home/steve/fwrepo/mono/mono/mcs/class/corlib/System.Resources/RuntimeResourceSet.cs
System.Reflection.MonoCMethod.Invoke (obj=(null), invokeAttr=System.Reflection.BindingFlags.Instance|System.Reflection.BindingFlags.Public, binder={System.Reflection.Binder.Default}, parameters={object[1]}, culture=(null)) in /home/steve/fwrepo/mono/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:526
System.Reflection.MonoCMethod.Invoke (invokeAttr=System.Reflection.BindingFlags.Instance|System.Reflection.BindingFlags.Public, binder={System.Reflection.Binder.Default}, parameters={object[1]}, culture=(null)) in /home/steve/fwrepo/mono/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:541
System.Activator.CreateInstance (type={System.Resources.RuntimeResourceSet}, bindingAttr=System.Reflection.BindingFlags.Instance|System.Reflection.BindingFlags.Public, binder={System.Reflection.Binder.Default}, args={object[1]}, culture=(null), activationAttributes={object[0]}) in /home/steve/fwrepo/mono/mono/mcs/class/corlib/System/Activator.cs:299
System.Activator.CreateInstance (type={System.Resources.RuntimeResourceSet}, args={object[1]}, activationAttributes={object[0]}) in /home/steve/fwrepo/mono/mono/mcs/class/corlib/System/Activator.cs:234
System.Activator.CreateInstance (type={System.Resources.RuntimeResourceSet}, args={object[1]}) in /home/steve/fwrepo/mono/mono/mcs/class/corlib/System/Activator.cs:229
System.Resources.ResourceManager.InternalGetResourceSet (culture={pt}, createIfNotExists=true, tryParents=true) in /home/steve/fwrepo/mono/mono/mcs/class/corlib/System.Resources/ResourceManager.cs:408
System.Resources.ResourceManager.GetObject (name="DatabaseNew", culture={pt}) in /home/steve/fwrepo/mono/mono/mcs/class/corlib/System.Resources/ResourceManager.cs:201
SIL.FieldWorks.Properties.Resources.get_DatabaseNew () in /home/steve/fwrepo/fw/Src/Common/FieldWorks/Properties/Resources.Designer.cs:65
SIL.FieldWorks.WelcomeToFieldWorksDlg.InitializeComponent () in /home/steve/fwrepo/fw/Src/Common/FieldWorks/WelcomeToFieldWorksDlg.Designer.cs:155
SIL.FieldWorks.WelcomeToFieldWorksDlg..ctor (helpTopicProvider={SIL.FieldWorks.XWorks.LexText.LexTextApp}, appAbbrev="flex", exception=(null), showReportingRow=false) in /home/steve/fwrepo/fw/Src/Common/FieldWorks/WelcomeToFieldWorksDlg.cs:83
SIL.FieldWorks.FieldWorks.ShowWelcomeDialog (args=, startingApp=, lastProjectId=, exception=) in /home/steve/fwrepo/fw/Src/Common/FieldWorks/FieldWorks.cs:1488
SIL.FieldWorks.FieldWorks.DetermineProject (Parameters=) in /home/steve/fwrepo/fw/Src/Common/FieldWorks/FieldWorks.cs:1157
SIL.FieldWorks.FieldWorks.LaunchApplicationFromCommandLine (Parameters=) in /home/steve/fwrepo/fw/Src/Common/FieldWorks/FieldWorks.cs:355
SIL.FieldWorks.FieldWorks.Main (Parameters=) in /home/steve/fwrepo/fw/Src/Common/FieldWorks/FieldWorks.cs:316

The same code compiled and run exactly the same on Windows performs as expected, without any exception being thrown to abort the program.  I haven't been able to produce a small example program to demonstrate the bug, but our big project definitely triggers the problem reliably.  A similar problem was also encountered with using the GetString method as well.
Comment 1 Marek Safar 2014-03-07 09:45:27 UTC
Could you provide repro for the issue?
Comment 2 Marek Safar 2015-03-25 10:09:51 UTC
Fixed in master