Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1507518 - thrift FTBFS on s390x
Summary: thrift FTBFS on s390x
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: thrift
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Christopher Tubbs
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: ZedoraTracker 1495146
TreeView+ depends on / blocked
 
Reported: 2017-10-30 13:32 UTC by Honza Horak
Modified: 2018-01-02 16:53 UTC (History)
5 users (show)

Fixed In Version: thrift-0.10.0-8.fc26 thrift-0.10.0-8.fc27
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-02 16:26:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
buildroot diff (9.84 KB, text/plain)
2017-11-07 09:57 UTC, Dan Horák
no flags Details
Proposed patch (863 bytes, patch)
2017-12-09 21:36 UTC, Honza Horak
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Apache JIRA THRIFT-4380 0 None None None 2017-11-07 11:03:14 UTC

Description Honza Horak 2017-10-30 13:32:27 UTC
Description of problem:
thrift package fails to build on s390x:
https://koji.fedoraproject.org/koji/taskinfo?taskID=22799147

using F27 branch and buildroot.

Version-Release number of selected component (if applicable):
thrift-0.10.0-7.fc27

Comment 1 Honza Horak 2017-10-30 13:32:50 UTC
This failure blocks cassandra module building.

Comment 2 Honza Horak 2017-11-07 08:59:40 UTC
For the case the build.log is not kept, this is the error I see:
Buildfile: /builddir/build/BUILD/thrift-0.10.0/tutorial/java/build.xml
init:
    [mkdir] Created dir: /builddir/build/BUILD/thrift-0.10.0/tutorial/java/build
    [mkdir] Created dir: /builddir/build/BUILD/thrift-0.10.0/tutorial/java/build/log
generate:
compile:
    [javac] Compiling 7 source files to /builddir/build/BUILD/thrift-0.10.0/tutorial/java/build
    [javac] /builddir/build/BUILD/thrift-0.10.0/tutorial/java/gen-java/tutorial/Work.java:157: error: no suitable method found for copyBinary(Operation)
    [javac]       this.op = org.apache.thrift.TBaseHelper.copyBinary(other.op);
    [javac]                                              ^
    [javac]     method TBaseHelper.copyBinary(ByteBuffer) is not applicable
    [javac]       (argument mismatch; Operation cannot be converted to ByteBuffer)
    [javac]     method TBaseHelper.copyBinary(byte[]) is not applicable
    [javac]       (argument mismatch; Operation cannot be converted to byte[])
    [javac] 1 error

Comment 3 Dan Horák 2017-11-07 09:57:25 UTC
Created attachment 1348896 [details]
buildroot diff

Adding buildroot diff between the last successful thrift build (https://koji.fedoraproject.org/koji/taskinfo?taskID=21734894) and the failing one (https://koji.fedoraproject.org/koji/taskinfo?taskID=22799153)

Comment 4 Christopher Tubbs 2017-11-07 10:48:25 UTC
I have no idea what's wrong on s390x arch. The generated code seems to be different there, but I'm not sure why. The line in x86_64 is simply:

  this.op = other.op;

The problem appears to be on line 4662 in:
./compiler/cpp/src/thrift/generate/t_java_generator.cc

I'm not certain, but I believe the cast to `(t_base_type*)` is not guarded by a check of `type->is_base_type()`, so it's somehow casting an enum type (Operation) to something where `is_binary()` is true only on s390x arch. Enums aren't binary types, so it should go to the else, but it's not.

I don't know if another `is_base_type()` check is appropriate, or a `&& !type->is_enum()`.

Should probably investigate this bug with upstream and patch accordingly.

I'm clearing the NEEDINFO flag, since no information was requested from any maintainer. However, I'm happy to help get the fix in place, if somebody can get upstream to take a look and confirm the bug and its fix.

Comment 5 Christopher Tubbs 2017-11-07 11:03:14 UTC
It could be a larger issue on the s390x arch, if `is_binary()` is expected to return false for enums, but is incorrectly returning true. Could be a bug in a dependent library? Maybe boost? I don't do much C++ programming, so I'm close to my limit in my ability to debug. Really need upstream to take a look.

I filed an upstream bug at https://issues.apache.org/jira/browse/THRIFT-4380

Comment 6 Dan Horák 2017-11-07 14:32:15 UTC
Let me know if someone needs access to a Fedora s390x system for further debugging.

Comment 7 Christopher Tubbs 2017-11-16 22:32:39 UTC
I still haven't heard anything from upstream. If anybody else can suggest a path forward, I would appreciate it.

Comment 8 Honza Horak 2017-12-09 21:36:30 UTC
Created attachment 1365446 [details]
Proposed patch

Hey, according to a scratch build the attached patch fixes the issue. I think this was more luck than anything else, since I don't really understand the code, but it looks like a copy&paste error. Anyway, please, take a look and possibly apply.

Comment 9 Christopher Tubbs 2017-12-12 21:35:28 UTC
(In reply to Honza Horak from comment #8)
> Created attachment 1365446 [details]
> Proposed patch
> 
> Hey, according to a scratch build the attached patch fixes the issue. I
> think this was more luck than anything else, since I don't really understand
> the code, but it looks like a copy&paste error. Anyway, please, take a look
> and possibly apply.

Awesome. Thanks. Have you submitted (or do you mind if I do) the patch to upstream Thrift?

https://issues.apache.org/jira/browse/THRIFT-4380

Comment 10 Honza Horak 2017-12-13 12:24:56 UTC
(In reply to Christopher Tubbs from comment #9)
> Awesome. Thanks. Have you submitted (or do you mind if I do) the patch to
> upstream Thrift?
> 
> https://issues.apache.org/jira/browse/THRIFT-4380

I did not actually. Since I'm not really a Java developer, I'd prefer if someone else who understands Java more to submits it to upstream, for the case there are some more questions.. Is it possible that you could submit it?

Comment 11 Christopher Tubbs 2017-12-22 04:27:55 UTC
I never got a response from upstream, but they seem to have patched it in the latest version. I'm testing a backport of the fix to 0.10.0, because I'm not quite ready to test the latest version, 0.11.0.

Comment 12 Fedora Update System 2017-12-22 19:38:38 UTC
thrift-0.10.0-8.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-4184b7b2d7

Comment 13 Fedora Update System 2017-12-22 19:38:47 UTC
thrift-0.10.0-8.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-037fb08938

Comment 14 Fedora Update System 2017-12-23 19:13:58 UTC
thrift-0.10.0-8.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-037fb08938

Comment 15 Fedora Update System 2017-12-23 19:44:08 UTC
thrift-0.10.0-8.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-4184b7b2d7

Comment 16 Fedora Update System 2018-01-02 16:26:28 UTC
thrift-0.10.0-8.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2018-01-02 16:53:36 UTC
thrift-0.10.0-8.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.