Closed Bug 180741 Opened 23 years ago Closed 18 years ago

nsNativeThemeGTK::nsNativeThemeGTK crashes if it can't get a display

Categories

(Core :: Widget: Gtk, defect)

x86
Windows 2000
defect
Not set
critical

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: timeless, Assigned: timeless)

References

Details

(Keywords: crash)

Attachments

(1 obsolete file)

Gtk-WARNING **: gtk_type_create(): unknown parent type `21'. Gtk-CRITICAL **: file gtkwidget.c: line 1641 (gtk_widget_realize): assertion `GTK_IS_WIDGET (widget)' failed. Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1024 (LWP 26366)] 0x41b3d896 in nsNativeThemeGTK::nsNativeThemeGTK (this=0x850c760) at nsNativeThemeGTK.cpp:104 104 GtkThemeEngine* gtkThemeEng = gButtonWidget->style->engine; (gdb) where #0 0x41b3d896 in nsNativeThemeGTK::nsNativeThemeGTK (this=0x850c760) at nsNativeThemeGTK.cpp:104 #1 0x41b1795b in nsNativeThemeGTKConstructor (aOuter=0x0, aIID=@0xbfffd7f8, aResult=0xbfffd7e8) at nsGfxFactoryGTK.cpp:89 #2 0x4020dc9a in nsGenericFactory::CreateInstance (this=0x850c740, aOuter=0x0, aIID=@0xbfffd7f8, aResult=0xbfffd7e8) at nsGenericFactory.cpp:84 #3 0x401bb709 in nsComponentManagerImpl::CreateInstance (this=0x8058158, aClass=@0x850e89c, aDelegate=0x0, aIID=@0xbfffd7f8, aResult=0xbfffd7e8) at nsComponentManager.cpp:1817 #4 0x401c06d6 in nsComponentManager::CreateInstance (aClass=@0x850e89c, aDelegate=0x0, aIID=@0xbfffd7f8, aResult=0xbfffd7e8) at nsComponentManagerObsolete.cpp:102 #5 0x4050e062 in nsJSCID::CreateInstance (this=0x850e880, _retval=0xbfffda58) at xpcjsid.cpp:793 #6 0x401f1ca8 in XPTC_InvokeByIndex () at xptcinvoke_gcc_x86_unix.cpp:86 #7 0x40524c39 in XPCWrappedNative::CallMethod (ccx=@0xbfffdb10, mode=CALL_METHOD) at xpcwrappednative.cpp:2016 #8 0x4052dc2e in XPC_WN_CallMethod (cx=0x80b80b0, obj=0x867d9d8, argc=0, argv=0x80d47e8, vp=0xbfffdc50) at xpcwrappednativejsops.cpp:1283 #9 0x4006291b in js_Invoke (cx=0x80b80b0, argc=0, flags=0) at jsinterp.c:839 #10 0x40071a62 in js_Interpret (cx=0x80b80b0, result=0xbffff6dc) at jsinterp.c:2803 #11 0x4006306a in js_Execute (cx=0x80b80b0, chain=0x808dcc0, script=0x80d4640, down=0x0, special=0, result=0xbffff6dc) at jsinterp.c:1020 #12 0x40030677 in JS_ExecuteScript (cx=0x80b80b0, obj=0x808dcc0, script=0x80d4640, rval=0xbffff6dc) at jsapi.c:3277 #13 0x804badb in Process (cx=0x80b80b0, obj=0x808dcc0, filename=0xbffff9d5 "driver.js", filehandle=0x0) at xpcshell.cpp:479 #14 0x804c1d5 in ProcessArgs (cx=0x80b80b0, obj=0x808dcc0, argv=0xbffff878, argc=1) at xpcshell.cpp:655 #15 0x804cd8e in main (argc=1, argv=0xbffff878) at xpcshell.cpp:912 #16 0x403852eb in __libc_start_main (main=0x804c544 <main>, argc=2, ubp_av=0xbffff874, init=0x804a7a4 <_init>, fini=0x804f030 <_fini>, rtld_fini=0x4000c130 <_dl_fini>, stack_end=0xbffff86c) at ../sysdeps/generic/libc-start.c:129 (gdb) p gButtonWidget->style $2 = (GtkStyle *) 0x0 Testcase: Components.classes["@mozilla.org/chrome/chrome-native-theme;1"].createInstance() There are lots and lots of asserts that you get from this single line, i don't know how to get GLib/Gtk to break/crash so that i can get an earlier stack. I can attach a fix which will make the testcase not crash. The constructor shouldn't crash, and any initialization that can fail should be attached to an Init method.
Severity: normal → critical
Keywords: crash
Attached patch patch (obsolete) — Splinter Review
someone will at somepoint want to refactor this code to use an Init() function.
Blocks: 181491
Blocks: 181494
Blocks: 181496
Blocks: 181498
Blocks: 181500
Blocks: 181503
Blocks: 181505
Blocks: 181507
Blocks: 181509
Blocks: 181512
No longer blocks: 181512
No longer blocks: 181509
No longer blocks: 181507
No longer blocks: 181505
No longer blocks: 181500
No longer blocks: 181498
No longer blocks: 181496
No longer blocks: 181494
No longer blocks: 181503
Blocks: 233462
Comment on attachment 106691 [details] [diff] [review] patch This patch was made against r1.32; r1.50 is current, and this patch seems to have fully bit-rotted now...
Attachment #106691 - Attachment is obsolete: true
timeless, is this still a problem after all these years?
Component: XP Toolkit/Widgets → Widget: Gtk
QA Contact: jrgmorrison → gtk
seems to work w/ ff2? timeless@swift:/usr/lib/firefox% ./run-mozilla.sh ./xpcshell js> build() built on Nov 13 2006 at 15:50:51 js> Components.classes["@mozilla.org/chrome/chrome-native-theme;1"]. createInstance() [xpconnect wrapped nsISupports] CATEGORY: FIREFOX,application,JDS4 VERSION: 2.0,REV=110.0.4.2006.11.13.15.42
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: