Skip to content
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

Occasional analysis exceptions #69

Closed
ghost opened this issue Jan 28, 2014 · 16 comments
Closed

Occasional analysis exceptions #69

ghost opened this issue Jan 28, 2014 · 16 comments

Comments

@ghost
Copy link

ghost commented Jan 28, 2014

I seem to "randomly" get these exceptions... they don't stop processing...and everything seems fine after.. but they're strange..

Exception in thread "pool-6-thread-1" java.lang.NullPointerException
    at com.sun.tools.javac.model.JavacElements.cast(JavacElements.java:632)
    at com.sun.tools.javac.model.JavacElements.getPackageOf(JavacElements.java:367)
    at org.androidtransfuse.config.SynchronizedElements.getPackageOf(SynchronizedElements.java:67)
    at org.androidtransfuse.adapter.element.ASTElementFactory.buildPackageClass(ASTElementFactory.java:130)
    at org.androidtransfuse.adapter.element.ASTElementFactory.buildType(ASTElementFactory.java:87)
    at org.androidtransfuse.adapter.element.ASTElementFactory.getType(ASTElementFactory.java:78)
    at org.androidtransfuse.adapter.element.ASTElementFactory.findMethod(ASTElementFactory.java:249)
    at org.androidtransfuse.analysis.FragmentAnalysis.getASTMethod(FragmentAnalysis.java:187)
    at org.androidtransfuse.analysis.FragmentAnalysis.getASTMethod(FragmentAnalysis.java:183)
    at org.androidtransfuse.analysis.FragmentAnalysis.buildEventMethod(FragmentAnalysis.java:176)
    at org.androidtransfuse.analysis.FragmentAnalysis.setupFragmentProfile(FragmentAnalysis.java:160)
    at org.androidtransfuse.analysis.FragmentAnalysis.analyze(FragmentAnalysis.java:122)
    at org.androidtransfuse.analysis.FragmentAnalysis.analyze(FragmentAnalysis.java:47)
    at org.androidtransfuse.gen.AnalysisGeneration.innerRun(AnalysisGeneration.java:45)
    at org.androidtransfuse.gen.AnalysisGeneration.innerRun(AnalysisGeneration.java:29)
    at org.androidtransfuse.transaction.AbstractCompletionTransactionWorker.run(AbstractCompletionTransactionWorker.java:35)
    at org.androidtransfuse.transaction.CodeGenerationScopedTransactionWorker.innerRun(CodeGenerationScopedTransactionWorker.java:47)
    at org.androidtransfuse.transaction.AbstractCompletionTransactionWorker.run(AbstractCompletionTransactionWorker.java:35)
    at org.androidtransfuse.transaction.ScopedTransactionWorker.run(ScopedTransactionWorker.java:55)
    at org.androidtransfuse.transaction.Transaction.run(Transaction.java:77)
@ghost
Copy link
Author

ghost commented Jan 28, 2014

Is this related to:

3e3f6a7

?

I hadn't merged when I reported this...

@ghost
Copy link
Author

ghost commented Jan 28, 2014

Answer: no... still seeing this occasionally after updating to master.

@johncarl81
Copy link
Owner

yes, that was exactly what I was addressing. Are you still seeing this? I thought this was fixed. Transfuse uses a multi-threaded architecture that doesn't play nicely sometimes with the Java facilities, Elements being one of them. The exception is completely benign as this architecture automatically retries work that fails. Are you seeing this exception anywhere without SynchronizedElements involved? ie:

Exception in thread "pool-6-thread-1" java.lang.NullPointerException
    at com.sun.tools.javac.model.JavacElements.cast(JavacElements.java:632)
    at com.sun.tools.javac.model.JavacElements.getPackageOf(JavacElements.java:367)
    at org.androidtransfuse.adapter.element.ASTElementFactory.buildPackageClass(ASTElementFactory.java:130)

@ghost
Copy link
Author

ghost commented Jan 29, 2014

I'm seeing different NPEs now... And they do seem to break the compile when it happens.. I just got it twice in a row, then the third attempt was fine.

Exception in thread "pool-18-thread-1" java.lang.NullPointerException
Note: Transfuse took 167ms to process
    at org.androidtransfuse.model.manifest.Application.updatePackage(Application.java:452)
    at org.androidtransfuse.model.manifest.Manifest.updatePackages(Manifest.java:259)
    at org.androidtransfuse.processor.ManifestManager.getManifest(ManifestManager.java:163)
    at org.androidtransfuse.processor.GenerateModuleProcessor.buildManifest(GenerateModuleProcessor.java:74)
    at org.androidtransfuse.processor.GenerateModuleProcessor.innerRun(GenerateModuleProcessor.java:63)
    at org.androidtransfuse.processor.GenerateModuleProcessor.innerRun(GenerateModuleProcessor.java:33)
    at org.androidtransfuse.transaction.AbstractCompletionTransactionWorker.run(AbstractCompletionTransactionWorker.java:35)
    at org.androidtransfuse.transaction.Transaction.run(Transaction.java:77)

@johncarl81
Copy link
Owner

Ah, that looks like it is happening with the manifest merging... specifically around iterating through the contained activities... is one of them null (not sure how that would happen)?

@ghost
Copy link
Author

ghost commented Jan 29, 2014

Yeah, the only change that was made before that error was changing the
default value of a member boolean in a Fragment

On Tue, Jan 28, 2014 at 5:46 PM, John Ericksen notifications@github.comwrote:

Ah, that looks like it is happening with the manifest merging...
specifically around iterating through the contained activities... is one of
them null (not sure how that would happen)?

Reply to this email directly or view it on GitHubhttps://github.com//issues/69#issuecomment-33548849
.

@ghost
Copy link
Author

ghost commented Jan 29, 2014

This error is happening about 30ish% of the time... some fraction of the times it fails the build...

@johncarl81
Copy link
Owner

Is this always the culprit?:

org.androidtransfuse.model.manifest.Application.updatePackage(Application.java:452)

@ghost
Copy link
Author

ghost commented Jan 29, 2014

I think so. I'm keeping an eye out

@johncarl81
Copy link
Owner

Im try to reproduce... the only thing I can think of is that a null is being added to the Manifest's Activity list when Activity analysis is performed, but this would have thrown a NPE much earlier. Any ideas why this is happening?

@ghost
Copy link
Author

ghost commented Jan 29, 2014

No clue... it just seems completely random... for what it's worth, it seems
to be happening much less today... but if I can find a pattern of any kind,
i will report back immediately.

@ghost
Copy link
Author

ghost commented Jan 30, 2014

I just got another of these, FWIW

Exception in thread "pool-16-thread-7" java.lang.NullPointerException
    at com.sun.tools.javac.model.JavacElements.cast(JavacElements.java:632)
    at com.sun.tools.javac.model.JavacElements.getPackageOf(JavacElements.java:367)
    at org.androidtransfuse.config.SynchronizedElements.getPackageOf(SynchronizedElements.java:67)
    at org.androidtransfuse.adapter.element.ASTElementFactory.buildPackageClass(ASTElementFactory.java:130)
    at org.androidtransfuse.adapter.element.ASTElementFactory.buildType(ASTElementFactory.java:87)
    at org.androidtransfuse.adapter.element.ASTElementFactory.getType(ASTElementFactory.java:78)
    at org.androidtransfuse.processor.ReloadableASTElementFactory$ReloadableASTTypeProvider.get(ReloadableASTElementFactory.java:66)
    at org.androidtransfuse.processor.ReloadableASTElementFactory$ReloadableASTTypeProvider.get(ReloadableASTElementFactory.java:54)
    at org.androidtransfuse.gen.AnalysisGeneration.innerRun(AnalysisGeneration.java:43)
    at org.androidtransfuse.gen.AnalysisGeneration.innerRun(AnalysisGeneration.java:29)
    at org.androidtransfuse.transaction.AbstractCompletionTransactionWorker.run(AbstractCompletionTransactionWorker.java:35)
    at org.androidtransfuse.transaction.CodeGenerationScopedTransactionWorker.innerRun(CodeGenerationScopedTransactionWorker.java:47)
    at org.androidtransfuse.transaction.AbstractCompletionTransactionWorker.run(AbstractCompletionTransactionWorker.java:35)
    at org.androidtransfuse.transaction.ScopedTransactionWorker.run(ScopedTransactionWorker.java:55)

@johncarl81
Copy link
Owner

I wonder if we could get the java source to see what is specifically
causing this NPE.

@johncarl81
Copy link
Owner

After a bit of tinkering I've turned off multithreading for now (182ff1b). Let me know if you see this any more.

@ghost
Copy link
Author

ghost commented Feb 2, 2014

Thanks, I'll let you know.

@johncarl81
Copy link
Owner

Closing as I have not seen this personally or been notified of it happening. Feel free to reopen if this is witnessed again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant