Skip to content

Add S390X architecture as a Travis job. #5382

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

Closed
wants to merge 2 commits into from

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Apr 13, 2020

This gives us a way to compile and test a big endian architecture.

@Girgias
Copy link
Member Author

Girgias commented Apr 13, 2020

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Bug #79046: NaN to int cast undefined behavior in exif [ext/exif/tests/bug79046.phpt]
Overflow in float to int cast [ext/exif/tests/float_cast_overflow.phpt]
FFI 040: Support for scalar types [ext/ffi/tests/040.phpt]
Test ResourceBundle array access and count - existing/missing keys [ext/intl/tests/resourcebundle_arrayaccess.phpt]
Test ResourceBundle implements Countable [ext/intl/tests/resourcebundle_countable.phpt]
Test ResourceBundle::__construct() - existing/missing bundles/locales [ext/intl/tests/resourcebundle_create.phpt]
Test ResourceBundle::get() and length() - existing/missing keys [ext/intl/tests/resourcebundle_individual.phpt]
Test ResourceBundle iterator [ext/intl/tests/resourcebundle_iterator.phpt]
Test ResourceBundle::getLocales [ext/intl/tests/resourcebundle_locales.phpt]
Bug #55610: ResourceBundle does not implement Traversable [ext/intl/tests/resourcebundle_traversable.phpt]
function test: nested selects (cursors) [ext/mysqli/tests/067.phpt]
Bug #36745 (LOAD DATA LOCAL INFILE doesn't return correct error message) [ext/mysqli/tests/bug36745.phpt]
mysqli_get_client_stats() [ext/mysqli/tests/mysqli_get_client_stats.phpt]
mysqli_stmt_attr_set() - mysqlnd does not check for invalid codes [ext/mysqli/tests/mysqli_stmt_attr_set.phpt]
MySQL PDO->__construct(), options [ext/pdo_mysql/tests/pdo_mysql___construct_options.phpt]
enable local infile [ext/pdo_mysql/tests/pdo_mysql_local_infile_set_on.phpt]
=====================================================================

The FFI one has been reported already at: https://bugs.php.net/bug.php?id=79472

Intl failures are due to the fact that the constuctor is failing e.g:

========DIFF========
001+ Fatal error: Uncaught IntlException: Constructor failed in /home/travis/build/php/php-src/ext/intl/tests/resourcebundle_countable.php:4
001- bool(true)
002+ Stack trace:
003+ #0 /home/travis/build/php/php-src/ext/intl/tests/resourcebundle_countable.php(4): ResourceBundle->__construct('es', '/home/travis/bu...')
004+ #1 {main}
005+   thrown in /home/travis/build/php/php-src/ext/intl/tests/resourcebundle_countable.php on line 4
========DONE========

The EXIF ones seems to related to overflow behaviour (and some cast with NaN which seem highly surprising)

========DIFF========
020+   float(8.914360180802324E-41)
020-   float(NAN)
024+     float(8.914360180802324E-41)
024-     float(NAN)
========DONE========
FAIL Bug #79046: NaN to int cast undefined behavior in exif [ext/exif/tests/bug79046.phpt] 
========DIFF========
032+     float(2.3510579257887127E-38)
032-     float(-2.5961487387524236E+33)
========DONE========
FAIL Overflow in float to int cast [ext/exif/tests/float_cast_overflow.phpt]

I'm not super sure about the MySQL ones as they are maybe caused because I didn't think about how to set it up.

@guirish
Copy link

guirish commented Apr 14, 2020

@Girgias I have already raised a PR #5380 to resolve MySQL specific TC failures.

@cmb69
Copy link
Member

cmb69 commented Apr 14, 2020

Regarding EXIF issues, see https://bugs.php.net/79336

@vibhutisawant
Copy link
Contributor

Intl failures are due to the fact that the constuctor is failing e.g:


========DIFF========
001+ Fatal error: Uncaught IntlException: Constructor failed in /home/travis/build/php/php-src/ext/intl/tests/resourcebundle_countable.php:4
001- bool(true)
002+ Stack trace:
003+ #0 /home/travis/build/php/php-src/ext/intl/tests/resourcebundle_countable.php(4): ResourceBundle->__construct('es', '/home/travis/bu...')
004+ #1 {main}
005+   thrown in /home/travis/build/php/php-src/ext/intl/tests/resourcebundle_countable.php on line 4
========DONE========

@Girgias The above error is thrown as it fails to create a new Resource bundle Object. The resource file that the TC refers while calling the constructor is generated specifically for little endian arch.

Generate .res files for s390x using following commands:

icupkg -tb ext/intl/tests/_files/resourcebundle/root.res
icupkg -tb ext/intl/tests/_files/resourcebundle/es.res
icupkg -tb ext/intl/tests/_files/resourcebundle/res_index.res

Will it be possible to add the above changes in travis/compile.sh ? Such that it generates .res files for the respective arch.

@Girgias Girgias force-pushed the s390x-travis-job branch 2 times, most recently from 33d1299 to 3c4030b Compare April 14, 2020 20:26
@vibhutisawant
Copy link
Contributor

The EXIF ones seems to related to overflow behaviour (and some cast with NaN which seem highly surprising)

========DIFF========
020+ float(8.914360180802324E-41)
020- float(NAN)
024+ float(8.914360180802324E-41)
024- float(NAN)
========DONE========
FAIL Bug #79046: NaN to int cast undefined behavior in exif [ext/exif/tests/bug79046.phpt]
========DIFF========
032+ float(2.3510579257887127E-38)
032- float(-2.5961487387524236E+33)
========DONE========
FAIL Overflow in float to int cast [ext/exif/tests/float_cast_overflow.phpt]

@Girgias wrt the above EXIF failures,

Following observations were made on Big endian System(s390x):
char is unsigned(0 to 255) on s390x, hence in function static float php_ifd_get_float(char *data) of
php-src/ext/exif/exif.c ,the 3rd byte (data[2]) is referring to -8(Hex:
fffffff8 ),where as its referred to 248 (Hex: f8) on s390x.
Could you please guide us on how can we proceed on this?

@Girgias
Copy link
Member Author

Girgias commented Apr 15, 2020

The EXIF ones seems to related to overflow behaviour (and some cast with NaN which seem highly surprising)
========DIFF========
020+ float(8.914360180802324E-41)
020- float(NAN)
024+ float(8.914360180802324E-41)
024- float(NAN)
========DONE========
FAIL Bug #79046: NaN to int cast undefined behavior in exif [ext/exif/tests/bug79046.phpt]
========DIFF========
032+ float(2.3510579257887127E-38)
032- float(-2.5961487387524236E+33)
========DONE========
FAIL Overflow in float to int cast [ext/exif/tests/float_cast_overflow.phpt]

@Girgias wrt the above EXIF failures,

Following observations were made on Big endian System(s390x):
char is unsigned(0 to 255) on s390x, hence in function static float php_ifd_get_float(char *data) of
php-src/ext/exif/exif.c ,the 3rd byte (data[2]) is referring to -8(Hex:
fffffff8 ),where as its referred to 248 (Hex: f8) on s390x.
Could you please guide us on how can we proceed on this?

I don't really know EXIF, maybe @KalleZ has an idea?

Girgias and others added 2 commits April 16, 2020 11:45
This gives us a way to compile and test a big endian architecture.
@nikic nikic force-pushed the s390x-travis-job branch from 4cbfe91 to e9d8693 Compare April 16, 2020 09:53
@php-pulls php-pulls closed this in 850feff Apr 16, 2020
@nikic
Copy link
Member

nikic commented Apr 16, 2020

I've fixed the exif issue and applied this change.

@nikic
Copy link
Member

nikic commented Apr 16, 2020

To reduce queue times for Travis, we might want to kill one of the x86_64 jobs, as we don't really need them.

@vibhutisawant
Copy link
Contributor

@nikic Thanks for the fix.

@Girgias Girgias deleted the s390x-travis-job branch April 16, 2020 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants