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

Failure of tests/prim-bigstring/{big,}string.ml on big-endian architectures #6630

Closed
vicuna opened this issue Oct 27, 2014 · 5 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link

commented Oct 27, 2014

Original bug ID: 6630
Reporter: @glondu
Assigned to: @mshinwell
Status: closed (set by @xavierleroy on 2016-12-07T10:49:23Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 4.02.1
Target version: 4.02.2+dev / +rc1
Fixed in version: 4.02.2+dev / +rc1
Category: ~DO NOT USE (was: OCaml general)
Tags: patch
Monitored by: @gasche @yallop

Bug description

The aforementioned tests fail (at least) on powerpc and s390x (which are big-endian). The diff makes me think about an endianness issue.

Additional information

$ wdiff testsuite/tests/prim-bigstring/string_access.{reference,result}
1234 [-12-] {+3400+} 0
fedc [-fe-] {+dc00+} 0
12345678 [-123456 1234-] {+34567800 56780000+}
fedcba09 [-fedcba fedc-] {+dcba0900 ba090000+}
1234567890abcdef [-1234567890abcd 1234567890ab-] {+34567890abcdef00 567890abcdef0000+}
fedcba0987654321 [-fedcba09876543 fedcba098765-] {+dcba098765432100 ba09876543210000+}
$ wdiff testsuite/tests/prim-bigstring/bigstring_access.{reference,result}
1234 [-12-] {+3400+} 0
fedc [-fe-] {+dc00+} 0
12345678 [-123456 1234-] {+34567800 56780000+}
fedcba09 [-fedcba fedc-] {+dcba0900 ba090000+}
1234567890abcdef [-1234567890abcd 1234567890ab-] {+34567890abcdef00 567890abcdef0000+}
fedcba0987654321 [-fedcba09876543 fedcba098765-] {+dcba098765432100 ba09876543210000+}

File attachments

@vicuna

This comment has been minimized.

Copy link
Author

commented Oct 27, 2014

Comment author: @glondu

After a deeper look, the testcase is faulty here: it assumes the caml_*string_getN primitives are portable. Looking at their C implementation, they are not.

@vicuna

This comment has been minimized.

Copy link
Author

commented Feb 24, 2015

Comment author: cwsolee

I find the same problem with RHEL 7 on zLinux, roughly when will this be resolved? Or if dev branch has the fix, I could give it a try too.

@vicuna

This comment has been minimized.

Copy link
Author

commented May 7, 2015

Comment author: @chambart

I uploaded a patch, but couldn't test it on big-endian architectures.

@vicuna

This comment has been minimized.

Copy link
Author

commented May 7, 2015

Comment author: @mshinwell

I will try to do it

@vicuna

This comment has been minimized.

Copy link
Author

commented May 19, 2015

Comment author: @mshinwell

I agree that the testsuite seems at fault, since it's the one doing the offsetting into the bigstring.

Tested on a big-endian POWER7 Linux system (which of course is currently only supported by OCaml in a 32-bit environment).

Also tested on x86-64 Linux.

Committed to 4.02.

@vicuna vicuna closed this Dec 7, 2016

@vicuna vicuna added this to the 4.02.2 milestone Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.