After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 578871 - moving date slider with no pictures in range causes array index out of bounds
moving date slider with no pictures in range causes array index out of bounds
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: Browsing
GIT
Other All
: Normal major
: 0.6.0
Assigned To: F-spot maintainers
F-spot maintainers
: 581669 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-04-13 19:54 UTC by Allen Hubbe
Modified: 2009-11-02 11:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
F-Spot with 'crasher' control marked in red (34.32 KB, image/png)
2009-11-02 06:25 UTC, alexey_nedilko
Details

Description Allen Hubbe 2009-04-13 19:54:09 UTC
Steps to reproduce:

1. Do one of the following:
1.a) Drag the left date range slider to the right of all pictures.
1.b) Drag the right date range slider to the left of all pictures.
1.c) Drag the left and right date range sliders to a date range where there are no picures, but there are pictures outside the range in both directions.

2. Drag the view slider to anywhere along the film strip, including back to its current location.  Releasing the view slider at its new location causes f-spot to crash.


Stack trace:
(f-spot:6948): 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.
Exception in Gtk# callback delegate
  Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
System.IndexOutOfRangeException: Array index is out of range.
  at FSpot.PhotoQuery+PhotoCache.Get (Int32 index) [0x00000] 
  at FSpot.PhotoQuery.get_Item (Int32 index) [0x00000] 
  at FSpot.PhotoQuery.LookupItem (DateTime date, Boolean asc) [0x00000] 
  at FSpot.PhotoQuery.LookupItem (DateTime date) [0x00000] 
  at FSpot.TimeAdaptor.SetGlass (Int32 min) [0x00000] 
  at FSpot.GroupSelector+Glass.PositionChanged () [0x00000] 
  at FSpot.GroupSelector+Manipulator.SetPosition (Int32 position, Boolean update) [0x00000] 
  at FSpot.GroupSelector+Manipulator.SetPosition (Int32 position) [0x00000] 
  at FSpot.GroupSelector+Glass.EndDrag (Double x, Double y) [0x00000] 
  at FSpot.GroupSelector.OnButtonReleaseEvent (Gdk.EventButton args) [0x00000] 
  at Gtk.Widget.buttonreleaseevent_cb (IntPtr widget, IntPtr evnt) [0x00000] 
   at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal)
   at Gtk.Widget.buttonreleaseevent_cb(IntPtr widget, IntPtr evnt)
   at Gtk.Widget.buttonreleaseevent_cb(IntPtr , IntPtr )
   at Gtk.Application.gtk_main()
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at Gnome.Program.Run()
   at FSpot.Driver.Main(System.String[] args)


Other information:
My pictures are sorted by month.  I did not try this with pictures sorted by folder.

The exact version version of f-spot is 0.5.0.3, distributed with Ubuntu 8.10 as 0.5.0.3-0ubuntu4.  My cpu architecture is amd64.
Comment 1 Maxxer 2009-05-07 11:14:05 UTC
*** Bug 581669 has been marked as a duplicate of this bug. ***
Comment 2 Pedro Villavicencio 2009-05-15 13:44:13 UTC
similar report on https://bugs.edge.launchpad.net/ubuntu/+source/f-spot/+bug/373202
Comment 3 calca 2009-07-04 09:14:36 UTC
this fix this bug:

http://gitorious.org/~calca/f-spot/calca-clone-rating-query-widget/commit
/9d7803621858f3327ca3f4569b068a27259619b9
Comment 4 Maxxer 2009-08-03 17:25:03 UTC
Targeting for 0.6 as a more common use case crash exists which looks almost the same:
1- edit mode on a pic, with filmstrip enabled
2- search for a tag NOT attached to the pic currently viewing


[Debug 19:21:05.566] Reloading the query took 0,522419s
Exception in Gtk# callback delegate
  Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
System.IndexOutOfRangeException: Array index is out of range.
  at FSpot.PhotoQuery+PhotoCache.Get (Int32 index) [0x00042] in /home/maxxer/work/fspot/git/src/PhotoQuery.cs:56 
  at FSpot.PhotoQuery.get_Item (Int32 index) [0x00000] in /home/maxxer/work/fspot/git/src/PhotoQuery.cs:112 
  at FSpot.Widgets.Filmstrip.GetPixbuf (Int32 i, Boolean highlighted) [0x00000] in /home/maxxer/work/fspot/git/src/Widgets/Filmstrip.cs:615 
  at FSpot.Widgets.Filmstrip.GetPixbuf (Int32 i) [0x00000] in /home/maxxer/work/fspot/git/src/Widgets/Filmstrip.cs:609 
  at FSpot.Widgets.Filmstrip.OnExposeEvent (Gdk.EventExpose evnt) [0x002a6] in /home/maxxer/work/fspot/git/src/Widgets/Filmstrip.cs:424 
  at Gtk.Widget.exposeevent_cb (IntPtr widget, IntPtr evnt) [0x00000] 
   at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal)
   at Gtk.Widget.exposeevent_cb(IntPtr widget, IntPtr evnt)
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at FSpot.Driver.Main(System.String[] args) in /home/maxxer/work/fspot/git/src/main.cs:line 345
Comment 5 Mike Gemünde 2009-08-04 14:50:29 UTC
The original bugreport seems already fixed by 9968374c80ae5d974a95829420a9136c771a2fcb

Here is a fix for the from Maxxer proposed one:
http://gitorious.org/~tigger/f-spot/tiggers-clone/commits/filmstrip_crash
Comment 6 Maxxer 2009-08-05 06:25:37 UTC
The fix I proposed, which is almost the same approach as calca did in his own branch, is not the best solution.

The real way would be to prevent F-Spot from accessing wrong index instead of catching the exception... That's why it hasn't been pushed yet.
Comment 7 Maxxer 2009-08-05 07:09:28 UTC
The original issue should already be fixed by:

commit 9968374c80ae5d974a95829420a9136c771a2fcb
Author: Mike Gemünde <mike@gemuende.de>
Date:   Mon Jul 13 09:19:03 2009 +0200

    prevent crash on Timeline when PhotoQuery is empty


if you Allen can give it a try...


Ruben, if you like the patch at comment #5 (tested, works great!) we can push and close this bug.
Comment 8 Allen Hubbe 2009-08-05 20:06:29 UTC
(In reply to comment #7)

This did not fix it for me.  Check my steps in case I did something wrong:

$ git clone git://git.gnome.org/f-spot
$ cd f-spot
$ git revert 9968374c80ae5d974a95829420a9136c771a2fcb
$ ./autogen.sh
$ ./configure
$ make
$ make install
$ which f-spot
/usr/local/bin/f-spot

I ran 'which' because I also have f-spot installed that is distributed with ubuntu, in /usr/bin/f-spot.  The ubuntu about dialog reports version 0.5.0.3, and the one I just installed reports 0.6.0.0.  Is there any chance any dynamic linking would get the wrong version of some other thing at runtime?

And then running it, I followed the procedure submitted when I opened the bug, step 1a: move the left date range slider to the right of all the pictures, then drag the view slider anywhere.

$ f-spot
[Info  15:47:13.113] Initializing DBus
[Info  15:47:13.209] Initializing Mono.Addins
[Info  15:47:13.369] Starting new FSpot server (f-spot 0.6.0.0)
[Info  15:47:14.548] Starting BeagleService
[Info  15:47:14.570] Hack for gnome-settings-daemon engaged

(f-spot:29013): 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.

[Now f-spot is loaded, I move the sliders]

Exception in Gtk# callback delegate
  Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
System.IndexOutOfRangeException: Array index is out of range.
  at FSpot.PhotoQuery+PhotoCache.Get (Int32 index) [0x00000] 
  at FSpot.PhotoQuery.get_Item (Int32 index) [0x00000] 
  at FSpot.PhotoQuery.LookupItem (DateTime date, Boolean asc) [0x00000] 
  at FSpot.PhotoQuery.LookupItem (DateTime date) [0x00000] 
  at FSpot.TimeAdaptor.SetGlass (Int32 min) [0x00000] 
  at FSpot.GroupSelector+Glass.PositionChanged () [0x00000] 
  at FSpot.GroupSelector+Manipulator.SetPosition (Int32 position, Boolean update) [0x00000] 
  at FSpot.GroupSelector+Manipulator.SetPosition (Int32 position) [0x00000] 
  at FSpot.GroupSelector+Glass.EndDrag (Double x, Double y) [0x00000] 
  at FSpot.GroupSelector.OnButtonReleaseEvent (Gdk.EventButton args) [0x00000] 
  at Gtk.Widget.buttonreleaseevent_cb (IntPtr widget, IntPtr evnt) [0x00000] 
   at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal)
   at Gtk.Widget.buttonreleaseevent_cb(IntPtr widget, IntPtr evnt)
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at FSpot.Driver.Main(System.String[] args)


As an aside, I have a new problem.  The old version of f-spot doesn't load my photos any more.  The new version must have done something to the configuration.  I should have foreseen this and copied the configuration somewhere.  Is there any way I can get the old version to recognize it again without starting from scratch and re-importing everything?  As this is not pertinent to the bug, please respond to me directly using allenbhATgmailNOrobots.
Comment 9 Mike Gemünde 2009-08-05 20:21:43 UTC
Hi Allen,


