GNOME Bugzilla – Bug 170862
beagle fails my filenaming stress test
Last modified: 2005-03-19 04:38:02 UTC
I hacked together a quick perl script to create files with a variety of characters included. Unfortunately, beagle fails.
Created attachment 38929 [details] nametest.pl
First failure is this one: DEBUG: Starting task file:///home/dsd/beagle-index/nametest/ab DEBUG: Requesting new proxy 'FileSystemIndex' DEBUG: Waiting for proxy 'FileSystemIndex' DEBUG: Waiting code=0 Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Xml.XmlException: Referenced character was not allowed in XML. Normalization is True, checkCharacters = True Line 2, position 269. in [0x0019f] (at /var/tmp/portage/mono-1.1.4/work/mono-1.1.4/mcs/class/System.XML/System.Xml/XmlTextReader.cs:1614) System.Xml.XmlTextReader:ReadCharacterReference () in [0x001bd] (at /var/tmp/portage/mono-1.1.4/work/mono-1.1.4/mcs/class/System.XML/System.Xml/XmlTextReader.cs:1805) System.Xml.XmlTextReader:ReadAttributeValueTokens (int) in [0x00095] (at /var/tmp/portage/mono-1.1.4/work/mono-1.1.4/mcs/class/System.XML/System.Xml/XmlTextReader.cs:1667) System.Xml.XmlTextReader:ReadAttributes (bool) in [0x0008d] (at /var/tmp/portage/mono-1.1.4/work/mono-1.1.4/mcs/class/System.XML/System.Xml/XmlTextReader.cs:1252) System.Xml.XmlTextReader:ReadStartTag () in [0x00134] (at /var/tmp/portage/mono-1.1.4/work/mono-1.1.4/mcs/class/System.XML/System.Xml/XmlTextReader.cs:1180) System.Xml.XmlTextReader:ReadContent () in [0x000ef] (at /var/tmp/portage/mono-1.1.4/work/mono-1.1.4/mcs/class/System.XML/System.Xml/XmlTextReader.cs:560) System.Xml.XmlTextReader:Read () in [0x0002c] (at /var/tmp/portage/mono-1.1.4/work/mono-1.1.4/mcs/class/System.XML/System.Xml/XmlReader.cs:503) System.Xml.XmlReader:MoveToContent () in [0x00006] (at /var/tmp/portage/mono-1.1.4/work/mono-1.1.4/mcs/class/System.XML/System.Xml.Serialization/XmlSerializationReaderInterpreter.cs:83) System.Xml.Serialization.XmlSerializationReaderInterpreter:ReadRoot () in [0x00022] (at /var/tmp/portage/mono-1.1.4/work/mono-1.1.4/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs:322) System.Xml.Serialization.XmlSerializer:Deserialize (System.Xml.Serialization.XmlSerializationReader) in [0x0002e] (at /var/tmp/portage/mono-1.1.4/work/mono-1.1.4/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs:311) System.Xml.Serialization.XmlSerializer:Deserialize (System.Xml.XmlReader) in [0x00010] (at /var/tmp/portage/mono-1.1.4/work/mono-1.1.4/mcs/class/System.XML/System.Xml.Serialization/XmlSerializer.cs:299) System.Xml.Serialization.XmlSerializer:Deserialize (System.IO.TextReader) in [0x00067] (at /home/dsd/projects/ximian/beagle/beagled/FilteredIndexable.cs:86) Beagle.Daemon.FilteredIndexable:NewFromEitherXml (string) in [0x0000c] (at /home/dsd/projects/ximian/beagle/beagled/IndexHelper/RemoteIndexerImpl.cs:340) Beagle.IndexHelper.RemoteIndexerImpl:Add (string) in (unmanaged) 0x80b4e2f in <0x00004> (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[]) in [0x00033] (at /var/tmp/portage/mono-1.1.4/work/mono-1.1.4/mcs/class/corlib/System.Reflection/MonoMethod.cs:121) System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) --- End of inner exception stack trace --- in [0x00052] (at /var/tmp/portage/mono-1.1.4/work/mono-1.1.4/mcs/class/corlib/System.Reflection/MonoMethod.cs:125) System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) in [0x00006] (at /var/tmp/portage/mono-1.1.4/work/mono-1.1.4/mcs/class/corlib/System.Reflection/MethodBase.cs:80) System.Reflection.MethodBase:Invoke (object,object[]) in [0x0005f] (at /var/tmp/portage/dbus-0.23.2-r1/work/dbus-0.23.2/mono/Handler.cs:187) DBus.Handler:HandleMethod (DBus.MethodCall) in [0x0003d] (at /var/tmp/portage/dbus-0.23.2-r1/work/dbus-0.23.2/mono/Handler.cs:166) DBus.Handler:Message_Called (intptr,intptr,intptr) in <0x0003d> (wrapper native-to-managed) DBus.Handler:Message_Called (intptr,intptr,intptr) in (unmanaged) 0x45317c15 in <0x00004> (wrapper managed-to-native) Gtk.Application:gtk_main () in <0x00007> Gtk.Application:Run () in [0x00139] (at /home/dsd/projects/ximian/beagle/beagled/IndexHelper/IndexHelper.cs:106) Beagle.IndexHelper.IndexHelperTool:Main (string[]) This causes beagled to crash soon after. Joe filed this upstream but it is a WONTFIX case http://bugzilla.ximian.com/show_bug.cgi?id=72739 So ideally we want to work around it inside beagle.
Created attachment 38930 [details] [review] Solution Encode all 'odd' characters in the normal uri-escape type way for serialization, and convert them back after.
Created attachment 38931 [details] [review] Update Uri.HexUnescape is buggy, doesn't work with most unicode characters. Ripped the fixed version from Mono SVN.
Created attachment 38932 [details] [review] Update Can't escape characters >255
In CVS