Re: Using Mozilla without DISPLAY set

[email protected] (Christian Smith)
Newsgroups gmane.comp.mozilla.devel.unix
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
In article <[email protected]>,
	Christian Biesinger <[email protected]> writes:
> Christian Smith wrote:
>> Now, this occurs if I don't initialise libgtk. If libgtk is initialised, the
>> crash does not happen. I'll recreate the problem on Linux with a debug build
>> of Mozilla (1.7.2, BTW) and post more details.
> 
> Hm... if I'm using TestProtocols w/o DISPLAY set, it works just fine for 
> me, it successfully loads http://www.mozilla.org...

OK, here is a stack trace from Linux:

Thread 5 (Thread 3076 (LWP 21495)):

#0  0x4079540c in getNextRequest(void*) () from /var/tmp/nchome/platform/linux2x86/mozilla/components/libwidget_gtk.so
#1  0x400a0430 in PL_PostEvent () from /usr/tmp/nchome/platform/linux2x86/mozilla/libxpcom.so
#2  0x400a1e39 in nsEventQueueImpl::PostEvent(PLEvent*) () from /usr/tmp/nchome/platform/linux2x86/mozilla/libxpcom.so
#3  0x400c8b25 in nsInputStreamReadyEvent::OnInputStreamReady(nsIAsyncInputStream*) () from /usr/tmp/nchome/platform/linux2x86/mozilla/libxpcom.so
#4  0x4008aa8b in nsPipeEvents::~nsPipeEvents() () from /usr/tmp/nchome/platform/linux2x86/mozilla/libxpcom.so
#5  0x4008a8a2 in nsPipe::AdvanceWriteCursor(unsigned) () from /usr/tmp/nchome/platform/linux2x86/mozilla/libxpcom.so
#6  0x4008ba7d in nsPipeOutputStream::WriteSegments(unsigned (*)(nsIOutputStream*, void*, char*, unsigned, unsigned, unsigned*), void*, unsigned, unsigned*) () from
/usr/tmp/nchome/platform/linux2x86/mozilla/libxpcom.so
#7  0x400c936a in nsStreamCopierOB::DoCopy(unsigned*, unsigned*) () from /usr/tmp/nchome/platform/linux2x86/mozilla/libxpcom.so
#8  0x400c94d4 in nsAStreamCopier::Process() () from /usr/tmp/nchome/platform/linux2x86/mozilla/libxpcom.so
#9  0x400c8fed in nsAStreamCopier::HandleContinuationEvent(PLEvent*) () from /usr/tmp/nchome/platform/linux2x86/mozilla/libxpcom.so
#10 0x400a0981 in PL_HandleEvent () from /usr/tmp/nchome/platform/linux2x86/mozilla/libxpcom.so
#11 0x40b5248e in nsIOThreadPool::ThreadFunc(void*) () from /var/tmp/nchome/platform/linux2x86/mozilla/components/libnecko.so
#12 0x4010d399 in _pt_root () from /usr/tmp/nchome/platform/linux2x86/mozilla/libnspr4.so
#13 0x40138c3f in pthread_start_thread (arg=0x41dffbe0) at manager.c:284
#14 0x40138d2f in pthread_start_thread_event (arg=0x41dffbe0) at manager.c:308



In another thread, we're parsing an XML file:

Thread 1 (Thread 1024 (LWP 21454)):
#0  0x4058fbb5 in __sigsuspend (set=0xbfffdee4) at ../sysdeps/unix/sysv/linux/sigsuspend.c:45
#1  0x4013b179 in __pthread_wait_for_restart_signal (self=0x40143f20) at pthread.c:978
#2  0x4013c9cc in __pthread_lock (lock=0x8236074, self=0x40143f20) at spinlock.c:149
#3  0x40139cde in __pthread_mutex_lock (mutex=0x8236064) at mutex.c:101
#4  0x401078b2 in PR_Lock () from /usr/tmp/nchome/platform/linux2x86/mozilla/libnspr4.so
#5  0x40107ef2 in PR_EnterMonitor () from /usr/tmp/nchome/platform/linux2x86/mozilla/libnspr4.so
#6  0x400a0870 in PL_ProcessPendingEvents () from /usr/tmp/nchome/platform/linux2x86/mozilla/libxpcom.so
#7  0x400a214b in nsEventQueueImpl::ProcessPendingEvents() () from /usr/tmp/nchome/platform/linux2x86/mozilla/libxpcom.so
#8  0x410b7233 in nsXMLDocument::Load(nsAString const&, int*) () from /var/tmp/nchome/platform/linux2x86/mozilla/components/libgklayout.so
#9  0x4161f3c2 in nsNCIPackageManager::LoadProductXML(nsAString const&) () from /var/tmp/nchome/platform/linux2x86/mozilla/components/libNCISetupModule.dlm
#10 0x4162049b in nsNCIPackageManager::Initialize() () from /var/tmp/nchome/platform/linux2x86/mozilla/components/libNCISetupModule.dlm
#11 0x400b96c3 in XPTC_InvokeByIndex () from /usr/tmp/nchome/platform/linux2x86/mozilla/libxpcom.so
#12 0x407591f8 in XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode) () from /var/tmp/nchome/platform/linux2x86/mozilla/components/libxpconnect.so
#13 0x4075f3a0 in XPC_WN_CallMethod(JSContext*, JSObject*, unsigned, long*, long*) () from /var/tmp/nchome/platform/linux2x86/mozilla/components/libxpconnect.so
#14 0x401a4868 in js_Invoke () from /usr/tmp/nchome/platform/linux2x86/mozilla/libmozjs.so
#15 0x401ac578 in js_Interpret () from /usr/tmp/nchome/platform/linux2x86/mozilla/libmozjs.so
#16 0x401a4e4f in js_Execute () from /usr/tmp/nchome/platform/linux2x86/mozilla/libmozjs.so
#17 0x40181ef7 in JS_ExecuteScript () from /usr/tmp/nchome/platform/linux2x86/mozilla/libmozjs.so
#18 0x0804f498 in GRE_CustomShutdown ()


Further investigation reveals that nsAppShell::ListenToEventQueue() adds
the getNextRequest() function to some callback mechanism in the event queue,
and nsAppShell::ListenToEventQueue is defined in:
widget/src/gtk/nsAppShell.cpp

So the necko and DOM backtraces are just red herrings. I'll try removing
nsAppShell references from my app when not running under X, and see
if that helps.

Cheers,
Christian

-- 
    /"\ 
    \ /    ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL 
     X                           - AGAINST MS ATTACHMENTS
    / \
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.