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 142184 - Reproducable crash when closing popup at http://www.frip.dk/boksidan/
Reproducable crash when closing popup at http://www.frip.dk/boksidan/
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
unspecified
Other Linux
: High critical
: ---
Assigned To: Marco Pesenti Gritti
Marco Pesenti Gritti
: 143127 144312 145024 145949 146044 146100 146303 146338 146371 146423 146572 146573 146587 147363 165443 307647 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-05-09 13:04 UTC by André Dahlqvist
Modified: 2005-07-09 16:04 UTC
See Also:
GNOME target: 2.6.next
GNOME version: 2.5/2.6


Attachments
patch (10.03 KB, patch)
2004-05-11 00:11 UTC, Christian Persch
none Details | Review

Description André Dahlqvist 2004-05-09 13:04:25 UTC
[Epiphany 1.2.5]

Epiphany crashes as soon as I close the popup window that shows up at
http://www.frip.dk/boksidan/. I have epiphany-extensions installed, but popup
blocking was obviously not turned on for that site.

Steps to reproduce:

1) Go to http://www.frip.dk/boksidan/
2) Close the popup window that appears.

Result: Epiphany will crash.

I don't have a debug build, but chpe can reproduce the bug so he will attach a
trace below.
Comment 1 Christian Persch 2004-05-09 13:09:17 UTC


  • #0 EphyBrowser::GetDocumentUrl
    at nsCOMPtr.h line 663
  • #1 impl_get_location
    at mozilla-embed.cpp line 490
  • #2 ephy_embed_get_location
    at ephy-embed.c line 258
  • #3 ephy_tab_set_title
    at ephy-tab.c line 1353
  • #4 ephy_tab_title_cb
    at ephy-tab.c line 729
  • #5 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #6 g_closure_invoke
    at gclosure.c line 437
  • #7 signal_emit_unlocked_R
    at gsignal.c line 2436
  • #8 g_signal_emit_valist
    at gsignal.c line 2195
  • #9 gtk_signal_emit
    at gtksignal.c line 359
  • #10 EmbedWindow::SetTitle
    from /usr/lib/libgtkembedmoz.so
  • #11 NSGetModule
    from /usr/lib/mozilla/components/libwebbrwsr.so
  • #12 nsDocShell::SetTitle
    from /usr/lib/mozilla/components/libdocshell.so

Comment 2 Christian Persch 2004-05-09 13:17:48 UTC
Note that the tab=0x0/embed=0x0 in #1-#4 are probably gdb bogosity. However:

  • #2 ephy_embed_get_location
    at ephy-embed.c line 258
  • #3 ephy_tab_set_title
    at ephy-tab.c line 1353
$16 = (GtkWidget *) 0x0
(gdb) p /x ((GtkObject*) tab)->flags
$21 = 0x210621

Analysis:
Neither tab nor embed are realized; i.e. the signal is called after they have
been unrealized and since embed->priv->browser == NULL, after they've been
destroyed. Embed isn't inside Tab anymore.

Marco, any idea how to solve this?
Comment 3 Marco Pesenti Gritti 2004-05-09 17:36:19 UTC
Shouldnt the embed->priv->browser == NULL check deal with this already ?
Comment 4 Christian Persch 2004-05-09 18:16:40 UTC
We removed that check with the patch from bug 141262.
Comment 5 Marco Pesenti Gritti 2004-05-09 18:49:50 UTC
Well the quick fix could be to put the NULL check back.

We need to figure out these damned lifetime issues now though. Can you put a
full trace ? I want to see how the title signal is emitted.
Comment 6 Marco Pesenti Gritti 2004-05-09 18:50:26 UTC
Oh please put a comment about it, or next time I'm going to remove it again and
regress.
Comment 7 Marco Pesenti Gritti 2004-05-09 19:07:35 UTC
So I think there are two sides of the issue.

One is that I think gtkmozembed should not emit events when EmbedPrivate has
been deleted. Gtkmozembed api itself would crash I think. I have an idea about
it but I should talk with blizzard.

The other is that our code could be more robust. I tend to consider ephy-embed
like a wrapper around  EphyBrowser (like mozilla-dowload around MozDownload
etc). So I think it would be good EphyBrowser and ephy-embed life cycle would
match exactly.
I would call ->Destroy from destroy and ensure the stuff we initialized in Init
is realesed (== nsnull), this is similar to what gtkmozembed does too. Though,
and here we diverge from gtkmozembed, I'd delete the EphyBrowser object only on
finalize. For this particular case that means our mDOMWindow check in
GetDocumentUrl would avoid the crash.

What do you think ? If you agree on it we could prolly just go ahead with this
on head instead of the quick fix. Better ideas ?
Comment 8 Christian Persch 2004-05-10 22:07:06 UTC
Ok, I made those changes: delete the embed's EphyBrowser only on finalize (but
still Destroy() it on destroy), and made the public EphyBrowser methods safe to
be called after Destroy (if (!mWebBrowser/mDOMWindow) return ...;).

However I think we should do something more: make EphyTab not emit any signals
after it's destroyed (so that extensions don't have to check for that). We could
copy crispin's fix for galeon and just block the signal handlers the tab
connected to the embed in the destroy signal handler.
Comment 9 Marco Pesenti Gritti 2004-05-10 22:52:36 UTC
Where is the patch ?;)
I'd use ENSURE, not ifs, except for GetDocumentUrl (and I'd put a comment there
for why we use if). Actually, if mozilla ENSURE works also for not debug build
I'd use ENSURE everywhere, it's good to leave the warning in debug builds there
I think.

I dont think we should work around the problem in ephy-tab unless there is
evidence it's necessary. We want to solve this in gtkmozembed, since it's a
problem for all gtkmozembed users.
Comment 10 Christian Persch 2004-05-11 00:11:17 UTC
Created attachment 27578 [details] [review]
patch

Well I had already checked it in, since this was just the described changes.

Yes, NS_ENSURE_TRUE/NS_ENSURE_SUCCESS works in non-debug too, it just returns
without printing a message on console.
I don't think we should make a distinction between functions which we may use
internally in ephy after destroy like GetDocumentUrl and which we don't use,
since extensions may use other functions after destroy. Either all functions
are ok to use, or none, imho; so either NS_ENSURE_TRUE for all or if (!...)
return; for all.

I agree that we really want this fixed in gtkmozembed too.
Comment 11 Marco Pesenti Gritti 2004-05-11 00:15:01 UTC
>I don't think we should make a distinction between functions which we may use
>internally in ephy after destroy like GetDocumentUrl and which we don't use,
>since extensions may use other functions after destroy. Either all functions
>are ok to use, or none, imho; so either NS_ENSURE_TRUE for all or if (!...)
>return; for all.

Sure. I was just thinking we needed the work around for GetDocumentUrl on the
model of g_returns. There you would get a crash in non debug builds. With
mozilla is different though.
I think they should definately be all ENSURE, it's something that should not happen.
Comment 12 Christian Persch 2004-05-11 00:23:07 UTC
I've now changed them all to NS_ENSURE_TRUE.
Comment 13 Christian Persch 2004-05-11 13:58:28 UTC
Verified Fixed.
Comment 14 Marco Pesenti Gritti 2004-05-11 16:46:03 UTC
Did you release in Destroy stuff we are referencing in Init ?
Comment 15 Christian Persch 2004-05-11 18:25:38 UTC
Yes, ::Destroy() sets mWebBrowser and mDOMWindow to nsnull, detaches the
listeners attached in ::Init(), and sets mInitialized to PR_FALSE.

Btw, I noticed we never seem to delete the listeners themselves... do we leak
them, or are they just weakref'd?
Comment 16 Christian Persch 2004-05-25 22:21:50 UTC
*** Bug 143127 has been marked as a duplicate of this bug. ***
Comment 17 Edd Dumbill 2004-06-01 09:13:00 UTC
Getting reports of this on Debian too

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=248342
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=251802

Any idea when the next release will be?
Comment 18 Christian Persch 2004-06-14 10:51:19 UTC
*** Bug 144312 has been marked as a duplicate of this bug. ***
Comment 19 Christian Persch 2004-06-27 12:52:34 UTC
*** Bug 145024 has been marked as a duplicate of this bug. ***
Comment 20 Christian Persch 2004-07-08 21:50:15 UTC
*** Bug 145949 has been marked as a duplicate of this bug. ***
Comment 21 Christian Persch 2004-07-08 22:53:50 UTC
*** Bug 146044 has been marked as a duplicate of this bug. ***
Comment 22 Christian Persch 2004-07-09 13:36:32 UTC
*** Bug 146100 has been marked as a duplicate of this bug. ***
Comment 23 Christian Persch 2004-07-09 14:03:19 UTC
*** Bug 146303 has been marked as a duplicate of this bug. ***
Comment 24 Christian Persch 2004-07-09 14:04:42 UTC
*** Bug 146338 has been marked as a duplicate of this bug. ***
Comment 25 Christian Persch 2004-07-09 14:05:48 UTC
*** Bug 146371 has been marked as a duplicate of this bug. ***
Comment 26 Christian Persch 2004-07-09 14:11:38 UTC
*** Bug 146423 has been marked as a duplicate of this bug. ***
Comment 27 Christian Persch 2004-07-09 14:16:49 UTC
*** Bug 146572 has been marked as a duplicate of this bug. ***
Comment 28 Christian Persch 2004-07-09 14:17:18 UTC
*** Bug 146573 has been marked as a duplicate of this bug. ***
Comment 29 Christian Persch 2004-07-09 14:17:57 UTC
*** Bug 146587 has been marked as a duplicate of this bug. ***
Comment 30 Christian Persch 2004-07-13 12:22:00 UTC
*** Bug 147363 has been marked as a duplicate of this bug. ***
Comment 31 Elijah Newren 2005-03-05 06:58:15 UTC
*** Bug 165443 has been marked as a duplicate of this bug. ***
Comment 32 Christian Persch 2005-07-09 16:04:42 UTC
*** Bug 307647 has been marked as a duplicate of this bug. ***