GNOME Bugzilla – Bug 320206
Crash when canceling slide show
Last modified: 2009-10-05 04:18:14 UTC
Steps to reproduce: 1. Start a slide show in a image collection 2. Cancel it exactly at image switch time 3. Stack trace: Other information:
+ Trace 63911
*** Bug 322452 has been marked as a duplicate of this bug. ***
*** Bug 323808 has been marked as a duplicate of this bug. ***
*** Bug 333992 has been marked as a duplicate of this bug. ***
*** Bug 335772 has been marked as a duplicate of this bug. ***
*** Bug 339254 has been marked as a duplicate of this bug. ***
it's likely bug #340827 is a duplicate of this bug. the stacktrace is slightly different though, possibly because EOG is newer there (2.14.1). that bug also mentions another way of triggering the crash 100% reliably all the time: ------------ in EOG if you focus on the image and the "image collection" pane is not open, mouse wheel will zoom in/out. however if you open the "image collection" pane and have the mouse on it and mousewheel then you'll switch images when mousewheeling. that way you can switch images VERY fast. in a big directory with big images if you just mousewheel a second or so, EOG will be busy for a while. but after little time of this little game, it will crash. i already reproduced this crash 3 times, it's easy to trigger this way. ------------ in my opinion, this bug is SUPER CRITICAL. the number of duplicates to it already show that i guess though... i hope ubuntu 6.06 won't be released with that bug :-/ i won't mark #340827 as duplicate though because the stack is slightly different. but it's 99% a duplicate. i'll let someone more experience mark it as duplicate since i'm not certain.
i looked at the source code. i understand the problem but for now i don't have a full fix. i have a patch that avoids the crash when stopping the slideshow. but then when you restart the slideshow the next image is black, because EOG thinks it preloaded the next image but it didn't. but i have an explanation and a beginning of a patch so i think it's worth posting it. i don't know if i'll be able to finish the fix by lack of time aggravated by little knowledge of the internals of EOG... so anybody feel free to step in if you think you can finish the job. here is the reason of the crash: to preload the next image in the slideshow, prepare_load_image () in libeog/eog-full-screen.c calls: job = eog_job_new_full (ld, job_image_load_do, job_image_load_finished, job_image_load_cancel, NULL, g_free); however when the user cancels the running slideshow (pressing <ESC> for instance), in shell/eog-window.c the eog_full_screen object is destroyed without warning: function slideshow_hide_cb() line: gtk_widget_destroy (widget); what's causing the crash is that the job of preloading the next image of the slideshow is still running. and shortly after the object is destroyed the function job_image_load_finished() is called (it was registered in the eog_job_new_full() call). and this job_image_load_finished() crashes because priv->cache is rotten, it was destroyed by eog_full_screen_destroy() when eog-window called gtk_widget_destroy(). my fix is to call a function in eog-full-screen before calling gtk_widget_destroy(). that function cancels the job of preloading the next image. and i changed job_image_load_finished() not to do anything if the job was cancelled. that prevents the crash but as i said then restarting the slideshow doesn't work so it's not quite right yet. i'll still attach the temporary fix. it would great if EOG developers could look at it and maybe fix it completely.
Created attachment 64937 [details] [review] patch that prevents the crash but when restarting the slideshow it doesn't work
i'm giving up for now. i really hope one of the EOG developers will step in... i still hope this can be fixed for ubuntu dapper 6.06 as it's really a CRITICAL bug now that slideshow is so easily to activate in 2.14. with this bug slideshow is basically sure to crash EOG unless you patiently waits that it finishes going through all images... :-(
*** Bug 340827 has been marked as a duplicate of this bug. ***
Ubuntu bug about that: https://launchpad.net/distros/ubuntu/+source/eog/+bug/43322 Other backtrace of crash when pressing esc on image switch: "... 0xffffe410 in __kernel_vsyscall ()
+ Trace 68072
OK, i made a new patch. that fix works completely, i know of no sideeffects. so i won't work on it anymore. i think that patch works and solves the problem and it's the right way. i now hope the EOG developers will look at it, and accept it or reject it. that patch is a bit different from the previous one. the problem is the same: when the user cancels the slideshow, the eog_full_screen object is destroyed while the job to preload the next image is still running. the callback when the job is finished tries to use the destroyed eog_full_screen object and EOG crashes. the previous patch cancelled the pending job when the user cancels the slideshow. the problem is that then the job is not done and must be done later. i didn't manage to make that work so the next image was counted as preloaded but wasn't. this time i went for the simpler approach: when the user cancels the slideshow, i wait until preloading the next image is complete before i destroy the eog_full_screen object. that way the callback when the job is finished works and the next image is preloaded. note that it's necessary to wait not until the job is done but until the callback when the job is finished is done. one part of the patch that is not very clean is that for some reason i needed a g_usleep() after that wait for it to work. this is definitely connected with that callback being called in the idle loop. probably the EOG developers will find a cleaner way. so, i'm done working on this! i think that patch is good enough, i hope the EOG developers will take it or at least comment on it!
Created attachment 64955 [details] [review] second patch, that waits until the preloading of next image is done before destroying the eog_full_screen object. it fixes the bug.
to make it clear about that g_usleep(): it's not that if it's not present, the app crashes. if it's not present, the finished callback is never called. as i said, definitely connected to the callback being in the idle loop. that g_usleep() can definitely be reduced, but i don't have more time to work on this...
Could any upstream comment on that patch? It would be nice to have that bug fixed for Ubuntu dapper since that's a frequent crasher and freeze is coming for dapper...
This patch doesn't fix the problem. I did some simple tests here and EOG still crashes. Actually, this bug is related to job management. A simple and correct fix would be to make the job cancelling actually cancel the job. So, when finishing the slideshow, the image loading job should be cancelled and then no crash would happen.
>This patch doesn't fix the problem. I did some simple tests here and EOG still crashes. so, you ran a slideshow and cancelled it and it crashed, with my patch? i'll retest my patch. it's possible you triggered another crash. i think there are many crash bugs in EOG (my impression). > Actually, this bug is related to job management. A simple and correct fix would be to make the job cancelling actually cancel the job. So, when finishing the slideshow, the image loading job should be cancelled and then no crash would happen. this is what i did in my first patch: http://bugzilla.gnome.org/attachment.cgi?id=64937 the problem is that in that patch i DO cancel the job, but then somehow EOG thinks the next image is preloaded (when it's not since I cancelled the job) and when you restart the slideshow next image is black (and likely EOG crashes then). that first patch is pretty close to be correct, just somewhere must be changed so that EOG knows that when the job is cancelled, the next image is *NOT* preloaded and you must reask to preload it if the slideshow is restarted. see my comments at: http://bugzilla.gnome.org/show_bug.cgi?id=320206#c8
otherwise in my opinion cancelling the job is "cleaner" but my second patch definitely should also fix the crash. i can't begin to understand how could the crash still happen with my second patch.
> I did some simple tests here and EOG still > crashes. one last thing: this patch fixes only the crash when cancelling a running slideshow. which is the biggest problem. if you tested switching images quickly in image collection, which was marked as a duplicate to this bug, that patch is not supposed to fix it and in my opinion that other thing was wrongly marked as a duplicate to this bug. sorry for several comments in a row, now i'll stop.
Created attachment 65817 [details] [review] cancel preload job and deatach job info from image. I reworked attachment 64937 [details] [review] and it fixes the bug. The problem with that patch, was that the job info wasn't deatached from the image that was being cached. This way, when going to fullscreen mode again, the current image has outdated job info. Also, I prefeer not to add a prepare_destroy () method. We can cancel the job when the user asks to leave the fullscreen mode, before hiding the widget. It worths noting that this patch doesn't fix bug #340827, because that bug is not a duplicated of this one. That bug has nothing to do with the EogFullScreen widget at all, even when the backtraces are similar.
Claudio, your patch is conceptually correct (actually, I had done the same thing here) but doesn't fix bug - EOG still crashes. The problem is that there are specific cases that the finished job callback is called with FINISHED status, not CANCELED, and the crash still takes place.
*** Bug 341128 has been marked as a duplicate of this bug. ***
well, i really, really tried to make EOG crash on cancelling slide show with <ESC> with the patch from Claudio Saavedra, and I didn't manage to do it. Without the patch, well, you don't need to try very hard. I believe that this patch doesn't fully fix the problem since Lucas Rocha says so, however it does fix 99% of the cases of this crash and it's a step in the right direction, not a hack, so I personnally hope the ubuntu maintainers consider it for dapper. It's good enough to change EOG slideshow from "useless since it crashes all the time" to "crashes in some rare circumstances" IMHO. BTW i didn't manage to mark my patch "obsolete". feel free to do it if it's possible.
Well, I agree. Claudio's patch improves stability and is conceptually correct. An ugly hack will probably be needed to fix this bug as a whole because this is caused by a very specific race condition that is probably not solvable with the current job management design. Patch commited on HEAD and gnome-2-14 branches. 2006-04-21 Lucas Rocha <lucasr@gnome.org> * libeog/eog-full-screen.c (eog_full_screen_key_press, job_image_load_finished): partial fix for crash when cancelling slideshow/fullscreen (#320206). Patch from Claudio Saavedra <csaavedra@alumnos.utalca.cl>.
I used the patch for dapper but it's still pretty easy to trigger a crasher by pressing esc when switching between image using the fullscreen mode by example
*** Bug 346716 has been marked as a duplicate of this bug. ***
*** Bug 349590 has been marked as a duplicate of this bug. ***
This is Debian bug http://bugs.debian.org/382164 with 2.14.3, here's an easy way to trigger the crash: keep the F11 key pressed to trigger full screen / normal mode.
+ Trace 70133
I also got still a crash when exiting fullscreen mode with EOG 2.14.3 from ubuntu dapper. I'm not sure if it should go in this bug or a new one... probably this bug? Backtrace was generated from '/usr/bin/eog' (no debugging symbols found) Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread -1224579392 (LWP 5461)] [New Thread -1259869264 (LWP 5463)] [New Thread -1226183760 (LWP 5462)] (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) 0xffffe410 in __kernel_vsyscall ()
+ Trace 70176
Thread 1 (Thread -1224579392 (LWP 5461))
*** Bug 330338 has been marked as a duplicate of this bug. ***
*** Bug 351404 has been marked as a duplicate of this bug. ***
*** Bug 354154 has been marked as a duplicate of this bug. ***
*** Bug 354327 has been marked as a duplicate of this bug. ***
*** Bug 366976 has been marked as a duplicate of this bug. ***
*** Bug 367023 has been marked as a duplicate of this bug. ***
*** Bug 367944 has been marked as a duplicate of this bug. ***
quoting lucas: "probably not solvable with the current job management design". quoting claudio from bug 354327 comment #18: "the bug is very hard to solve, because it is caused by the jobs code in EOG that is pretty broken. This is already fixed in the 'eog-ng' branch, whose job queue code has been rewritten and is far more stable and consistent than current. This branch is work in progress and it needs more work in order to be merged to HEAD. We plan to do this anytime soon, but there's no concrete plans to do it before 2.18. It will hardly depend on the help we get with it." this issue bites many users, how hard would it be to fix this? is this doable for gnome 2.18? claudio, what kind of help is needed? what are the problems? 33 duplicates in the last 30 days, 45 duplicates total. setting gnome 2.18.x target.
(In reply to comment #38) > 33 duplicates in the last 30 days, 45 duplicates total. > setting gnome 2.18.x target. i don't want to sound aggressive or anything; I like EOG, it has made great progress recently, it's a GREAT program. If I didn't like it I wouldn't use it. I would just say: as far as I'm concerned, there could be more duplicates because personally i've stopped reporting crash bugs I'm getting on EOG: I would report too many bugs... :-( So I agree about the importance of fixing that in a definitive way.
Emmanuel, (In reply to comment #39) > i don't want to sound aggressive or anything; I like EOG, it has made great > progress recently, it's a GREAT program. If I didn't like it I wouldn't use it. > > I would just say: as far as I'm concerned, there could be more duplicates > because personally i've stopped reporting crash bugs I'm getting on EOG: I > would report too many bugs... :-( > > So I agree about the importance of fixing that in a definitive way. I agree with you that is important to fix this bug. Right now the best approach to get it fixed, is to finish the eog-ng branch and merge it with HEAD, so we can have all this PITA bugs finally fixed in a (hopefully really soon) stable release. If you want to help us find issues and/or have suggestions about this experimental branch, or want to help us to finish it, please don't hesitate to test it. You can grab it from CVS with: $ cvs -z3 co -r eog-ng eog Thanks for your interest in EOG!
*** Bug 373728 has been marked as a duplicate of this bug. ***
*** Bug 374556 has been marked as a duplicate of this bug. ***
*** Bug 376109 has been marked as a duplicate of this bug. ***
*** Bug 376373 has been marked as a duplicate of this bug. ***
*** Bug 376588 has been marked as a duplicate of this bug. ***
*** Bug 376723 has been marked as a duplicate of this bug. ***
*** Bug 376766 has been marked as a duplicate of this bug. ***
*** Bug 376970 has been marked as a duplicate of this bug. ***
*** Bug 377120 has been marked as a duplicate of this bug. ***
*** Bug 377252 has been marked as a duplicate of this bug. ***
*** Bug 375223 has been marked as a duplicate of this bug. ***
*** Bug 377348 has been marked as a duplicate of this bug. ***
*** Bug 377583 has been marked as a duplicate of this bug. ***
*** Bug 377890 has been marked as a duplicate of this bug. ***
*** Bug 377879 has been marked as a duplicate of this bug. ***
*** Bug 378242 has been marked as a duplicate of this bug. ***
*** Bug 378561 has been marked as a duplicate of this bug. ***
*** Bug 378608 has been marked as a duplicate of this bug. ***
*** Bug 378784 has been marked as a duplicate of this bug. ***
*** Bug 379537 has been marked as a duplicate of this bug. ***
*** Bug 379563 has been marked as a duplicate of this bug. ***
*** Bug 381139 has been marked as a duplicate of this bug. ***
*** Bug 381179 has been marked as a duplicate of this bug. ***
*** Bug 382894 has been marked as a duplicate of this bug. ***
*** Bug 383454 has been marked as a duplicate of this bug. ***
as we now have bug 379919 (which depends on this one) set to gnome target 2.18, i'm going to remove the target milestone here. sorry for the noise; and claudio: thanks for the aweseom work, i'm happy to see that this will be addressed.
*** Bug 385915 has been marked as a duplicate of this bug. ***
the crash I just got with EOG 2.17.4 eog_image_list_* frames have a non-NIL pointer.
+ Trace 97839
*** Bug 391044 has been marked as a duplicate of this bug. ***
*** Bug 395163 has been marked as a duplicate of this bug. ***
*** Bug 396534 has been marked as a duplicate of this bug. ***
*** Bug 397978 has been marked as a duplicate of this bug. ***
*** Bug 402111 has been marked as a duplicate of this bug. ***
*** Bug 402149 has been marked as a duplicate of this bug. ***
*** Bug 402268 has been marked as a duplicate of this bug. ***
*** Bug 402454 has been marked as a duplicate of this bug. ***
*** Bug 402841 has been marked as a duplicate of this bug. ***
*** Bug 403316 has been marked as a duplicate of this bug. ***
*** Bug 403790 has been marked as a duplicate of this bug. ***
*** Bug 410522 has been marked as a duplicate of this bug. ***
*** Bug 413251 has been marked as a duplicate of this bug. ***
*** Bug 416523 has been marked as a duplicate of this bug. ***
*** Bug 418382 has been marked as a duplicate of this bug. ***
*** Bug 419458 has been marked as a duplicate of this bug. ***
eog-ng branch, which has a full rewrite of eog's core, has been merged into trunk as part of 2.19/2.20 development cycle. Therefore this bug is fixed now. Of course, the problem will remain in 2.18.x as there a deep design problem which blocks us from fixing it. Updating version.
*** Bug 421128 has been marked as a duplicate of this bug. ***
so lucas, can we close this bug report here as "fixed in unstable 2.19.x, fix will be available in the next major stable release (2.20)"?
*** Bug 429940 has been marked as a duplicate of this bug. ***
*** Bug 430492 has been marked as a duplicate of this bug. ***
*** Bug 433171 has been marked as a duplicate of this bug. ***
*** Bug 433315 has been marked as a duplicate of this bug. ***
*** Bug 433393 has been marked as a duplicate of this bug. ***
*** Bug 433595 has been marked as a duplicate of this bug. ***
*** Bug 433813 has been marked as a duplicate of this bug. ***
*** Bug 434599 has been marked as a duplicate of this bug. ***
I agree with Andre. Therefore, I'm closing this. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
*** Bug 437900 has been marked as a duplicate of this bug. ***
*** Bug 437971 has been marked as a duplicate of this bug. ***
*** Bug 438595 has been marked as a duplicate of this bug. ***
*** Bug 438698 has been marked as a duplicate of this bug. ***
*** Bug 441565 has been marked as a duplicate of this bug. ***
*** Bug 441456 has been marked as a duplicate of this bug. ***
*** Bug 441787 has been marked as a duplicate of this bug. ***
*** Bug 442180 has been marked as a duplicate of this bug. ***
*** Bug 444117 has been marked as a duplicate of this bug. ***
*** Bug 446782 has been marked as a duplicate of this bug. ***
*** Bug 458473 has been marked as a duplicate of this bug. ***
*** Bug 458775 has been marked as a duplicate of this bug. ***
*** Bug 459193 has been marked as a duplicate of this bug. ***
*** Bug 460527 has been marked as a duplicate of this bug. ***
*** Bug 460787 has been marked as a duplicate of this bug. ***
*** Bug 461442 has been marked as a duplicate of this bug. ***
*** Bug 461461 has been marked as a duplicate of this bug. ***
*** Bug 461479 has been marked as a duplicate of this bug. ***
*** Bug 461873 has been marked as a duplicate of this bug. ***
*** Bug 462566 has been marked as a duplicate of this bug. ***
*** Bug 463850 has been marked as a duplicate of this bug. ***
*** Bug 463933 has been marked as a duplicate of this bug. ***
*** Bug 464003 has been marked as a duplicate of this bug. ***
*** Bug 464431 has been marked as a duplicate of this bug. ***
*** Bug 464618 has been marked as a duplicate of this bug. ***
*** Bug 464850 has been marked as a duplicate of this bug. ***
*** Bug 465018 has been marked as a duplicate of this bug. ***
*** Bug 467619 has been marked as a duplicate of this bug. ***
*** Bug 468351 has been marked as a duplicate of this bug. ***
*** Bug 470650 has been marked as a duplicate of this bug. ***
*** Bug 471573 has been marked as a duplicate of this bug. ***
*** Bug 467194 has been marked as a duplicate of this bug. ***
*** Bug 475420 has been marked as a duplicate of this bug. ***
*** Bug 479823 has been marked as a duplicate of this bug. ***
*** Bug 485711 has been marked as a duplicate of this bug. ***
*** Bug 489665 has been marked as a duplicate of this bug. ***
*** Bug 492175 has been marked as a duplicate of this bug. ***
*** Bug 493013 has been marked as a duplicate of this bug. ***
*** Bug 494423 has been marked as a duplicate of this bug. ***
*** Bug 498601 has been marked as a duplicate of this bug. ***
*** Bug 498894 has been marked as a duplicate of this bug. ***
*** Bug 499153 has been marked as a duplicate of this bug. ***
*** Bug 501516 has been marked as a duplicate of this bug. ***
*** Bug 500874 has been marked as a duplicate of this bug. ***
*** Bug 516928 has been marked as a duplicate of this bug. ***
*** Bug 519310 has been marked as a duplicate of this bug. ***
*** Bug 520126 has been marked as a duplicate of this bug. ***