Closed Bug 1640703 Opened 4 years ago Closed 4 years ago

|UnicodeDecodeError: 'ascii' codec can't decode byte| when running |mach jstests|

Categories

(Core :: JavaScript Engine, defect)

defect

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox-esr68 --- unaffected
firefox76 --- unaffected
firefox77 --- unaffected
firefox78 --- fixed

People

(Reporter: mgaudet, Assigned: rstewart)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

./mach jstests 
[   17|    0|    0|    0]   0% >                                       |  13.9sTraceback (most recent call last):
  File "/home/matthew/unified/js/src/tests/jstests.py", line 676, in <module>
    sys.exit(main())
  File "/home/matthew/unified/js/src/tests/jstests.py", line 624, in main
    results.push(out)
  File "/home/matthew/unified/js/src/tests/lib/results.py", line 247, in push
    result = TestResult.from_output(output)
  File "/home/matthew/unified/js/src/tests/lib/results.py", line 176, in from_output
    if test.error not in err:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 222: ordinal not in range(128)

Doing a little tweaking, and printing err, and we see the error triggers here:

[   18|    0|    0|    0]   0% >                                       |  14.0s/home/matthew/unified/js/src/tests/test262/language/identifiers/vertical-tilde-start.js:17:4 SyntaxError: illegal character:
/home/matthew/unified/js/src/tests/test262/language/identifiers/vertical-tilde-start.js:17:4 var ⸯ; // U+2E2F
/home/matthew/unified/js/src/tests/test262/language/identifiers/vertical-tilde-start.js:17:4 ....^

Where presumably U+2E2F is what's making python fall over.

For further debugging, I put

        print(err)
        print(type(err))
        print(type(test.error))
        sys.stdout.flush()

just above the

        if test.error is not None:

That prints out pretty much the same thing in the good and bad cases:

[   17|    0|    0|    0]   0% >                                       |  14.0s/home/matthew/unified/js/src/tests/test262/language/identifiers/val-with-via-escape-hex.js:17:4 SyntaxError: with is an invalid identifier:
/home/matthew/unified/js/src/tests/test262/language/identifiers/val-with-via-escape-hex.js:17:4 var \u{77}ith = 123;
/home/matthew/unified/js/src/tests/test262/language/identifiers/val-with-via-escape-hex.js:17:4 ....^

<type 'str'>
<type 'unicode'>
[   18|    0|    0|    0]   0% >                                       |  14.0s/home/matthew/unified/js/src/tests/test262/language/identifiers/vertical-tilde-start.js:17:4 SyntaxError: illegal character:
/home/matthew/unified/js/src/tests/test262/language/identifiers/vertical-tilde-start.js:17:4 var ⸯ; // U+2E2F
/home/matthew/unified/js/src/tests/test262/language/identifiers/vertical-tilde-start.js:17:4 ....^

<type 'str'>
<type 'unicode'>

Here's where my python foo runs aground.

Ran hg bisect to find the regressing changeset:

The first bad revision is:
changeset:   593977:b79ab69854b0
user:        Ricky Stewart <rstewart@mozilla.com>
date:        Tue May 05 20:32:12 2020 +0000
summary:     Bug 1632916 - Run JS/web-platform/ipdl build machinery in Python 3 r=jgraham,nika,glandium
Regressed by: 1632916
Has Regression Range: --- → yes

This patch gets me back in action, but definitely seems wrong

diff --git a/js/src/tests/lib/results.py b/js/src/tests/lib/results.py
--- a/js/src/tests/lib/results.py
+++ b/js/src/tests/lib/results.py
@@ -173,7 +173,7 @@ class TestResult:
 
         if test.error is not None:
             expected_rcs.append(3)
-            if test.error not in err:
+            if test.error not in unicode(err, 'utf-8'):
                 failures += 1
                 results.append((cls.FAIL, "Expected uncaught error: {}".format(test.error)))

Ricky, not sure what to do about this.

For me this reproduces easily enough on a clobber build with the following mozconfig:

ac_add_options --enable-application=js

ac_add_options --enable-optimize
ac_add_options --enable-debug
#ac_add_options --disable-debug

# ac_add_options --enable-smoosh
ac_add_options --enable-tests
ac_add_options --enable-binast

# Dump opt builds into another dir.
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-opt-shell-@CONFIG_GUESS@
Flags: needinfo?(rstewart)

Bugbug thinks this bug is a defect, but please change it back in case of error.

Type: task → defect

Set release status flags based on info from the regressing bug 1632916

Bug 1632916 regressed mach jstests, which still run under Python 2 (unlike the in-build jstests, which use Python 3). Here we call into different logic for Python 2 and 3 to make sure there aren't type mismatches down the line.

Assignee: nobody → rstewart
Status: NEW → ASSIGNED
Flags: needinfo?(rstewart)
Pushed by rstewart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ae53dbf57eeb Fix Python 2/3 incompatibility when running `mach jstests` r=jgraham
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: