[Mono-docs-list] simple try/catch patch

Rafael Ferreira lists at ophion.org
Sun Nov 20 03:08:27 EST 2005


Miguel, 

Currently the ECMA provider does not trap exceptions. For instance, one
easy way to crash the browser is to do a url lookup for a malformed url
like this: "ecma:blah"...  that causes this beauty:

System.ArgumentOutOfRangeException: < 0
Parameter name: length
in [0x00088]
(at /home/rafael/dev/tmp/mono-1.1.9/mcs/class/corlib/System/String.cs:345) System.String:Substring (Int32 startIndex, Int32 length)
in [0x0001b]
(at /home/rafael/dev/mono-svn/monodoc/engine/ecma-provider.cs:1313)
Monodoc.EcmaHelpSource:GetFile (System.String url, System.String rest)
in [0x0000b]
(at /home/rafael/dev/mono-svn/monodoc/engine/ecma-provider.cs:859)
Monodoc.EcmaHelpSource:GetXmlFromUrl (System.String url, System.String
rest)
in [0x00004]
(at /home/rafael/dev/mono-svn/monodoc/engine/ecma-provider.cs:871)
Monodoc.EcmaHelpSource:GetTextFromUrl (System.String url)
in [0x0007f]
(at /home/rafael/dev/mono-svn/monodoc/engine/ecma-provider.cs:517)
Monodoc.EcmaHelpSource:GetText (System.String url, Monodoc.Node
match_node)
in [0x00670]
(at /home/rafael/dev/mono-svn/monodoc/engine/provider.cs:1254)
Monodoc.RootTree:RenderUrl (System.String url, Monodoc.Node match_node)
in [0x000b6]
(at /home/rafael/dev/mono-svn/mono-tools/docbrowser/browser.cs:556)
Monodoc.Browser:LoadUrl (System.String url)

I believe that letting the exception propagate is the best behavior for
the providers in general, the only problem was that up until my patch
the browser would not trap the exception and crash. 

Let me know if that doesn't make sense to you, 

- raf




On Fri, 2005-11-18 at 15:45 -0500, Miguel de Icaza wrote:
> Hello,
> 
> > this is a simple try/catch patch that should help put an end to the
> > claims of instability of the browser. This patch does not "fix" anything
> > per say but will prevent the browser from crashing if an exception
> > occurs while trying to render a url.  I'll commit it sometime in the
> > next few days if I no one is against it. 
> 
> That sounds fine, but what kind of errors have you observed with Monodoc
> that crash the browser?  We should be fixing those bugs.
> 



More information about the Mono-docs-list mailing list