Closed Bug 236688 Opened 20 years ago Closed 16 years ago

crash on form submit which closes the last window

Categories

(Core Graveyard :: Embedding: GTK Widget, defect)

x86
Linux
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9beta4

People

(Reporter: chpe, Assigned: chpe)

References

()

Details

(Keywords: crash)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040306

When a form submit uses onsubmit handler to close the window, and the window was
the last window open, the application crashes. I can reproduce this in Epiphany
and TestGtkEmbed; it is not reproducible in mozilla-the-browser. (all with
Mozilla compiled from cvs trunk, checkout from 2004-03-06.)

Reproducible: Always
Steps to Reproduce:
1. Load the testcase url
2. Click the "Popup" link
3. Close the parent window, so that the popup window is now the last window open
4. Click on "Submit"

Actual Results:  
Crash.

Expected Results:  
Winow closes, and, since it was the last window open, the app exits normally.

Trace from TestGtkEmbed:

#0  0x401c439f in PL_DHashTableOperate (table=0x40239980, key=0x81f9050,
op=PL_DHASH_REMOVE) at pldhash.c:490
#1  0x401c4959 in AtomImpl::~AtomImpl() () from ./libxpcom.so
#2  0x401c49eb in AtomImpl::Release() () from ./libxpcom.so
#3  0x40228c5c in nsCOMPtr_base::assign_with_AddRef(nsISupports*) () from
./libxpcom.so
#4  0x4122d4c9 in nsCSSSelector::Reset() () from
/opt/gnome2/lib/mozilla-1.7b/components/libgklayout.so
#5  0x4122d120 in nsCSSSelector::~nsCSSSelector() () from
/opt/gnome2/lib/mozilla-1.7b/components/libgklayout.so
#6  0x4122e4d2 in nsCSSSelectorList::~nsCSSSelectorList() () from
/opt/gnome2/lib/mozilla-1.7b/components/libgklayout.so
#7  0x4122f999 in CSSStyleRuleImpl::~CSSStyleRuleImpl() () from
/opt/gnome2/lib/mozilla-1.7b/components/libgklayout.so
#8  0x4122bf87 in nsCSSRule::Release() () from
/opt/gnome2/lib/mozilla-1.7b/components/libgklayout.so
#9  0x4122fadf in CSSStyleRuleImpl::Release() () from
/opt/gnome2/lib/mozilla-1.7b/components/libgklayout.so
#10 0x401cfbe9 in nsSupportsArray::Clear() () from ./libxpcom.so
#11 0x401cf5e1 in nsSupportsArray::DeleteArray() () from ./libxpcom.so
#12 0x401cf117 in nsSupportsArray::~nsSupportsArray() () from ./libxpcom.so
#13 0x401cf32b in nsSupportsArray::Release() () from ./libxpcom.so
#14 0x4123b094 in CSSStyleSheetInner::~CSSStyleSheetInner() () from
/opt/gnome2/lib/mozilla-1.7b/components/libgklayout.so
#15 0x4123b1f3 in CSSStyleSheetInner::RemoveSheet(nsICSSStyleSheet*) () from
/opt/gnome2/lib/mozilla-1.7b/components/libgklayout.so
#16 0x4123bccf in CSSStyleSheetImpl::~CSSStyleSheetImpl() () from
/opt/gnome2/lib/mozilla-1.7b/components/libgklayout.so
#17 0x4123bf9a in CSSStyleSheetImpl::Release() () from
/opt/gnome2/lib/mozilla-1.7b/components/libgklayout.so
#18 0x401dc574 in nsCOMArray_base::~nsCOMArray_base() () from ./libxpcom.so
#19 0x4100a4b4 in PresShell::~PresShell() () from
/opt/gnome2/lib/mozilla-1.7b/components/libgklayout.so
#20 0x41009a33 in PresShell::Release() () from
/opt/gnome2/lib/mozilla-1.7b/components/libgklayout.so
#21 0x40228c0b in nsCOMPtr_base::~nsCOMPtr_base() () from ./libxpcom.so
#22 0x412ab6f1 in nsViewManager::HandleEvent(nsView*, nsGUIEvent*, int) () from
/opt/gnome2/lib/mozilla-1.7b/components/libgklayout.so
#23 0x412aab21 in nsViewManager::DispatchEvent(nsGUIEvent*, nsEventStatus*) ()
from /opt/gnome2/lib/mozilla-1.7b/components/libgklayout.so
#24 0x412a39ad in HandleEvent(nsGUIEvent*) () from
/opt/gnome2/lib/mozilla-1.7b/components/libgklayout.so
#25 0x4162c52e in nsCommonWidget::DispatchEvent(nsGUIEvent*, nsEventStatus&) ()
from /opt/gnome2/lib/mozilla-1.7b/components/libwidget_gtk2.so
#26 0x41624c37 in nsWindow::OnButtonReleaseEvent(_GtkWidget*, _GdkEventButton*)
() from /opt/gnome2/lib/mozilla-1.7b/components/libwidget_gtk2.so
#27 0x41628cc3 in button_release_event_cb(_GtkWidget*, _GdkEventButton*) () from
/opt/gnome2/lib/mozilla-1.7b/components/libwidget_gtk2.so
#28 0x403d513b in _gtk_marshal_BOOLEAN__BOXED (closure=0x8317e90,
return_value=0xbffff310, n_param_values=2, param_values=0xbffff440,
invocation_hint=0xbffff338, 
    marshal_data=0x0) at gtkmarshalers.c:82
#29 0x40688f72 in g_closure_invoke (closure=0x82e8a10, return_value=0xbffff310,
n_param_values=2, param_values=0xbffff440, invocation_hint=0xbffff338) at
gclosure.c:437
#30 0x4069ba5f in signal_emit_unlocked_R (node=0x8084800, detail=0,
instance=0x8317e90, emission_return=0xbffff3e0, instance_and_params=0xbffff440)
at gsignal.c:2436
#31 0x4069a8ee in g_signal_emit_valist (instance=0x8317e90, signal_id=0,
detail=0, var_args=0xbffff5d0 "����H\025\b\b�[\032\b�[\032\b����") at gsignal.c:2205
#32 0x4069add6 in g_signal_emit (instance=0x8317e90, signal_id=28, detail=0) at
gsignal.c:2239
#33 0x404c4ee9 in gtk_widget_event_internal (widget=0x8317e90, event=0x8247ab8)
at gtkwidget.c:3562
#34 0x403d3706 in gtk_propagate_event (widget=0x8317e90, event=0x8247ab8) at
gtkmain.c:2349
#35 0x403d24fc in gtk_main_do_event (event=0x8247ab8) at gtkmain.c:1581
#36 0x405bac72 in gdk_event_dispatch (source=0xbffff040, callback=0,
user_data=0x0) at gdkevents-x11.c:2136
#37 0x406dc39b in g_main_dispatch (context=0x807f570) at gmain.c:1905
#38 0x406dd419 in g_main_context_dispatch (context=0x807f570) at gmain.c:2451
#39 0x406dd75a in g_main_context_iterate (context=0x807f570, block=1,
dispatch=1, self=0x8081048) at gmain.c:2532
#40 0x406dde11 in g_main_loop_run (loop=0x81b5a70) at gmain.c:2752
#41 0x403d1ddb in gtk_main () at gtkmain.c:1171
#42 0x08049f83 in main ()
Adding dbaron and bryner in case they have some input into lifecycle issues with
the presshell and css code.
Severity: normal → critical
Keywords: crash
Attached patch fixSplinter Review
The problem is that when the last window is destroyed from the mouse click, we
end up shutting down embedding/XPCOM from that event! The solution is to wait
until idle to pop the mozilla usage (gtk_moz_embed_pop_startup()), and quit
from idle.
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
Confirming; this is a bug in TestGtkEmbed.
Status: UNCONFIRMED → NEW
Ever confirmed: true
chpe, is the patch worth checking in?
bug 372077 added push_startup and pop_startup calls... but I think chpe's patch is more correct, and probably should get updated and committed.
Target Milestone: --- → Future
Comment on attachment 185897 [details] [diff] [review]
fix

i agree. (chpe should write a patch to back out the other once this is in.)
Attachment #185897 - Flags: review+
Attachment #185897 - Flags: approval1.9?
Attachment #185897 - Flags: approval1.9? → approval1.9+
Keywords: checkin-needed
Assignee: blizzard → nobody
QA Contact: pavlov → gtk-widget
Assignee: nobody → chpe
Target Milestone: Future → mozilla1.9beta4
Checking in embedding/browser/gtk/tests/TestGtkEmbed.cpp;
/cvsroot/mozilla/embedding/browser/gtk/tests/TestGtkEmbed.cpp,v  <--  TestGtkEmbed.cpp
new revision: 1.44; previous revision: 1.43
done
Status: NEW → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: