Giter Club home page Giter Club logo

Comments (11)

caitlinshk avatar caitlinshk commented on July 30, 2024 1

Yes definitely! It wasn't super reproducible but I'll let you know if I see it again.

from error-prone.

caitlinshk avatar caitlinshk commented on July 30, 2024 1

Just FYI I still haven't seen this error again, so feel free to close.

from error-prone.

cpovirk avatar cpovirk commented on July 30, 2024

Thanks. Most of the actual Error Prone team is OOO this week, but I wrote this check, so I'm seeing how easily I can have a look.

Given how much Google's security policies discourage the use of Docker, I've been trying to see if there's a shorter path to reproducing this. I've managed to install scala and sbt, kick off sbt from within server, and run build. That built successfully. Do you see the failure you posted at head (e9f8449aaa13f6402ad41fb3acc14a8b33ad8eff in my clone), or does it appear only with local changes?

from error-prone.

cpovirk avatar cpovirk commented on July 30, 2024

In any case, this whole failure is interesting:

It looks to me like we have a symbol for which isConstructor is true but for which enclosingClass returns null. At least under JDK11 (which might be what sbt is using on my machine?), I don't see how we could have a MethodSymbol with a null owner (which is what enclosingClass returns) without getting an NPE in the MethodSymbol constructor... unless somehow it gets overwritten later?

As an aside, I'm not sure that my enclosingClass(constructedClass) check could possibly work: If I'm reading it right, that should call constructedClass.enclClass(), which should return constructedClass itself....

from error-prone.

cpovirk avatar cpovirk commented on July 30, 2024

(isContructor() is implemented as a check against the name <init>. I suppose it's possible that something uses that as a name for a non-constructor? Do you have Scala deps? That still seems like a long shot. I'm probably missing something obvious.)

from error-prone.

caitlinshk avatar caitlinshk commented on July 30, 2024

I realized I misspoke in my original report: The error happens when running browser tests locally, not when running the server. https://github.com/civiform/civiform/wiki/Testing#functional-browser-tests are our browser test directions (specifically bin/run-browser-test-env).

But, it actually looks like I can no longer reproduce the error. Earlier today, I was working on a few different local PRs (civiform/civiform#6254, then civiform/civiform#6272 which is stacked on top) and I had one of those PR branches checked out when I started seeing the error. What I just did was:

  1. Checkout main
  2. run bin/run-browser-test-env -- works fine.
  3. Checkout civiform/civiform#6254.
  4. run bin/run-browser-test-env -- works fine.
  5. Checkout civiform/civiform#6272.
  6. run bin/run-browser-test-env -- works fine.

It seems like something got temporarily mangled, but checking out main un-mangled it somehow?

Since I can't repro and don't have good repro steps, feel free to close as not reproducible.

from error-prone.

cpovirk avatar cpovirk commented on July 30, 2024

Thanks. I'll see if the aforementioned real Error Prone team has any thoughts upon their return. It does seem believable that some file got mangled or something.

In any case, I am going to look more into this whole "I'm not sure that my enclosingClass(constructedClass) check could possibly work" concern. So we will get something out of this one way or another :)

from error-prone.

cpovirk avatar cpovirk commented on July 30, 2024

Oh, I'm wrong: It works fine because the call to enclClass() is made on sym.owner, not on sym. (It's possible that ASTHelpers.enclosingClass() was implementing the same unfortunate behavior as enclClass() up until cl/153079032, when cushon@ gave it the behavior that I need.)

I should probably still have a test for this.

And this is a reminder that it's nice not to have to deal with enclosing classes at all.... Really, the more checking that we can do just based on questions like "Is the target type here a primitive type?" (like https://errorprone.info/bugpattern/NullTernary), the better. Probably NullArgumentForNonNullParameter should handle primitive types differently or leave that to another future checker. Anyway, I digress.

from error-prone.

cushon avatar cushon commented on July 30, 2024

I don't have any theories about how that NPE could have happened. I don't know much about the interaction between sbt and javac. My current best idea is to add a more descriptive assertion that would catch that NPE, and see if it happens again.

from error-prone.

cushon avatar cushon commented on July 30, 2024

@caitlinshk I added an assertion that should print more information if this happens again and released that change as v2.24.1, can you try updating your build to use the latest version and let us know if you see this crash again?

from error-prone.

cushon avatar cushon commented on July 30, 2024

Thanks for following up!

from error-prone.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.