Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numberSeparators.test fails on armhf #662

Closed
bryceharrington opened this issue May 12, 2020 · 2 comments
Closed

numberSeparators.test fails on armhf #662

bryceharrington opened this issue May 12, 2020 · 2 comments

Comments

@bryceharrington
Copy link

bryceharrington commented May 12, 2020

In the Ubuntu CI, the new php-parser 4.4.0 fails on one of the newly added test cases, only on armhf, with this error:

1) PhpParser\CodeParsingTest::testParse with data set "tmp/autopkgtest.4zawvj/build.7wd/src/test/code/parser/scalar/numberSeparators.test#0" ('Different integer syntaxes (/....test)', '<?php\n\n6.674_083e-11;\n299_...n1e_2;', 'Syntax error, unexpected T_ST...  )\n)', null)
Different integer syntaxes (/tmp/autopkgtest.4zawvj/build.7wd/src/test/code/parser/scalar/numberSeparators.test)
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
         )
     )
     2: Stmt_Expression(
-        expr: Scalar_LNumber(
-            value: 3405705229
+        expr: Scalar_DNumber(
+            value: 0
         )
     )

I'm guessing this is checking range on long data types, maybe a signed/unsigned mismatch? For ARM, it looks like a signed long is 32 bits word-aligned, or -2,147,483,648 to 2,147,483,647, and guessing 3,405,705,229 is getting returned as 0 as it's out of range?

https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac/autopkgtest-groovy/groovy/armhf/p/php-parser/20200501_165040_5a5c8@/log.gz

Downstream bug: https://bugs.launchpad.net/ubuntu/+source/php-parser/+bug/1878102

@bryceharrington
Copy link
Author

bryceharrington commented May 12, 2020

There is a similar, related test failure:

2) PhpParser\Lexer\EmulativeTest::testLexNewFeatures with data set #20 ('0xCAFE_F00D', array(array(312, '0xCAFE_F00D')))
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
 Array &0 (
     0 => Array &1 (
- 0 => 312
+ 0 => 313
         1 => '0xCAFE_F00D'
     )
 )

'0xCAFE_F00D' is hexadecimal for 3405705229, which is the same number as in the syntax issue above. The test is receiving this as a T_DNUMBER (i.e. type number 313) rather than as a T_LNUMBER (type 312) as defined in Tokens.php.

@nikic
Copy link
Owner

nikic commented May 12, 2020

I guess the PHP-Parser tests are not 32-bit compatible. I wonder if it's possible to test 32-bit on Travis...

athos-ribeiro added a commit to athos-ribeiro/PHP-Parser that referenced this issue Nov 12, 2022
* See GH nikic#662 for further reference.
nikic added a commit that referenced this issue Nov 12, 2022
@nikic nikic closed this as completed in e072fd2 Nov 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants