Closed Bug 1257144 Opened 8 years ago Closed 8 years ago

NS_ERROR_UNRECOGNIZED_PATH caused by mixed slashes in reftest addon path.

Categories

(Testing :: Reftest, defect)

Version 3
x86_64
Windows 10
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1257099

People

(Reporter: jkitch, Unassigned)

Details

Attachments

(1 file)

Error running mach:

    ['reftest', 'layout/reftests/mathml/']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

JavascriptException: JavascriptException: [Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsILocalFile.initWithPath]"  nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)"  location: "JS frame :: addons.py :: __marionetteFunc :: line 18"  data: no]
stacktrace:
        execute_async_script @addons.py, line 89
        inline javascript, line 18
        src: "              let file = new FileUtils.File(arguments[0]);"
        Stack:
        __marionetteFunc@addons.py:18:26
        @addons.py:33:15
        GeckoDriver.prototype.executeScriptInSandbox@chrome://marionette/content/driver.js:832:13
        GeckoDriver.prototype.executeWithCallback/res<@chrome://marionette/content/driver.js:1156:7
        GeckoDriver.prototype.executeWithCallback@chrome://marionette/content/driver.js:1072:19
        TaskImpl_run@resource://gre/modules/Task.jsm:319:40
        TaskImpl@resource://gre/modules/Task.jsm:280:3
        createAsyncFunction/asyncFunction@resource://gre/modules/Task.jsm:254:14
        Task_spawn@resource://gre/modules/Task.jsm:168:12
        TaskImpl_handleResultValue@resource://gre/modules/Task.jsm:388:16
        TaskImpl_run@resource://gre/modules/Task.jsm:327:13
        TaskImpl@resource://gre/modules/Task.jsm:280:3
        createAsyncFunction/asyncFunction@resource://gre/modules/Task.jsm:254:14
        Task_spawn@resource://gre/modules/Task.jsm:168:12
        Dispatcher.prototype.execute@chrome://marionette/content/dispatcher.js:120:13
        Dispatcher.prototype.onPacket@chrome://marionette/content/dispatcher.js:91:5
        DebuggerTransport.prototype._onJSONObjectReady/<@chrome://marionette/content/server.js -> resource://devtools/shared/transport/transport.js:479:9
        exports.makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:101:14
        exports.makeInfallible/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/ThreadSafeDevToolsUtils.js:101:14

The path in question is:
L"c:/mozilla-central/obj-x86_64-pc-mingw32\\_tests\\reftest\\reftest"

It fails as it has forward slashes.  
https://dxr.mozilla.org/mozilla-central/source/xpcom/io/nsLocalFileWin.cpp#1221

Assumes the fix from bug 1256527 has been applied
Isn't this a problem with the FileUtils.File ctor and nsILocalFile.initWithPath?

Marionette traps errors thrown when scripts are evaluated in the sandbox and serialises these as JavascriptExecptions in the Python client.  The wrapped errors appears to be an XPCOM exception in nsILocalFile.initWithPath.
Right.  Further debugging has revealed it is fallout from bug 1253203.

https://hg.mozilla.org/mozilla-central/annotate/7773387a9a2f1fd10e4424ea923c6185063f620b/layout/tools/reftest/reftestcommandline.py#l281

self.build_obj.topobjdir has forward slashes (intentional as of bug 1253203), and os.path.join leaves them unaltered.

This is then ultimately propagated unaltered to

https://hg.mozilla.org/mozilla-central/annotate/7773387a9a2f1fd10e4424ea923c6185063f620b/testing/marionette/client/marionette_driver/addons.py#l74

which calls the FileUtils.File ctor and causes the error

Normalising the path is sufficient to resolve this error.
Attachment #8731204 - Flags: review?(jmaher)
Assignee: nobody → jkitch.bug
Summary: NS_ERROR_UNRECOGNIZED_PATH caused by forward slashes in Marionette argument → NS_ERROR_UNRECOGNIZED_PATH caused by mixed slashes in reftest addon path.
Comment on attachment 8731204 [details] [diff] [review]
Normalise the addon path

Review of attachment 8731204 [details] [diff] [review]:
-----------------------------------------------------------------

I just reviewed an almost identical patch which landed not too long ago:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ce9c0d631b58

please mark this bug as a duplicate unless you feel there is another issue I am overlooking!
Attachment #8731204 - Flags: review?(jmaher)
No, this is the same issue.
Assignee: jkitch.bug → nobody
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: