Closed
Bug 75607
Opened 24 years ago
Closed 23 years ago
Can't create factories for several components in embedding case
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: edburns, Assigned: dougt)
References
Details
For some reason, on unix only (not on win32), my embedding app can't
work because the following assertions occurr:
+++ nsGenericModule JS component loader: unable to create factory for
{6bd13476-1dd2-11b2-bbef-f0ccb5fa64b6}
###!!! ASSERTION: Factory creation failed: 'NS_SUCCEEDED(rv)', file
nsNativeComponentLoader.cpp, line 157
###!!! Break: at file nsNativeComponentLoader.cpp, line 157
+++ nsGenericModule nsStringBundleModule: unable to create factory for
{d85a17c1-aa7c-11d2-9b8c-00805f8a16d9}
###!!! ASSERTION: Factory creation failed: 'NS_SUCCEEDED(rv)', file
nsNativeComponentLoader.cpp, line 157
###!!! Break: at file nsNativeComponentLoader.cpp, line 157
+++ nsGenericModule nsChromeModule: unable to create factory for
{d8c7d8a2-e84c-11d2-bf87-00105a1b0627}
###!!! ASSERTION: Factory creation failed: 'NS_SUCCEEDED(rv)', file
nsNativeComponentLoader.cpp, line 157
###!!! Break: at file nsNativeComponentLoader.cpp, line 157
+++ nsGenericModule appshell: unable to create factory for
{e34783f5-ac08-11d2-8d19-00805fc2500c}
###!!! ASSERTION: Factory creation failed: 'NS_SUCCEEDED(rv)', file
nsNativeComponentLoader.cpp, line 157
###!!! Break: at file nsNativeComponentLoader.cpp, line 157
+++ nsGenericModule nsProfileModule: unable to create factory for
{02b0625b-e7f3-11d2-9f5a-006008a6efe9}
###!!! ASSERTION: Factory creation failed: 'NS_SUCCEEDED(rv)', file
nsNativeComponentLoader.cpp, line 157
###!!! Break: at file nsNativeComponentLoader.cpp, line 157
+++ nsGenericModule nsPrefModule: unable to create factory for
{dc26e0e0-ca94-11d1-a9a4-00805f8a7ac4}
###!!! ASSERTION: Factory creation failed: 'NS_SUCCEEDED(rv)', file
nsNativeComponentLoader.cpp, line 157
###!!! Break: at file nsNativeComponentLoader.cpp, line 157
I've investigated this quite thoroughly and here's what I have come up
with.
After debugging this further, I find that in
NS_IMETHODIMP
nsGenericModule::GetClassObject(nsIComponentManager *aCompMgr,
const nsCID& aClass,
const nsIID& aIID,
void** r_classObj)
during the for loop when it's looking for a component whose CID equals
the requested cid, it doesn't find one. Does this mean that
autoregistration is failing somehow?
#0 nsGenericModule::GetClassObject (this=0x81d3b18, aCompMgr=0x81c9ba8,
aClass=@0x809f098, aIID=@0x49137ad0, r_classObj=0xbe5ff3d4)
at nsGenericFactory.cpp:259
#1 0x490c71e8 in nsNativeComponentLoader::GetFactoryFromModule (
this=0x81cc350, aDll=0x80f5b90, aCID=@0x809f098, aFactory=0xbe5ff3d4)
at nsNativeComponentLoader.cpp:1184
#2 0x490c3c5d in nsNativeComponentLoader::GetFactory (this=0x81cc350,
aCID=@0x809f098, aLocation=0x809f0f8 "rel:libstrres.so",
aType=0x809f0d0 "application/x-mozilla-native", _retval=0xbe5ff3d4)
at nsNativeComponentLoader.cpp:136
#3 0x49126232 in nsFactoryEntry::GetFactory (this=0x809f098,
aFactory=0xbe5ff3d4, mgr=0x81c9ba8) at nsComponentManager.h:217
#4 0x490bf195 in nsComponentManagerImpl::FindFactory (this=0x81c9ba8,
aClass=@0xbe5ff4d4, aFactory=0xbe5ff3d4) at nsComponentManager.cpp:1028
I find that the nsGenericModule ctor for "JS component loader" is called
once in the embedding case, with mComponents is:
debug: edburns: printing argument components for JS component loader
@mozilla.org/widgets/window/gtk;1
@mozilla.org/widgets/child_window/gtk;1
@mozilla.org/widgets/button/gtk;1
@mozilla.org/widgets/checkbutton/gtk;1
@mozilla.org/widgets/filewidget/gtk;1
@mozilla.org/widgets/horizscroll/gtk;1
@mozilla.org/widgets/vertscroll/gtk;1
@mozilla.org/widgets/textwidget/gtk;1
@mozilla.org/widget/appshell/gtk;1
@mozilla.org/widget/toolkit/gtk;1
@mozilla.org/widget/lookandfeel/gtk;1
@mozilla.org/widget/label/gtk;1
@mozilla.org/sound;1
@mozilla.org/widget/transferable;1
@mozilla.org/widget/clipboard;1
@mozilla.org/widget/htmlformatconverter/gtk;1
@mozilla.org/widget/fontretrieverservice/gtk;1
@mozilla.org/widget/dragservice;1
@mozilla.org/filespecwithui;1
But it's called twice in the mozilla case, with the mComponents the
first time being:
debug: edburns: printing argument components for JS component loader
@mozilla.org/moz/jsloader;1
@mozilla.org/moz/jssubscript-loader;1
and the second time being:
debug: edburns: printing argument components for JS component loader
@mozilla.org/widgets/window/gtk;1
@mozilla.org/widgets/child_window/gtk;1
@mozilla.org/widgets/button/gtk;1
@mozilla.org/widgets/checkbutton/gtk;1
@mozilla.org/widgets/filewidget/gtk;1
@mozilla.org/widgets/horizscroll/gtk;1
@mozilla.org/widgets/vertscroll/gtk;1
@mozilla.org/widgets/textwidget/gtk;1
@mozilla.org/widget/appshell/gtk;1
@mozilla.org/widget/toolkit/gtk;1
@mozilla.org/widget/lookandfeel/gtk;1
@mozilla.org/widget/label/gtk;1
@mozilla.org/sound;1
@mozilla.org/widget/transferable;1
@mozilla.org/widget/clipboard;1
@mozilla.org/widget/htmlformatconverter/gtk;1
@mozilla.org/widget/fontretrieverservice/gtk;1
@mozilla.org/widget/dragservice;1
@mozilla.org/filespecwithui;1
This first time invocation is key to the GetClassObject working.
I have posted this to n.p.m.embedding, and n.p.m.xpcom, and received no
response. Thus I'm filing a bug.
This severely blocks webclient progress.
I've tried to craft a workaround, by calling RegisterComponentLib on all the
offending components, but have had no luck.
Ray, please help
Blocks: 74151
The inimitable Igor Kushnirsky helped me out with this bug. It turns out the
reason for the factory not being found is that webclient links with
-lwidget_gtk on Unix. Once I prevented my app from linking with
-lwidget_gtk I was able to run. However, I was linking with
-lwidget_gtk for a reason, so I can call gdk_event_handler_set
(handle_gdk_event, NULL, NULL). Now the problem remains that I have to ensure
that I call this function after initing XPCOM.
Comment 3•24 years ago
|
||
We use the gdk_event_handler_set method to specify that all callbacks should be
handled by the handle_gdk_event function. However, we dont override this
function anywhere. What happens if we dont make this gdk_event_handler_set
function call. Maybe the gtk window uses this handle_gdk_event function as
default for all callbacks. It's worth a try.
_Ashu
What happens, and I don't know if this was caused by commenting out the
gdk_set_event_handler call, is that links cannot be traversed. It's possible
that this is caused by the lack of a gdk_set_event_handler.
Comment 5•24 years ago
|
||
> Now the problem remains that I have to ensure
> that I call this function after initing XPCOM.
From my prospective you can call the function anytime.
Restriction is that no components might be linked with your library.
dlopen and dlsym may be used for getting access to the function of the library.
Comment 6•24 years ago
|
||
Why does linking with lwidget_gtk cause problems in loading the factory? Is
this a known bug?
Assignee | ||
Updated•23 years ago
|
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 9•23 years ago
|
||
ed, please reopen if this is still a problem.
You need to log in
before you can comment on or make changes to this bug.
Description
•