-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Eclipse compiler crashes with NPE #237
Comments
👤 bskaarup 🕗 Nov 23, 2010 at 13:52 UTC We quite often experiences that the compiler in eclipse crashes in classes that use Lombok Usually a clean of the project helps, but sometimes we need to clean more than once without any changes to the code before the NPE goes away We primarily use @ Getter and @ Setter with or without AccessLevel in our classes. It happens 10-20 time pr. developer pr. day so it gets quite annoying after a while We have tried with different version of Java (Java 6 update 21 and 22) and Eclipse Version: 3.6.0 (Build id: I20100608-0911) and Version: 3.7.0 (Build id: I20101028-1441) and get errors often in each version. The problems occur inside a large project so it isn't easy to extract a simple test case. Do you have any idea what could be the problem here? |
👤 reinierz 🕗 Nov 27, 2010 at 18:28 UTC I've been running into this of late as well, though at least once it turns out it was a bug in eclipse itself. I've decided not to investigate much further, because we're going to rewrite the point at which we fix the AST, which will most likely fix this problem as well. I'll leave this open in case our intended rewrite doesn't go as planned and we end up abandoning it. |
👤 reinierz 🕗 Jan 24, 2011 at 19:07 UTC Hey, it happened on my eclipse. Guess it must be blue moon tonight. Here's the full stacktrace: java.lang.NullPointerException |
👤 r.spilker 🕗 Jan 31, 2011 at 23:00 UTC |
👤 ray.muirhead 🕗 Feb 11, 2011 at 00:03 UTC This is happenening virtually all the time with lombok-0.10.0-BETA2.jar and Eclipse Java EE IDE for Web Developers. Version: Helios Service Release 1 |
👤 [email protected] 🕗 Feb 23, 2011 at 11:20 UTC I've written an Delegate-Extension for Lombok, which delegates a method call to another class. This works really good. But if i use the Annotation on many files, the NPE throws nearly everytime. A clean often solved the problem. I need a solution quickly. Can you give me a hint what is causing the Exception? I would try to solve the problem. |
👤 ray.muirhead 🕗 Feb 23, 2011 at 22:32 UTC I've had success using Eclipse 3.5.2 - could be a bug that is introduced in the newer version of Eclipse. |
👤 francois.marot 🕗 Feb 24, 2011 at 14:33 UTC We suffer from this bug too on a very large project (50+ maven poms, 10 people, 2 years). Never took the time to investigate on a smaller sample to reproduce the problem though... Usually, a clean of the project on which the compiler crashed will bring back to normal. Sometimes it will crash numerous times until it manages to compile successfully. |
👤 jmsachs 🕗 Feb 25, 2011 at 22:44 UTC
I've had failures using Eclipse 3.5.2, so don't blame the newer version of Eclipse. My version of Lombok is 0.9.3 |
👤 reinierz 🕗 Mar 23, 2011 at 06:46 UTC Another stack trace that might be related: java.lang.NullPointerException |
👤 reinierz 🕗 Mar 28, 2011 at 20:08 UTC Looks like you can reliably reproduce BOTH stack traces by checking out commit ab1d938 - create 2 classes that delegate to each other (each has a field of the other's type), then let one of those classes "extends ArrayList", and this error always occurs. |
👤 reinierz 🕗 Mar 29, 2011 at 11:24 UTC False alarm, more or less (in re: Comment 10). The same stack traces do indeed occur but for different reasons. Lombok or some eclipse code delivers an invalid AST (where some of the AST nodes' scope variables are still null), but this doesn't cause any problems right away. Then, later, when some worker is fired up to do some analysis on the AST, it crashes with the above 2 stack traces. The problem is thus: These stack traces contain absolutely no information at all about what actually went wrong. We do think we figured out a point in lombok where, if this bug is going to happen, we'll be called, and we can figure out that it'll happen. We'll add code to 0.10.0 to log a stacktrace to the eclipse error log if this condition is detected. We hope that, if someone stumbles across this one again in 0.10.0, we can ask them to paste that stacktrace here and we'll have a much easier time figuring out why this occurs once in a blue moon with varying frequencies depending on as far as I can tell processor speed and project sizes of all things. So not fixed, but some progress. |
👤 [email protected] 🕗 May 03, 2011 at 14:27 UTC The way how you try to identify the error is: "if (parent.scope != null && method.scope == null)" i can confirm, that this is a state where an nullpointererror appears. But after a clean the parent.scope is everytime null, and no error appears. Who sets the scope of the parent-class? maybe the eclipse trys to parse the class before the lombok has finished? did you recognize that the parent's scope (the classscope) is set in the middle of the class. The first attributes are handled correct. The error appears somewhere, everytime on a different position, in the middle of a class. |
👤 [email protected] 🕗 May 15, 2011 at 16:05 UTC Hi, I'm using the current lombok code from git master repo as of today. The build produces some of the stack traces you were looking for. Here are two of them:eclipse.buildId=M20110210-1200 This is a continuation of log file D:\workspaces\x.metadata.bak_2.log Warning java.lang.Throwable Warning java.lang.Throwable |
👤 reinierz 🕗 May 15, 2011 at 16:11 UTC Stack traces from ﹟14 and a clue from ﹟13. Excellent. We really need to fix this thing before releasing 0.10.0 final, and these will help. |
👤 [email protected] 🕗 May 16, 2011 at 09:03 UTC Now I have the situation of beeing able to reproduce the NPE occuring. In my setup this occurs if I have a Bean using @ ToString(callSuper = true) Did you have a look with a tool like VisualVM to overview the compilation process? There are quite a lot Threads involved and it might "just" be a synchronisation issue. Maybe it helps to have a look at some Thread Dumps while the compilation is running to see which parts are running in parallel. Just an idea... |
👤 r.spilker 🕗 May 16, 2011 at 21:20 UTC We tried to reproduce it but can't get it to work. Any suggestions? Maybe the actual source files? Do you have cleanup actions active? Any special plugins? Doe it occur every time? |
👤 [email protected] 🕗 May 17, 2011 at 07:36 UTC It's almost always reproducable within the big workspace I'm using. It conains over 20 plugins and I can't give you the sources. I tried to reproduce it with a simpler example, but it doesn't always work. Seems like there's not enough work do to. I've attached the simple eclipse project I was using. A situation where the NPE occured quite often was the following:
As you may notice, I'm using a slightly patched version of lombok which uses an additional Handler (@ FieldAccessor). You may want to reproduce it with the lombok contained in the zip first, to be sure that it's not a problem in the version I'm using. However try if these steps work for you. Otherwise I'm not quite sure how I could help with it. |
👤 [email protected] 🕗 May 17, 2011 at 07:36 UTC |
👤 [email protected] 🕗 May 17, 2011 at 07:42 UTC Forgot to answer your questions: I'm not using any save actions and didn't use any formatting or organizing import actions. As of the plugins: I'm not using any other annotation processor or any other plugins enriching the outline. If you are interested I may attach the eclipse configuration I'm using. |
👤 reinierz 🕗 May 17, 2011 at 13:38 UTC As we've had a few umptheen claims of reproducibility which never go anywhere, and as we've had similar experiences ourselves, we're virtually positive this is a race condition. Hard to explain what we're seeing any other way. Right now we have a plan to refactor some of the code that we think might be causing this into cleaner code and perhaps the problem will go away on its own. Roel wants to spend a little more time trying to nail down why this bug occurs before doing the refactor, though. |
👤 reinierz 🕗 Jun 06, 2011 at 18:50 UTC Refactoring discussed in ﹟22 has been completed, and we'll ship the detector (which dumps a bunch of stuff in your eclipse logs if it thinks this bug might have occurred) with 0.10.0 RC1. Hopefully either nobody runs into it, or someone runs into it with a useful stack trace. We'd be much obliged if you grab the edge release and try to reproduce this bane of my existence. Really. I'll give my left kidney for a fix for this thing. |
👤 bskaarup 🕗 Jun 07, 2011 at 05:15 UTC I just got these two stacktraces from the edge release from june 6th: null java.lang.Throwable |
👤 bskaarup 🕗 Jun 07, 2011 at 05:15 UTC and this: null java.lang.Throwable |
👤 reinierz 🕗 Jun 07, 2011 at 05:16 UTC Did you get any errors or otherwise buggy or weird behaviour other than these traces? |
👤 david.sitte 🕗 Jul 13, 2011 at 10:45 UTC Eclipse 3.7 java.lang.Throwable eclipse.buildId=I20110613-1736 |
👤 jmsachs 🕗 Jul 14, 2011 at 13:56 UTC I've added an export from the eclipse error log. (Source code elided due to employer confidentiality issues) Hope this helps. |
👤 jmsachs 🕗 Jul 14, 2011 at 13:56 UTC |
👤 wendal1985 🕗 Jul 16, 2011 at 12:11 UTC java.lang.Throwable eclipse.buildId=I20110613-1736 |
👤 paoyuan 🕗 Jul 26, 2011 at 09:26 UTC Using 0.10.0-RC2 with new error log. |
👤 paoyuan 🕗 Jul 26, 2011 at 09:26 UTC |
👤 Thomas.Hofmann 🕗 Jul 31, 2011 at 20:35 UTC eclipse.buildId=2.6.1.201105041000-RELEASE This is a continuation of log file C:\ws2.metadata.bak_0.log Warning java.lang.Throwable |
👤 reinierz 🕗 Aug 01, 2011 at 20:34 UTC WE GOT IT!!!! deece27 It was that simple; lombok contained a singleton mutable which was at the root of thread race issues. Also turned off all the back-in-time ad-hoc debugging code that was present in 0.10.0-RC1 and RC2 which should improve performance. Unless you're on 0.10.0-RC3 (or higher), you can stop posting the issue164-X.err files here. Thanks for all the help! |
👤 amanic 🕗 Aug 01, 2011 at 21:27 UTC congrats! \o/ |
👤 [email protected] 🕗 Aug 12, 2011 at 07:57 UTC nice! |
👤 francois.marot 🕗 Aug 12, 2011 at 08:00 UTC Yeah, thanks, you changed my life with 10.0-RC3 :) |
👤 sanchay.h 🕗 Aug 26, 2011 at 05:21 UTC I'm still getting the following exception after upgrading to 0.10.0. !ENTRY org.eclipse.jdt.core 2 0 2011-08-25 22:17:40.259 |
👤 pe.fips 🕗 Aug 26, 2011 at 07:49 UTC I'm pretty sure you didn't install 0.10.0 properly, since the message you just posted got replaced in 0.10.0RC2 and removed in 0.10.0RC3 cause the issue was fixed. You check the lombok version eclipse uses by executing this line: Or just run the installer again. |
👤 sanchay.h 🕗 Aug 26, 2011 at 08:01 UTC Checked the lombok.core.Version and it reported 0.10.0. But I installed by just adding the line '-Xbootclasspath/a:lombok-0.10.0.jar' into eclipse.ini. This time I've installed by double clicking. I'll report again in case of problems. |
👤 sanchay.h 🕗 Aug 26, 2011 at 09:06 UTC Got the same stack trace, here are my settings: eclipse>java -cp lombok.jar lombok.core.Version eclipse>type eclipse.ini !ENTRY org.eclipse.jdt.core 2 0 2011-08-26 01:55:41.698 |
👤 pe.fips 🕗 Aug 26, 2011 at 10:04 UTC I just checked the lombok.jar you get via https://projectlombok.org/download.html or via maven central. Both files don't contain anything that could produce this message (since it got removed in 0.10.0RC3), so this is very very strange. Could you just download and install lombok again and see if that helps? |
👤 sanchay.h 🕗 Aug 26, 2011 at 20:09 UTC Ok I closed eclipse, installed again, then restarted eclipse, then did clean project. Looks like this time the plugin got installed. But now it produces the same error with a different stack trace. Is this one for 0.10.0 ? !ENTRY org.eclipse.jdt.core 2 0 2011-08-26 13:02:13.757 |
👤 pe.fips 🕗 Aug 26, 2011 at 20:31 UTC Sorry, no it is not. Lombok 0.10.0 does not contain anything that produces "We believe you may have just stumbled on lombok issue #237" messages anymore. |
👤 silvaran 🕗 Aug 31, 2011 at 13:20 UTC I still get plenty of NPEs while building, including the popup. In some instances I need to keep opening arbitrary .java files, make a single character change and delete it so I can re-save and have the compiler continue compiling where it failed last time. I might have to do this 5-6 times in a row before the entire project can be built. Eclipse 3.7 and lombok 0.10. Here's the stack trace: java.lang.NullPointerException |
👤 silvaran 🕗 Sep 22, 2011 at 19:44 UTC I was using 0.10.0-RC1, which I noticed during a recent fresh install. My eclipse install is also completely new (as is the projects I work with; they were checked straight out of SVN), so I haven't had a lot of time to verify anything is different--were there any changes made between RC1 and the final release that could affect things? |
👤 sanchay.h 🕗 Sep 22, 2011 at 22:22 UTC w.r.t ﹟49, I changed my workspace couple of days back - not noticing NPEs now. |
👤 thomas.andreas.winkler 🕗 Dec 27, 2011 at 11:28 UTC I also have this issue: java.lang.Throwable eclipse.buildId=I20110613-1736 |
👤 slade.justin 🕗 Jul 04, 2012 at 13:07 UTC !ENTRY org.eclipse.jdt.core 2 0 2012-07-04 15:01:12.099 |
👤 r.spilker 🕗 Jul 04, 2012 at 13:13 UTC @ slade.justin What version of lombok are you running? What version of Eclipse? |
End of migration |
Migrated from Google Code (issue 164)
The text was updated successfully, but these errors were encountered: