Closed Bug 314138 Opened 19 years ago Closed 19 years ago

gtkmozembed fails to init with xulrunner

Categories

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

All
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: roc, Assigned: roc)

Details

(Keywords: fixed1.8)

Attachments

(1 file)

Some of our xulrunner builds have a problem where they fail to init XPCOM. The problem is in EmbedPrivate.cpp we pass non-null kPStaticModules to NS_InitEmbedding but kStaticModuleCount is zero. We should pass null kPStaticModules (the default) so InitXPCOM will setup the static modules that are part of libxul. Now for some reason I can't figure out, it does work in my debug xulrunner build. Here's my gdb session in a build that works:

492         rv = NS_InitEmbedding(binDir, sAppFileLocProvider, kPStaticModules, kStaticModuleCount);
(gdb) p binDir
$12 = {mRawPtr = 0x51f7a0}
(gdb) p sAppFileLocProvider
$13 = (class nsIDirectoryServiceProvider *) 0x0
(gdb) p kPStaticModules
$14 = (const nsStaticModuleInfo * const) 0x2aaaaffef300
(gdb) s
nsCOMPtr<nsILocalFile>::operator nsDerivedSafe<nsILocalFile>* (
    this=0x7fffffcf4a40) at nsCOMPtr.h:843
843               return get();
(gdb) s
nsCOMPtr<nsILocalFile>::get (this=0x7fffffcf4a40) at nsCOMPtr.h:831
831               return NS_REINTERPRET_CAST(nsDerivedSafe<T>*, mRawPtr);
(gdb) s
0x00002aaaada72515 in nsCOMPtr<nsILocalFile>::operator nsDerivedSafe<nsILocalFile>* (this=0x7fffffcf4a40) at nsCOMPtr.h:843
843               return get();
(gdb) s

Breakpoint 3, NS_InitEmbedding (mozBinDirectory=0x51f7a0,
    appFileLocProvider=0x0, aStaticComponents=0x0, aStaticComponentCount=0)
    at nsEmbedAPI.cpp:94
94          sInitCounter++;
(gdb) quit

Notice how kPStaticModules was non-zero in the caller and it magically becomes zero in the callee.

Rather than debug that demon I made up a patch to just pass nothing in here. It works. I don't know if it's safe for Firefox though --- bsmedberg?
Attached patch fixSplinter Review
As described.
Attachment #201083 - Flags: superreview?(benjamin)
Attachment #201083 - Flags: review?(benjamin)
Comment on attachment 201083 [details] [diff] [review]
fix

Iterations of the static-module code make the old code "correct"... good catch. I'd be interested to figure out why kPStaticModules was not null in your case...
Attachment #201083 - Flags: superreview?(benjamin)
Attachment #201083 - Flags: review?(benjamin)
Attachment #201083 - Flags: review+
checked in on trunk.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment on attachment 201083 [details] [diff] [review]
fix

This fix is necessary to make gtkmozembed work at all with xulrunner. It's low risk and has *zero* impact on anyone except Linux embedding.
Attachment #201083 - Flags: approval1.8rc2?
Attachment #201083 - Flags: approval1.8rc2? → approval1.8rc2+
Fixed on branch. Thanks!
Keywords: fixed1.8
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: