google / google/j2objc

ARGC exceptions when translating

Open
#1,471 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6k
Forks
999
Avg merge
19h 20m
Merged PRs (30d)
14

Description

We are trying to use garbage collection approach in our project to see if it helps with some of the memory issues we're facing, but we've been struggling with exceptions that arise during translation. We've built j2objc from `master-ARGC` branch according to the instructions (we've successfully did this with previous releases). The issues we're having arise when translating dependencies that we use, specifically Joda Convert (v1.8) and jtry.

```
error: internal error translating "/.../build/j2objc/java/source/org/joda/convert/AbstractTypeStringConverter.java"
com.google.devtools.j2objc.ast.TreeVisitorError: /.../build/j2objc/java/source/org/joda/convert/AbstractTypeStringConverter.java:36: NullPointerException: null
at com.google.devtools.j2objc.util.TypeUtil.asTypeElement(TypeUtil.java:238)
at com.google.devtools.j2objc.ast.TypeDeclaration.acceptInner(TypeDeclaration.java:95)
at com.google.devtools.j2objc.ast.TreeNode.accept(TreeNode.java:82)
at com.google.devtools.j2objc.ast.ChildLink.accept(ChildLink.java:76)
at com.google.devtools.j2objc.ast.ChildList.accept(ChildList.java:90)
at com.google.devtools.j2objc.ast.CompilationUnit.acceptInner(CompilationUnit.java:194)
at com.google.devtools.j2objc.ast.TreeNode.accept(TreeNode.java:82)
at com.google.devtools.j2objc.ast.UnitTreeVisitor.run(UnitTreeVisitor.java:50)
at com.google.devtools.j2objc.pipeline.TranslationProcessor.applyMutations(TranslationProcessor.java:152)
at com.google.devtools.j2objc.pipeline.TranslationProcessor.processConvertedTree(TranslationProcessor.java:107)
at com.google.devtools.j2objc.pipeline.FileProcessor.processCompiledSource(FileProcessor.java:169)
at com.google.devtools.j2objc.pipeline.FileProcessor.access$000(FileProcessor.java:43)
at com.google.devtools.j2objc.pipeline.FileProcessor$1.handleParsedUnit(FileProcessor.java:141)
at com.google.devtools.j2objc.javac.JavacParser.parseFiles(JavacParser.java:299)
at com.google.devtools.j2objc.pipeline.FileProcessor.processBatch(FileProcessor.java:146)
at com.google.devtools.j2objc.pipeline.FileProcessor.processInputs(FileProcessor.java:71)
at com.google.devtools.j2objc.pipeline.TranslationProcessor.processInputs(TranslationProcessor.java:83)
at com.google.devtools.j2objc.J2ObjC.runEx(J2ObjC.java:138)
at com.google.devtools.j2objc.J2ObjC.main(J2ObjC.java:200)
```

We have this exception for ~50 files. Stacktrace is exactly the same for all of them. We're using Java 1.8.0_221. None of these exceptions arise when translating with 2.4, 2.5 or 2.6

I'd greatly appreciate any suggestions to make this work for us 🙏

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.