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 701900 - Race condition in ev-sidebar-thumbnails
Race condition in ev-sidebar-thumbnails
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
3.9.x
Other All
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-09 14:37 UTC by aakash
Modified: 2013-06-14 15:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix race condition in evince-sidebar-thumbnails.c (1.28 KB, patch)
2013-06-09 14:43 UTC, aakash
committed Details | Review

Description aakash 2013-06-09 14:37:11 UTC
There is a race condition at around line nos 422-435 in ev-sidebar-thumbnails.c. An EvJob is being initialized and pushed to the scheduler before connecting the finished callback for the job.


>job = ev_job_thumbnail_new (priv->document,
		  	    page, priv->rotation,
			    get_scale_for_page (sidebar_thumbnails, page));
>ev_job_thumbnail_set_has_frame (EV_JOB_THUMBNAIL (job), FALSE);
>ev_job_scheduler_push_job (EV_JOB (job), EV_JOB_PRIORITY_HIGH);
>			
>g_object_set_data_full (G_OBJECT (job), "tree_iter",
>			 gtk_tree_iter_copy (&iter),
>			 (GDestroyNotify) gtk_tree_iter_free);
>g_signal_connect (job, "finished",
>		   G_CALLBACK (thumbnail_job_completed_callback),
>		   sidebar_thumbnails);
Comment 1 aakash 2013-06-09 14:43:05 UTC
Created attachment 246354 [details] [review]
Fix race condition in evince-sidebar-thumbnails.c

Please review the proposed changes.

Thanks !
Comment 2 Carlos Garcia Campos 2013-06-14 15:49:30 UTC
Comment on attachment 246354 [details] [review]
Fix race condition in evince-sidebar-thumbnails.c

Pushed to git master, thanks!