Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionRichard W.M. Jones
2015-05-28 17:07:01 UTC
Description of problem:
The OCaml compiler on ppc64le miscompiles calls from OCaml to C which
have more than 8 parameters.
The example program prints:
$ ./test
-1
-1 -2
-1 -2 -3
-1 -2 -3 -4
-1 -2 -3 -4 -5
-1 -2 -3 -4 -5 -6
-1 -2 -3 -4 -5 -6 -7
-1 -2 -3 -4 -5 -6 -7 -8
-1 -2 -3 -4 -5 -6 -7 -8 0
-1 -2 -3 -4 -5 -6 -7 -8 0 70366595657576
^^^^^
note incorrect values here
Version-Release number of selected component (if applicable):
ocaml-4.01.0-22.4.ael7b.ppc64le
How reproducible:
100%
Steps to Reproduce:
1. Save the attached files into a directory.
2. Type 'make'
3. Type './test'
Comment 1Richard W.M. Jones
2015-05-28 17:07:54 UTC
Comment 6Richard W.M. Jones
2015-05-28 18:06:59 UTC
The bug does NOT occur on ppc64 big endian
(I tested ocaml-4.01.0-22.2.el7.ppc64).
Comment 7Richard W.M. Jones
2015-05-28 18:11:07 UTC
Created attachment 1031359[details]
Makefile
Improved Makefile - adds a 'make clean' rule and enables -g option.
Comment 8Richard W.M. Jones
2015-05-28 18:11:58 UTC
Stack trace for a call with 10 parameters:
#0 args10 (i1v=268699820, i2v=268699844, i3v=268699868, i4v=268699892,
i5v=268699916, i6v=268699940, i7v=268699964, i8v=268699988,
i9v=70368744172768, i10v=70367536164736) at print.c:179
#1 0x000000001001c734 in caml_c_call ()
#2 0x0000000010002b0c in camlCall__entry ()
#3 0x00000000100022f0 in caml_program ()
#4 0x000000001001c8b8 in caml_start_program ()
#5 0x000000001001cff8 in caml_main ()
#6 0x000000001000209c in main ()
Comment 9Richard W.M. Jones
2015-05-28 20:13:08 UTC
Fix is:
diff --git a/asmcomp/power64le/proc.ml b/asmcomp/power64le/proc.ml
index 9b98577..30d4cdc 100644
--- a/asmcomp/power64le/proc.ml
+++ b/asmcomp/power64le/proc.ml
@@ -188,7 +188,7 @@ let poweropen_external_conventions first_int last_int
let loc_external_arguments =
match Config.system with
| "rhapsody" -> poweropen_external_conventions 0 7 100 112
- | "elf" | "bsd" -> calling_conventions 0 7 100 107 outgoing 48
+ | "elf" | "bsd" -> calling_conventions 0 7 100 107 outgoing 32
| _ -> assert false
let extcall_use_push = false
Comment 10Richard W.M. Jones
2015-05-28 20:22:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://rhn.redhat.com/errata/RHBA-2015-2185.html
Description of problem: The OCaml compiler on ppc64le miscompiles calls from OCaml to C which have more than 8 parameters. The example program prints: $ ./test -1 -1 -2 -1 -2 -3 -1 -2 -3 -4 -1 -2 -3 -4 -5 -1 -2 -3 -4 -5 -6 -1 -2 -3 -4 -5 -6 -7 -1 -2 -3 -4 -5 -6 -7 -8 -1 -2 -3 -4 -5 -6 -7 -8 0 -1 -2 -3 -4 -5 -6 -7 -8 0 70366595657576 ^^^^^ note incorrect values here Version-Release number of selected component (if applicable): ocaml-4.01.0-22.4.ael7b.ppc64le How reproducible: 100% Steps to Reproduce: 1. Save the attached files into a directory. 2. Type 'make' 3. Type './test'