Skip to content

[Regression 0.17.2 -> 0.18] Turbine failure  #6456

Closed

Description

@ittaiz

Description of the problem / feature request:

Upgrading from 0.17.2 to 0.18 we suddenly see turbine failures

(17:38:03) ERROR: /workspace/...-hjar.jar: Compiling Java headers ...-hjar.jar (11 files) failed (Exit 1)
An exception has occurred in turbine.
java.lang.AssertionError: VOID_TY_SIG
	at com.google.turbine.binder.bytecode.BytecodeBinder.bindTy(BytecodeBinder.java:89)
	at com.google.turbine.binder.bytecode.BytecodeBoundClass.bindMethod(BytecodeBoundClass.java:381)
	at com.google.turbine.binder.bytecode.BytecodeBoundClass.access$600(BytecodeBoundClass.java:66)
	at com.google.turbine.binder.bytecode.BytecodeBoundClass$13.get(BytecodeBoundClass.java:365)
	at com.google.turbine.binder.bytecode.BytecodeBoundClass$13.get(BytecodeBoundClass.java:356)
	at com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:166)
	at com.google.turbine.binder.bytecode.BytecodeBoundClass.methods(BytecodeBoundClass.java:406)
	at com.google.turbine.binder.ConstEvaluator.evaluateAnnotation(ConstEvaluator.java:912)
	at com.google.turbine.binder.ConstEvaluator.evaluateAnnotations(ConstEvaluator.java:901)
	at com.google.turbine.binder.ConstBinder.bindMethod(ConstBinder.java:136)
	at com.google.turbine.binder.ConstBinder.bindMethods(ConstBinder.java:115)
	at com.google.turbine.binder.ConstBinder.bind(ConstBinder.java:92)
	at com.google.turbine.binder.Binder.constants(Binder.java:333)
	at com.google.turbine.binder.Binder.bind(Binder.java:106)
	at com.google.turbine.main.Main.compile(Main.java:97)
	at com.google.devtools.build.java.turbine.Turbine.compile(Turbine.java:76)
	at com.google.devtools.build.java.turbine.Turbine.compile(Turbine.java:69)
	at com.google.devtools.build.java.turbine.Turbine.main(Turbine.java:46)

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

We don't have a repro yet

What operating system are you running Bazel on?

linux (gcb/rbe)

What's the output of bazel info release?

0.18.0

Activity

  1. laurentlb commented on Oct 21, 2018

    @laurentlb
    Contributor
  2. added
    P0
    on Oct 21, 2018
  3. cushon commented on Oct 21, 2018

    @cushon
    Contributor

    @lberki @iirina

    We don't have a repro yet

    It's hard to say without context, but all of the turbine changes that were included in 0.18 should have been validated and released internally by now, so this could be a Bazel-specific issue.

  4. ittaiz commented on Oct 21, 2018

    @ittaiz
    MemberAuthor
  5. ittaiz commented on Oct 21, 2018

    @ittaiz
    MemberAuthor
  6. ittaiz commented on Oct 21, 2018

    @ittaiz
    MemberAuthor

    This class is causing the issue and if I remove the @CrossOrigin annotation the problem goes away.
    Unfortunately this class by itself isn't enough and I'm not sure what else triggers it (there are around 40 files in that package).
    Does that help?

    package com.wix.some;
    
    import org.springframework.web.bind.annotation.CrossOrigin;
    
    public class SomeController  {
    
        @CrossOrigin
        public String do(String request) {
            return null;
        }
    
    }
    
  7. cushon commented on Oct 21, 2018

    @cushon
    Contributor

    public String do(String request) {

    do is a keyword, so that example doesn't compile with javac either. Does this code definitely build with 0.17.2, or with 0.18 and --nojava_header_compilation?

  8. cushon commented on Oct 21, 2018

    @cushon
    Contributor

    This could have been b5099a2. Does passing --experimental_java_header_compilation_disable_javac_fallback reproduce the crash with 0.17.2?

  9. ittaiz commented on Oct 22, 2018

    @ittaiz
    MemberAuthor

    You’re right about the “do”, I changed the text when copying. I’ll check soon

  10. ittaiz commented on Oct 22, 2018

    @ittaiz
    MemberAuthor

    0.18.0 with --nojava_header_compilation passes. guessing 0.17.2 with --experimental_java_header_compilation_disable_javac_fallback will fail.
    This is that AFAICT we don't have any annotation processing there.
    Any idea why this is happening?
    Update:
    Indeed fails with 0.17.2 and the experimental flag

  11. cushon commented on Oct 22, 2018

    @cushon
    Contributor

    Thanks! I have a theory, do you mind checking if #6467 makes a difference?

  12. ittaiz commented on Oct 22, 2018

    @ittaiz
    MemberAuthor
  13. cushon commented on Oct 22, 2018

    @cushon
    Contributor

    Also do you mean to build bazel directly from that branch?

    Yes, thanks: building at head with that PR patched in.

    (I think the same problem will reproduce at head or with 0.18, and patching the fix into 0.18 should also fix the crash. If there ends up being a point release we can probably backport it.)

  14. ittaiz commented on Oct 23, 2018

    @ittaiz
    MemberAuthor

    I checked out 0.18.0 tag, cherry-picked your commit from the PR and it indeed passes.
    Any chance you can ask it will be cherry-picked to 0.18.0 (if they create a point release) and to 0.19.0?
    Thanks!
    We can live with the flag if a point release isn't an option but would rather not

  15. cushon commented on Oct 23, 2018

    @cushon
    Contributor

    Any chance you can ask it will be cherry-picked to 0.18.0 (if they create a point release) and to 0.19.0?

    paging @katre @lberki

    This issue affects class reading of annotation declarations where the default value of an annotation method is a class literal for a non-class type, e.g. the void.class and int.class in:

    @interface V {
      Class<?> foo() default void.class;
      Class<?> bar() default int.class;
    }

    It was fixed in google/turbine@7ef8412, and there's a PR to update Bazel's version of turbine to include the fix: #6467

    We validated this version of turbine internally and didn't encounter this, so it seems like a fairly rare problem. #6467 includes some other changes to turbine that I'm still validating, so it isn't risk-free.

  16. lberki commented on Oct 23, 2018

    @lberki
    Contributor

    Meh. Java compilation regressions are certainly cherrypick-worthy.

  17. ittaiz commented on Oct 23, 2018

    @ittaiz
    MemberAuthor
  18. katre commented on Oct 23, 2018

    @katre
    Collaborator

    SGTM for 0.19.0 (#6116).

  19. cushon commented on Oct 23, 2018

    @cushon
    Contributor

    Ok, sounds like a plan. I did some internal validation of #6467 and it looks fine. Can I get a review for the PR?

  20. ittaiz commented on Oct 23, 2018

    @ittaiz
    MemberAuthor

    So @aehlig can this get on to 0.18.1?

  21. katre commented on Oct 23, 2018

    @katre
    Collaborator

    In the 0.19.0rc7 build, bazel_determinism_test is failing:

    src/main/java/com/google/devtools/build/lib/unsafe/UnsafeProvider.java:21: error: symbol not found sun.misc.Unsafe
    import sun.misc.Unsafe;
    

    https://storage.googleapis.com/bazel-buildkite-artifacts/ad153be8-d848-4ccc-b0df-4f0c631b1ab3/src/test/shell/bazel/bazel_determinism_test/attempt_1.log

  22. katre commented on Oct 23, 2018

    @katre
    Collaborator

    This actually appears to be a different error.

  23. cushon commented on Oct 24, 2018

    @cushon
    Contributor

    This actually appears to be a different error.

    As discussed offline that was the fix for #6433, which has been reverted.

    This issue is fixed, and the fix will be included in 0.19.

  24. ittaiz commented on Oct 24, 2018

    @ittaiz
    MemberAuthor
  25. aehlig commented on Oct 25, 2018

    @aehlig
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions