Closed
Bug 454991
Opened 16 years ago
Closed 9 years ago
GetDocument function returns 0x80004005 error code
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: freshhotnews, Unassigned)
Details
(Keywords: regression)
Attachments
(2 files)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 (.NET CLR 3.5.30729) Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 (.NET CLR 3.5.30729) CString CSomeClass::GetURL( nsCOMPtr win ) { CString url; //get main URL nsCOMPtr doc; nsAString name; nsresult res/* = win->GetName( name )*/; res = win->GetDocument( getter_AddRefs( doc ) ); // 0x80004005 error here ///....... } Reproducible: Always Steps to Reproduce: 1. 2. 3.
Comment 1•16 years ago
|
||
Can you attach a testcase?
Reporter | ||
Comment 2•16 years ago
|
||
I can't. I've faced with the problem while porting rather big application from ff2 to ff3. So I can't attach full source codes. I get content window as follows: //get the current content window nsCOMPtr<nsIDOMWindow> CSomeClass::GetContentWindow() { nsCOMPtr<nsIDOMWindow> win; nsCOMPtr<nsIDOMAbstractView> mainview; nsCOMPtr<nsIDOMDocumentView> docview( do_QueryInterface( mXULDoc ) ); if (!docview) return win; docview->GetDefaultView( getter_AddRefs( mainview ) ); if (!mainview) return win; /* FF2 */ nsCOMPtr<nsIDOMWindowInternal> wininternal( do_QueryInterface( mainview ) ); if (!wininternal) { /* FF3 */ mainview->QueryInterface(NS_IDOMWINDOWINTERNAL_FF3_IID, getter_AddRefs(wininternal)); if (!wininternal) { return win; } } nsCOMPtr<nsIDOMWindow> content; wininternal->GetContent( getter_AddRefs( content ) ); if (!content) return win; return content; } And then I call the GetURL method (from the original post) with the "content" passed as parameter. Note, if I call the GetDocument directly from the GetContentWindow (right before the "return content;" line) I get the same error. Any thoughts, please? Many thanks in advance.
Updated•16 years ago
|
Component: General → DOM: Core & HTML
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → 1.9.0 Branch
Reporter | ||
Comment 3•16 years ago
|
||
Hello?
Reporter | ||
Comment 4•16 years ago
|
||
Any comment, please.
Comment 5•16 years ago
|
||
The problem is really that there is no testcase. This is necessary to identify and to fix the problem: http://developer.mozilla.org/en/Reducing_testcases Did you say that it worked correctly in Firefox 2?
Updated•16 years ago
|
Keywords: testcase-wanted
Reporter | ||
Comment 6•16 years ago
|
||
Yes. It works ok in FF2.
Updated•16 years ago
|
Keywords: regression
Comment 7•16 years ago
|
||
So... nsGlobalWindow::GetDocument never returns anything but NS_OK. You're getting NS_ERROR_FAILURE. So whatever method you're calling it's definitely not nsGlobalWindow::GetDocument. Have you tried stepping through your code in a debugger and seeing what happens when you step into that GetDocument() call?
Reporter | ||
Comment 8•16 years ago
|
||
Here is a test code that recreates the problem. Take a look, please. http://rapidshare.com/files/158343574/GetDocumentTest.rar.html
Comment 9•16 years ago
|
||
I don't have a Windows build setup offhand, unfortunately... Reading through the code it looks like it should work, but have you tried using a debugger as suggested in comment 7?
Reporter | ||
Comment 10•16 years ago
|
||
I don't know how to run the xpi plugin under debugger. Could you explain, how to do that, please?
Comment 11•16 years ago
|
||
Run Firefox under a debugger (documented on developer.mozilla.org, I'm pretty sure) and then breakpoint in your code?
Comment 12•16 years ago
|
||
I really can't say more than that about Windows; haven't used it in a long time...
Reporter | ||
Comment 13•16 years ago
|
||
btw I use 3.0rc3 version. is it ok?
Reporter | ||
Comment 14•16 years ago
|
||
Can this help?
Comment 15•16 years ago
|
||
Are you running against an existing xul.dll, then, not compiling your own?
Reporter | ||
Comment 16•16 years ago
|
||
yep. I'm loading release (v3.0.3) version into debugger. but debugger is configured to load symbols from the mozilla server.
Reporter | ||
Comment 17•16 years ago
|
||
As you can see, some symbols are being loaded, but not for the xul.dll
Comment 18•16 years ago
|
||
Something is going wrong with that, then... timeless, any idea what's up? Getting symbols there should make this pretty simple.
Reporter | ||
Comment 19•16 years ago
|
||
And from where I can get the symbols? It will take much time for me to build the FF3 from the ground.
Comment 20•16 years ago
|
||
(In reply to comment #14) > Created an attachment (id=345511) [details] > The error occures in the xul.dll > > Can this help? Not sure if this is any help, but that code is the nsHistory::GetLength function.
Comment 21•16 years ago
|
||
i don't really use visual studio's debugger much (i did w/ bernd in barcelona on Sunday, it's definitely not a bad debugger, but I'm quite happy w/o it). http://developer.mozilla.org/en/docs/How_to_get_a_stacktrace_with_WinDbg is my friend. !sym noisy .reload /f can explain why symbols aren't happy if they happen to fail. If comment 20 is correct, then there's not much interesting to see, http://mxr.mozilla.org/mozilla-central/source/dom/src/base/nsHistory.cpp#92 someone should breakpoint nsHistory::GetSessionHistoryFromDocShell in windbg, that's bp xul!nsHistory::GetSessionHistoryFromDocShell
Reporter | ||
Comment 22•16 years ago
|
||
Ok. What is the next step then?
Reporter | ||
Comment 23•16 years ago
|
||
Hello? Any idea how to proceed?
Comment 24•16 years ago
|
||
You could try windbg as comment 21 suggests. But in general, it sounds like you're getting your vtables wrong somehow and calling into random code when you call GetDocument(). It's really sort of up to you to use your debugger to figure out what happens to cause that.
Comment 25•9 years ago
|
||
Closing this as incomplete due to inactivity and the lack of a reproducible test case. Feel free to reopen the bug if there's a testcase that still reproduces the issue.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Keywords: testcase-wanted
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•