Closed Bug 180717 Opened 22 years ago Closed 16 years ago

gtk nsClipboard needs to be reworked so its constructor doesn't call init

Categories

(Core :: XUL, defect)

x86
Windows 2000
defect
Not set
critical

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: timeless, Assigned: timeless)

References

Details

(Keywords: crash)

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1024 (LWP 26122)] 0x417ee98f in XInternAtom () from /usr/X11R6/lib/libX11.so.6 Current language: auto; currently c (gdb) where #0 0x417ee98f in XInternAtom () from /usr/X11R6/lib/libX11.so.6 #1 0x41c8547a in gdk_atom_intern () from /opt/gnome/lib/libgdk-1.2.so.0 #2 0x422e27ca in nsClipboard::Init (this=0x8319a68) at nsClipboard.cpp:177 #3 0x422e248d in nsClipboard::nsClipboard (this=0x8319a68) at nsClipboard.cpp:97 #4 0x422f723b in nsClipboardConstructor (aOuter=0x0, aIID=@0xbfffd7f8, aResult=0xbfffd7e8) at nsWidgetFactory.cpp:78 #5 0x4020dc9a in nsGenericFactory::CreateInstance (this=0x82a6280, aOuter=0x0, aIID=@0xbfffd7f8, aResult=0xbfffd7e8) at nsGenericFactory.cpp:84 #6 0x401bb709 in nsComponentManagerImpl::CreateInstance (this=0x8058158, aClass=@0x826552c, aDelegate=0x0, aIID=@0xbfffd7f8, aResult=0xbfffd7e8) at nsComponentManager.cpp:1817 #7 0x401c06d6 in nsComponentManager::CreateInstance (aClass=@0x826552c, aDelegate=0x0, aIID=@0xbfffd7f8, aResult=0xbfffd7e8) at nsComponentManagerObsolete.cpp:102 #8 0x4050e062 in nsJSCID::CreateInstance (this=0x8265510, _retval=0xbfffda58) at xpcjsid.cpp:793 #9 0x401f1ca8 in XPTC_InvokeByIndex () at xptcinvoke_gcc_x86_unix.cpp:86 #10 0x40524c39 in XPCWrappedNative::CallMethod (ccx=@0xbfffdb10, mode=CALL_METHOD) at xpcwrappednative.cpp:2016 #11 0x4052dc2e in XPC_WN_CallMethod (cx=0x80b80b0, obj=0x83acc40, argc=0, argv=0x80d3438, vp=0xbfffdc50) at xpcwrappednativejsops.cpp:1283 #12 0x4006291b in js_Invoke (cx=0x80b80b0, argc=0, flags=0) at jsinterp.c:839 #13 0x40071a62 in js_Interpret (cx=0x80b80b0, result=0xbffff6dc) at jsinterp.c:2803 #14 0x4006306a in js_Execute (cx=0x80b80b0, chain=0x808dcc0, script=0x80d32b0, down=0x0, special=0, result=0xbffff6dc) at jsinterp.c:1020 #15 0x40030677 in JS_ExecuteScript (cx=0x80b80b0, obj=0x808dcc0, script=0x80d32b0, rval=0xbffff6dc) at jsapi.c:3277 #16 0x804badb in Process (cx=0x80b80b0, obj=0x808dcc0, filename=0xbffff9d5 "driver.js", filehandle=0x0) at xpcshell.cpp:479 #17 0x804c1d5 in ProcessArgs (cx=0x80b80b0, obj=0x808dcc0, argv=0xbffff878, argc=1) at xpcshell.cpp:655 #18 0x804cd8e in main (argc=1, argv=0xbffff878) at xpcshell.cpp:912 #19 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 Init is crashing because there's no display. the fix is to make init check for a display and fail w/ an error. but then its caller has to handle that, class constructors can't. steps: make sure you don't have a DISPLAY env var. ./run-mozilla.sh ./xpcshell Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(); acceptable XPCOM results: throw an exception or succeed actual results: segfault.
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
By the definitions on <http://bugzilla.mozilla.org/bug_status.html#severity> and <http://bugzilla.mozilla.org/enter_bug.cgi?format=guided>, crashing and dataloss bugs are of critical or possibly higher severity. Only changing open bugs to minimize unnecessary spam. Keywords to trigger this would be crash, topcrash, topcrash+, zt4newcrash, dataloss.
Severity: normal → critical
nsClipboard::nsClipboard does not call Init anymore. STR above gives me: uncaught exception: [Exception... "Component returned failure code: 0x80570015 (NS_ERROR_XPC_CI_RETURNED_FAILURE) [nsIJSCID.createInstance]" nsresult: "0x80570015 (NS_ERROR_XPC_CI_RETURNED_FAILURE)" location: "JS frame :: typein :: <TOP_LEVEL> :: line 1" data: no] which is an acceptable result according to reporter. -> WORKSFORME
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.