GNOME Bugzilla – Bug 593152
Closing „/“ search bar cause f-spot crash
Last modified: 2009-11-20 08:47:27 UTC
Created attachment 141747 [details] log.txt 1. Open f-spot 2. Pres „/“ key and enter some search term 3. Close the search bar and f-spot will crash
WORKSFORME
I cannot reproduce too... Does it ALWAYS crash to you? Can you post the exact steps? thanks
Yes, it always crash. I tried Serbian and English locale F-spot versions: 0.6.0.0, 0.6.1.1 and git. It looks like GTK problem: (f-spot:25888): GdkPixbuf-WARNING **: GdkPixbufLoader finalized without calling gdk_pixbuf_loader_close() - this is not allowed. You must explicitly end the data stream to the loader before dropping the last reference. I am using gtk+-2.17.8.
please post the exact steps, as we cannot reproduce. (p.s. remove NEEDINFO when you reply)
1. Open f-spot (from menu, terminal,...) 2. Pres „/“ on keyboard, and the search bar will appear 3. Enter some search criterium 4. Close the search bar („X“ button on right side of the bar) I don’t know better :( The problem remains with new GTK/F-Spot.
Created attachment 147252 [details] f-spot --debug output Same here. I can reproduce it every time. The steps are the same as Милош Поповић is reporting. latest git is still affected. Marshaling delete_text signal Exception in Gtk# callback delegate Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Cannot be negative. Parameter name: length at System.String.Substring (Int32 startIndex, Int32 length) [0x00085] in /build/buildd/mono-2.4.2.3+dfsg/mcs/class/corlib/System/String.cs:370 at FSpot.Widgets.FindBar.HandleEntryTextDeleted (System.Object sender, Gtk.TextDeletedArgs args) [0x0000e] in /usr/src/f-spot/src/Widgets/FindBar.cs:118 [...] at Gtk.Application.gtk_main() at Gtk.Application.Run() at FSpot.Driver.Main(System.String[] args) in /usr/src/f-spot/src/main.cs:line 244 Attached the complete f-spot --debug output.
That's the output of the log output line in FindBar.cs. I used the search string 'x' as example. Log.Debug ("[HandleEntryTextDeleted] start {0} end {1} len {2} last {3}", args.StartPos, args.EndPos, length, last_entry_text); [Debug 09:44:33.710] start 0 end -1 len -1 last x
Created attachment 147258 [details] [review] checking for invalid string range The TextDeleted handler seems to be called by: private void Clear () { entry.Text = String.Empty; Hide (); } Which is called when pressing on the clear button. Emptying the text of the entry seems to call the text deleted method, but without valid range parameters: 0 to -1. Would it have any side effects checking this in HandleEntryTextDeleted?
I confirm the bug and Patch (147258 above) fixes it for me. I compiled f-spot from ubuntu src-deb with patch above. F-spot now performs like one would expect.
Review of attachment 147258 [details] [review]: Looks reasonable to me. I don't see this behavior documented in the GTK+ docs, but given that it's a stock widget, we can't do much else. If it's up to me, it can go in. Will do so soon unless someone has serious objections.
Created attachment 147871 [details] [review] checking for invalid string range and assuring parenthesis As Mike pointed out, this patch assures the open_parens/close_parens variables setted correctly.
Created attachment 147872 [details] [review] checking for invalid string range and assuring parenthesis, shorter version Making it shorter. string txt = length < 0 ? last_entry_text : last_entry_text.Substring (args.StartPos, length);
commit bff8d401c444efb066c932f954cfca20447a5ac2 Author: Paul Werner Bou <paul@purecodes.org> Date: Fri Nov 20 09:44:47 2009 +0100 avoid crashing on the FindBar Fixes bgo #147872