[Mono-dev] Crash in ApplicationSettingsBase if property with SettingsSerializeAs.Xml is set to null

Justin Cherniak justin.cherniak at gmail.com
Fri Dec 14 03:09:34 EST 2007


To explain it better, as the test case demonstrates, I am not explicity
setting the value the RandomList value to null, but rather just setting the
other value and this causes the crash.

Thanks,
Justin Cherniak

On Dec 14, 2007 2:04 AM, Justin Cherniak <justin.cherniak at gmail.com> wrote:

> Hello everyone,
>
> I cannot really explain the reason behind this bug (I tried probing the
> source to no avail), but if you setting a setting on an
> ApplicationSettingsBase, if another setting which  the SettingsSerializeAs(
> SettingsSerializeAs.Xml) attribute on it is null, the following crash
> occurs:
>
> Unhandled Exception: System.ArgumentNullException: Argument cannot be
> null.
> Parameter name: s
>  at System.IO.StringReader..ctor (System.String s) [0x00031] in
> C:\cygwin\tmp\monobuild\build\BUILD\mono-
> 1.2.6\mcs\class\corlib\System.IO\StringReader.cs:55
>  at (wrapper remoting-invoke-with-check) System.IO.StringReader:.ctor(string)
>  at Mono.Xml2.XmlTextReader..ctor (System.String xmlFragment, XmlNodeType
> fragType, System.Xml.XmlParserContext context) [0x00000] in
> C:\cygwin\tmp\monobuild\build\BUILD\mono-
> 1.2.6\mcs\class\System.XML\System.Xml\XmlTextReader.cs:166
>  at System.Xml.XmlTextReader..ctor (System.String xmlFragment, XmlNodeType
> fragType, System.Xml.XmlParserContext context) [0x00006] in
> C:\cygwin\tmp\monobuild\build\BUILD\mono-
> 1.2.6\mcs\class\System.XML\System.Xml\XmlTextReader2.cs:119
>  at System.Xml.XmlDocumentFragment.set_InnerXml (System.String value)
> [0x00081] in C:\cygwin\tmp\monobuild\build\BUILD\mono-
> 1.2.6\mcs\class\System.XML\System.Xml\XmlDocumentFragment.cs:69
>  at System.Configuration.CustomizableFileSettingsProvider.SaveProperties (
> System.Configuration.ExeConfigurationFileMap exeMap,
> System.Configuration.SettingsPropertyValueCollection collection,
> ConfigurationUserLevel level, System.Configuration.SettingsContextcontext, Boolean checkUserLevel) [0x00191] in
> C:\cygwin\tmp\monobuild\build\BUILD\mono-
> 1.2.6\mcs\class\System\System.Configuration\CustomizableFileSettingsProvider.cs:597
>  at
> System.Configuration.CustomizableFileSettingsProvider.SetPropertyValues (
> System.Configuration.SettingsContext context,
> System.Configuration.SettingsPropertyValueCollection collection) [0x00041]
> in C:\cygwin\tmp\monobuild\build\BUILD\mono-
> 1.2.6\mcs\class\System\System.Configuration\CustomizableFileSettingsProvider.cs:692
>  at System.Configuration.LocalFileSettingsProvider.SetPropertyValues (
> System.Configuration.SettingsContext context,
> System.Configuration.SettingsPropertyValueCollection values) [0x00000] in
> C:\cygwin\tmp\monobuild\build\BUILD\mono-
> 1.2.6\mcs\class\System\System.Configuration\LocalFileSettingsProvider.cs:95
>  at System.Configuration.ApplicationSettingsBase.Save () [0x00099] in
> C:\cygwin\tmp\monobuild\build\BUILD\mono-
> 1.2.6\mcs\class\System\System.Configuration\ApplicationSettingsBase.cs:121
>  at Program.Main (System.String [] args) [0x00000]
>
> It is kind of hard to explain, but running the attached test code
> demonstrates the issue (it runs on MS.NET without a problem).
>
> I filed this as Bug 348646<https://bugzilla.novell.com/show_bug.cgi?id=348646>but wanted to post it here also to alert everyone to it.
>
> Thanks again,
> Justin Cherniak
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071214/031db407/attachment.html 


More information about the Mono-devel-list mailing list