first, thank you for testing. But you did something wrong, by doing:

git revert 9968374c80ae5d974a95829420a9136c771a2fcb

you revert the given commit. That means, that it is no longer there and therfore it cannot fix the original issue. For testing do please just use HEAD and everything should be fine.


To your second problem, somewhere in the last changes the database schema was changed, so the old version cannot read the database anymore. I think there is no backup done automatically, but if you used 


Mike
Comment 10 Allen Hubbe 2009-08-05 20:22:32 UTC
Ok, I found my problem with git revert; apparently that did exactly the opposite of what I expected!

So, I did the same procedure again, start to finish, omitting the git revert step.  This time it works.

Changing to Resolved: Fixed.
Comment 11 Maxxer 2009-08-06 07:07:37 UTC
pushed FS patch as well, which fixes issue at comment #4


commit 9ab7febd4e470883a67ada602c78387b0fd428ee
Author: Mike Gemünde <mike@gemuende.de>
Date:   Tue Aug 4 16:33:42 2009 +0200

    Calling QueueDraw when position has an invalid value leads to a crash,
    so we need to ensure a valid. (Position starts an Animation, which
    does not directly set a valid value to position)
Comment 12 alexey_nedilko 2009-10-09 00:50:13 UTC
*** Bug 566977 has been marked as a duplicate of this bug. ***
Comment 13 alexey_nedilko 2009-10-31 22:41:16 UTC
Sorry, folks, but the bug is not resolved and fixed. I still confirm it in Ubuntu Karmic, F-Spot version 0.6.1.3.

Stack trace since the moment of start is:

[Info  00:39:40.344] BaseDirectory is now /tmp
[Info  00:39:40.370] Initializing DBus
[Info  00:39:40.472] Initializing Mono.Addins
[Info  00:39:41.442] Starting new FSpot server (f-spot 0.6.1.3)
[Info  00:39:44.781] Starting BeagleService
[Info  00:39:44.798] Hack for gnome-settings-daemon engaged
Exception in Gtk# callback delegate
  Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
System.ArgumentOutOfRangeException: Argument is out of range.
  at System.DateTime.DaysInMonth (Int32 year, Int32 month) [0x00000] 
  at FSpot.TimeAdaptor.DateFromIndexDescending (Int32 item) [0x00000] 
  at FSpot.TimeAdaptor.DateFromIndex (Int32 item) [0x00000] 
  at FSpot.TimeAdaptor.GlassLabel (Int32 item) [0x00000] 
  at FSpot.GroupSelector+Glass.StartDrag (Double x, Double y, UInt32 time) [0x00000] 
  at FSpot.GroupSelector.OnButtonPressEvent (Gdk.EventButton args) [0x00000] 
  at Gtk.Widget.buttonpressevent_cb (IntPtr widget, IntPtr evnt) [0x00000] 
   at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal)
   at Gtk.Widget.buttonpressevent_cb(IntPtr widget, IntPtr evnt)
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at FSpot.Driver.Main(System.String[] args)
Comment 14 Mike Gemünde 2009-11-01 14:26:59 UTC
(In reply to comment #13)
> Sorry, folks, but the bug is not resolved and fixed. I still confirm it in
> Ubuntu Karmic, F-Spot version 0.6.1.3.

Not everything throwing a System.IndexOutOfRangeException is the same bug. Since your trace differs from the one posted in the original report, you may provide a description to reproduce your bug. (I can't reproduce it at the moment).


Mike
Comment 15 alexey_nedilko 2009-11-02 06:25:00 UTC
Created attachment 146720 [details]
F-Spot with 'crasher' control marked in red
Comment 16 alexey_nedilko 2009-11-02 06:27:01 UTC
Steps to reproduce are:
1) Start F-Spot with no photos in the database (f-spot -b /tmp)
2) Click either top or bottom square at the start of time slider (screenshot is attached).
3) F-Spot crashes with the stack trace from #13.

Alex
Comment 17 Mike Gemünde 2009-11-02 07:59:13 UTC
I just saw, that you marked this bug as duplicated of your original one which already contains the description to reproduce. However, both seems to be different. Thx, for the description, I'll look at it.

Mike
Comment 18 alexey_nedilko 2009-11-02 11:04:09 UTC
Mike, do you want me to reopen my original bugreport, or you are OK with tracking this issue within this bugreport?

Alex
Comment 19 Mike Gemünde 2009-11-02 11:17:15 UTC
If you want to reopen one, then #566977. But, after removing the duplication, if this is possible. If not, just leave it as it is.