GNOME Bugzilla – Bug 370491
[imp_close] crash in CD/DVD Creator: trying to check the prop...
Last modified: 2007-10-19 23:05:38 UTC
What were you doing when the application crashed? trying to check the properties of a password protected OOo presentation. Distribution: Ubuntu 6.10 (edgy) Gnome Release: 2.16.1 2006-10-02 (Ubuntu) BugBuddy Version: 2.16.0 Memory status: size: 82665472 vsize: 0 resident: 82665472 share: 0 rss: 26910720 rss_rlim: 0 CPU usage: start_time: 1162636794 rtime: 0 utime: 561 stime: 0 cutime:528 cstime: 0 timeout: 33 it_real_value: 0 frequency: 0 Backtrace was generated from '/usr/bin/nautilus' (no debugging symbols found) Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread -1226574160 (LWP 4412)] (no debugging symbols found) 0xffffe410 in __kernel_vsyscall ()
+ Trace 82753
Thread 1 (Thread -1226574160 (LWP 4412))
*** Bug 371502 has been marked as a duplicate of this bug. ***
*** Bug 375271 has been marked as a duplicate of this bug. ***
confirming as per duplicates
you can also create a textfile with *.odp, than try to view the properties and nautilus will crash
*** Bug 381553 has been marked as a duplicate of this bug. ***
*** Bug 382738 has been marked as a duplicate of this bug. ***
*** Bug 387936 has been marked as a duplicate of this bug. ***
*** Bug 390078 has been marked as a duplicate of this bug. ***
*** Bug 394858 has been marked as a duplicate of this bug. ***
*** Bug 397432 has been marked as a duplicate of this bug. ***
*** Bug 400199 has been marked as a duplicate of this bug. ***
Improved stack trace (nautilus 2.16.1, evince 0.6.1)
+ Trace 104931
Created attachment 81107 [details] [review] Patch against current SVN trunk The impress handler does a number of things wrong, specifically doing various finalise stuff without checking that various things aren't NULL, and then freeing PangoFontDescriptions in the wrong way. Notably with the later, it *might* have worked until pango started using g_slice_alloc, but only because evince chose the same free'ing mechanism as pango by accident (instead of asking pango to do the freeing for it). Attached patch fixes all of these. I can no longer reproduce with evince trunk + this patch.
Comment on attachment 81107 [details] [review] Patch against current SVN trunk >Index: backend/impress/impress-document.c >=================================================================== >--- backend/impress/impress-document.c (revision 2248) >+++ backend/impress/impress-document.c (working copy) >@@ -399,14 +399,19 @@ > impress_document_finalize (GObject *object) > { > ImpressDocument *impress_document = IMPRESS_DOCUMENT (object); >+ if (impress_document == NULL) >+ return; is it really needed? calling g_object_unref() with a null pointer should fail, so I think it's not possible to receive a null here. > g_mutex_free (impress_document->mutex); this should be checked too I guess. > imp_close (impress_document->imp); same here > imp_delete_context (impress_document->ctx); and here >- g_free (impress_document->pango_ctx); >- g_object_unref (G_OBJECT (impress_document->pixmap)); >- g_object_unref (impress_document->gc); >+ if (impress_document->pango_ctx) >+ pango_font_description_free (impress_document->pango_ctx); >+ if (impress_document->pixmap) >+ g_object_unref (G_OBJECT (impress_document->pixmap)); >+ if (impress_document->gc) >+ g_object_unref (impress_document->gc); these pointers should be set to null after freeing it. Please, add checks for every pointer and set them to null. > G_OBJECT_CLASS (impress_document_parent_class)->finalize (object); > } Thanks a lot for the patch :-)
Created attachment 81123 [details] [review] Improved version of earlier patch I've kept in the initial check, mainly because I think I managed to see that scenario at some point in my testing. It could just have been an artefact of compilation with optimisation switched on, but better safe than sorry! All of the struct members are now checked before being freed/unref'ed, and are all now NULL'ed after the free/unref.
Great ;-) Please, commit it. Thanks.
Love to commit it, but can't. No gnome.org account. Those 18 points you see are mostly the results of doing a whole massive amount of bugsquad stuff over the last month-and-a-half. I've got the permissions to mess around with bugs, but nothing else. Would you mind committing it on my behalf?
Tom, remember about coding style :) Actually the right fix should go earlier, you should set gerror in impress_document_load and check for document not NULL in ev-properties-page. Finalize checks aren's so helpful. I've committed updated patch now, please test.
With current SVN trunk, I can no longer cause the crash. The committed version doesn't however set all of the pointers to NULL after freeing them as Carlos suggested in Comment #14, but it still appears to work so far.
It's not strictly necessary to set pointers to null, since g_free will check whether the pointer is null before freeing it. It's just a common practice.
*** Bug 404300 has been marked as a duplicate of this bug. ***
*** Bug 403374 has been marked as a duplicate of this bug. ***
*** Bug 380830 has been marked as a duplicate of this bug. ***
*** Bug 413004 has been marked as a duplicate of this bug. ***
*** Bug 375635 has been marked as a duplicate of this bug. ***
*** Bug 430279 has been marked as a duplicate of this bug. ***
*** Bug 433502 has been marked as a duplicate of this bug. ***
*** Bug 432699 has been marked as a duplicate of this bug. ***
*** Bug 432712 has been marked as a duplicate of this bug. ***
*** Bug 432956 has been marked as a duplicate of this bug. ***
*** Bug 434190 has been marked as a duplicate of this bug. ***
*** Bug 436841 has been marked as a duplicate of this bug. ***
*** Bug 436862 has been marked as a duplicate of this bug. ***
*** Bug 437198 has been marked as a duplicate of this bug. ***
*** Bug 439225 has been marked as a duplicate of this bug. ***
*** Bug 439396 has been marked as a duplicate of this bug. ***
*** Bug 440753 has been marked as a duplicate of this bug. ***
*** Bug 441292 has been marked as a duplicate of this bug. ***
*** Bug 449650 has been marked as a duplicate of this bug. ***
*** Bug 445063 has been marked as a duplicate of this bug. ***
*** Bug 450584 has been marked as a duplicate of this bug. ***
*** Bug 457447 has been marked as a duplicate of this bug. ***
*** Bug 462646 has been marked as a duplicate of this bug. ***
*** Bug 462647 has been marked as a duplicate of this bug. ***
*** Bug 483022 has been marked as a duplicate of this bug. ***