GNOME Bugzilla – Bug 73301
nautilus-gtkhtml-view crashes if closed while loading a page
Last modified: 2004-12-22 21:47:04 UTC
nautilus-gtkhtml-view crashes if the nautilus window is closed while the view is download a webpage. this is always reproducable for me, as long as i close the window while the webpage is loading. Stack trace: [New Thread 1024 (LWP 10786)] [New Thread 2049 (LWP 10787)] [New Thread 1026 (LWP 10788)] [New Thread 2051 (LWP 10789)] [New Thread 3076 (LWP 10790)] [New Thread 4101 (LWP 10791)] [New Thread 5126 (LWP 10792)] [New Thread 6151 (LWP 10793)] [New Thread 7176 (LWP 10794)] [New Thread 8201 (LWP 10795)] [New Thread 9226 (LWP 10796)] [New Thread 10251 (LWP 10797)] 0x410d2c89 in __wait4 () from /lib/libc.so.6
+ Trace 18599
Thread 1 (Thread 1024 (LWP 10786))
I get the same behavior, but with a different trace: ---- [New Thread 1024 (LWP 6979)] [New Thread 2049 (LWP 6982)] [New Thread 1026 (LWP 6983)] [New Thread 2051 (LWP 6984)] [New Thread 3076 (LWP 6985)] [New Thread 4101 (LWP 6986)] [New Thread 5126 (LWP 6987)] [New Thread 6151 (LWP 6988)] [New Thread 7176 (LWP 6989)] [New Thread 8201 (LWP 6990)] [New Thread 9226 (LWP 6991)] [New Thread 10251 (LWP 6992)] 0x40893e29 in __wait4 () from /lib/libc.so.6
+ Trace 19107
Thread 1 (Thread 1024 (LWP 6979))
may be a gtkhtml2 bug, or a bug related to bad use of gnome-vfs hmm, it uses 13 threads, but it may be a gnome-vfs behavior we cannot fix in nautilus-gtkhtml.
Gediminas: any idea on who should be cc'd to see if we can get a grip on this? gnome-vfs people? hallski for gtkhtml?
I think gtkhtml2 isn't removing the timeout callback when it is destroyed, so when the timeout eventually gets called the widget is not valid. The idle callback should also be removed. So to fix it I think you need to add this to finalize() in htmlview.c: if (view->relayout_timeout_id != 0) { gtk_timeout_remove (view->relayout_timeout_id); view->relayout_timeout_id = 0; } if (view->relayout_timeout_id != 0) { gtk_timeout_remove (view->relayout_timeout_id); view->relayout_timeout_id = 0; } (Moving to gtkhtml2.)
Created attachment 7896 [details] [review] A proposed patch. I have not tested it so it may not be correct.
The patch looks good to me. Damon, go ahead and commit if you want.
Created attachment 7930 [details] [review] revised patch which also fixes other destruction problems
Created attachment 7931 [details] [review] Patch to fix destruction of nautilus-gtkhtml-view
With the above 2 patches added, it no longer SEGVs for me. There are other minor problems that I've reported - bug 79782 and bug 79783. OK to commit the gtkhtml patch?
Yes, feel free to commit.
2.0.0 mainly as a reminder to damon to commit when he returns.
Patch applied to cvs. closing.
*** Bug 81113 has been marked as a duplicate of this bug. ***