XPath evaluate() synchronization problem - returns no result on XML file if not stopped by breakpoint




9 years ago
5 years ago


(Reporter: brille1, Unassigned)


Windows 7

Firefox Tracking Flags

(Not tracked)



(1 attachment)



9 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2) Gecko/20100115 Firefox/3.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2) Gecko/20100115 Firefox/3.6

This bug might be caused by some internal synchronization issue:

If evalute() is called on an XML document, it *never* returns any nodes - except: when a breakpoint is set to the evaluate() function call in Firebug (1.5.3).

* When program execution hits the breakpoint and the user hits [F8] to continue execution, evaluate() returns a valid result.

* As soon as the breakpoint is removed and program execution is performed without, no nodes are found.

I have created a small test case. Please find the files attached to this bug.

Reproducible: Always

Steps to Reproduce:

1.  Open "XPathTest.html"

2.  Open JavaScript console
    (It should display an uncaught exception.)

3.  Open Firebug, select "Script" tab

4.  Within the "Script" tab, choose the file
    "XPathTest.js" and search for line #8

5.  Set a breakpoint to line #8
    (which is the line containing the evaluate() call)

6.  Reload the page [F5]

7.  When the breakpoint is hit, press [F8] to continue

=>  The alert message box is displayed,
    showing the number of found nodes.

Actual Results:  

see above.

Expected Results:  

XPath should always return a valid result.

Comment 1

9 years ago
Created attachment 436553 [details]
Test case containing HTML/JavaScript/XML files to reproduce the problem.


9 years ago
Summary: XPath evaluate() synchronization problem - returns no result if not stopped by breakpoint → XPath evaluate() synchronization problem - returns no result on XML file if not stopped by breakpoint

Comment 2

9 years ago
The attachment also contains a series of screenshot demonstrating the problem.

Comment 3

9 years ago
Raised to major because there is no workaround.
Severity: normal → major
Reporter, are you still seeing this issue with Firefox 3.6.13 or later in safe mode? If not, please close. These links can help you in your testing.

You can also try to reproduce in Firefox 4 Beta 8 or later, there are many improvements in the new version, http://www.mozilla.com/en-US/firefox/all-beta.html
Whiteboard: [CLOSEME 2011-1-30]

Comment 5

8 years ago
I would prefer if _you_ would try to not reproduce the problem in newer versions.

I'm working with my PC and I don't want to install different Beta versions myself.

Shouldn't that be your task?
No reply, INCOMPLETE. Please retest with Firefox 3.6.13 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Last Resolved: 8 years ago
Resolution: --- → INCOMPLETE

Comment 7

8 years ago
Yepp, FF 3.6.13 still shows the same error.

Did you try to open the attachment enclosed with this issue?
Resolution: INCOMPLETE → ---
Axel, can you please retest with Firefox 4 in a fresh profile?
Whiteboard: [CLOSEME 2011-1-30]
Version: unspecified → 3.6 Branch

Comment 9

8 years ago
Hi Tyler,

I just did using 4.0. The problem unfortunately still exists.

Comment 10

8 years ago
This is the exception that has been thrown:

Fehler: uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMXPathEvaluator.evaluate]"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame :: file:///C:/Temp/xxx/XPathTest.js :: evaluate :: line 12"  data: no]
Version: 3.6 Branch → 4.0 Branch

Comment 11

7 years ago
Are there any further findings yet?

Comment 12

6 years ago
Problem still exists with today's FF version (17).

Comment 13

5 years ago
Issue still reproducible on:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0

(I used the DevTools Debugger instead of installing Firebug).
Component: General → General
Ever confirmed: true
Product: Firefox → Core
Version: 4.0 Branch → Trunk
The testcase basically looks like this:

  xDoc.load("jQuery API.xml");

but load() does an _async_ load by default.  So this script is doing the evaluate() call before the XML has actually loaded.

If you breakpoing in evaluate(), then while you're waiting at the breakpoint the XML finishes loading.  So then when you continue the XML is there and evaluate() finds things.
Last Resolved: 8 years ago5 years ago
Resolution: --- → INVALID

Comment 15

5 years ago
I see... Thank you for evaluating this issue.

So the solution would be to add an onload event handler to xDoc?
You need to log in before you can comment on or make changes to this bug.