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 630646 - F-Spot crashes on picture import/view
F-Spot crashes on picture import/view
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: Browsing
0.8.0
Other Linux
: Normal critical
: 0.8.1
Assigned To: Tim Howard
F-spot maintainers
: 631831 633020 634943 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-09-26 18:19 UTC by Stefan Ebner
Modified: 2010-11-23 20:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The picture which causes the crash (790.31 KB, image/jpeg)
2010-09-26 18:20 UTC, Stefan Ebner
  Details
Make sure the year and month are in bounds for DateTime.DaysInMonth (1.13 KB, patch)
2010-11-23 06:28 UTC, Tim Howard
rejected Details | Review
Make sure the year and month are in bounds for DateTime.DaysInMonth (1.16 KB, patch)
2010-11-23 06:39 UTC, Tim Howard
committed Details | Review

Description Stefan Ebner 2010-09-26 18:19:54 UTC
Hi,

I wanted to add a picture to f-spot but on import it crashes.
Viewing the picture with f-spot also causes a crashe.
Seems to be a glib issue?! Picture attached.

Log:

[Info  20:15:28.920] Initializing Mono.Addins
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] in <filename unknown>:0 
  at FSpot.TimeAdaptor.DateFromIndexDescending (Int32 item) [0x00000] in <filename unknown>:0 
  at FSpot.TimeAdaptor.DateFromIndex (Int32 item) [0x00000] in <filename unknown>:0 
  at FSpot.TimeAdaptor.TickLabel (Int32 item) [0x00000] in <filename unknown>:0 
  at FSpot.GroupSelector.HandleAdaptorChanged (FSpot.GroupAdaptor adaptor) [0x00000] in <filename unknown>:0 
  at (wrapper delegate-invoke) FSpot.GroupAdaptor/ChangedHandler:invoke_void__this___GroupAdaptor (FSpot.GroupAdaptor)
  at FSpot.TimeAdaptor+<DoReload>c__AnonStorey19.<>m__6B () [0x00000] in <filename unknown>:0 
  at FSpot.Driver+<RunIdle>c__AnonStorey11.<>m__50 () [0x00000] in <filename unknown>:0 
  at GLib.Idle+IdleProxy.Handler () [0x00000] in <filename unknown>:0 
   at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal)
   at GLib.Idle+IdleProxy.Handler()
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at FSpot.Driver.Startup()
   at Hyena.Gui.CleanRoomStartup.Startup(Hyena.Gui.StartupInvocationHandler startup)
   at FSpot.Driver.Main(System.String[] args)

Eye of Gnome opens and displays the picture but the terminal output suggests a glib issue as well: 

(eog:4775): GLib-GIO-CRITICAL **: g_app_info_equal: assertion `G_IS_APP_INFO (appinfo1)' failed
Comment 1 Stefan Ebner 2010-09-26 18:20:56 UTC
Created attachment 171137 [details]
The picture which causes the crash
Comment 2 Mike Gemünde 2010-09-29 12:06:15 UTC
works fine here.
Comment 3 Tim Howard 2010-11-14 06:25:07 UTC
Also works fine here. Both importing and just opening with "F-Spot Viewer" seem OK. Are you sure it was this picture. The stack trace makes me think invalid date/time but I have no issue with it.
Comment 4 Tim Howard 2010-11-23 02:33:25 UTC
I definitely think that picture is a red-herring. I am marking several others as duplicates of this bug.
Comment 5 Tim Howard 2010-11-23 02:34:24 UTC
*** Bug 634943 has been marked as a duplicate of this bug. ***
Comment 6 Tim Howard 2010-11-23 02:35:38 UTC
*** Bug 631831 has been marked as a duplicate of this bug. ***
Comment 7 Tim Howard 2010-11-23 02:36:04 UTC
*** Bug 633020 has been marked as a duplicate of this bug. ***
Comment 8 Tim Howard 2010-11-23 02:37:46 UTC
One thing I noticed in that last duplicate was one of the file URIs was a bit crazy:

file:///home/mark/Pictures/Photos/2010/10/24/(35)-1190180962-fH=274-gH=160-mode=20-AG=0

I don't think it's pertinent but you never know. I also need to check and see if this happens on stable-0.8 prior to changes we've made since because I've seen it before but can't get it to happen again.
Comment 9 Tim Howard 2010-11-23 06:28:21 UTC
Created attachment 175089 [details] [review]
Make sure the year and month are in bounds for DateTime.DaysInMonth

I think this is the best option for this at the moment.
Comment 10 Tim Howard 2010-11-23 06:31:09 UTC
Review of attachment 175089 [details] [review]:

Uggh, this was awful.
Comment 11 Tim Howard 2010-11-23 06:39:14 UTC
Created attachment 175090 [details] [review]
Make sure the year and month are in bounds for DateTime.DaysInMonth

This should work. The other one was completely wrong.
Comment 12 Ruben Vermeersch 2010-11-23 08:28:40 UTC
Review of attachment 175090 [details] [review]:

I usually dislike "safety-hacks" like these and think we should avoid getting crap data in there from the start, but the fact is that there are some very weird timestamps floating around which we can't avoid. Patch can thus go in.
Comment 13 Tim Howard 2010-11-23 15:36:57 UTC
Review of attachment 175090 [details] [review]:

I originally thought about catching the exception, logging more specific information and then exiting but really our users don't want that. This seemed to be harmless given the circumstances.
Comment 14 Stefan Ebner 2010-11-23 19:15:40 UTC
Heya!

Yeah, I'm sorry, the picture works without problems (did fail some months ago, dunno why).
Anyways, I just tested the patch of Tim and it works f-spot works without problems now.
Thanks you very much!
Comment 15 Valent Turkovic 2010-11-23 19:40:14 UTC
Which F-Spot version will have this patch applied so I can try it out?
Comment 16 Tim Howard 2010-11-23 19:47:55 UTC
Your best bet is to pull the stable-0.8 branch. It's applied in master as well so if you like you can pull it too. The patch is applied in both of those places already.
Comment 17 Valent Turkovic 2010-11-23 20:34:11 UTC
I use F-spot via Fedora package manager, so if you can please explain how to "pull stable 0.8" branch because I have used f-spot just by installing it via yum.
Comment 18 Tim Howard 2010-11-23 20:37:32 UTC
Can we move this discussion to the mailing list? It's not relevant to the bug. Please send your question to f-spot-list@gnome.org and we will continue the discussion there. Thanks.
Comment 19 Valent Turkovic 2010-11-23 20:51:07 UTC
You are right, but my inbox is overflowing with mailing list messages so I really don't need another mailing list subscription.

I'll be patient and ping Fedora package manager to update F-Spot to 8.0.1 version as soon as it becomes available.

Thank you for your reply.