Comments (23)
Yeah, that would be much appreciated - one example of a popular library using this class name scheme during automatic code generation is Dagger which is indeed widely used. Can't use infer until this issue is solved. 😿
from infer.
+1
Exact same problem here. The Infer output says you can add abortOnError false
to lintOptions
, but I would rather this just not cause an error in the first place.
@zsiegel Which library is doing it for you? I personally am not using Dagger
, but perhaps Butterknife
?
from infer.
from infer.
Thanks for the report! This is due to a problem in the javalib library we use to parse Java bytecode. We are working on getting it fixed upstream.
from infer.
+1, looking forward to the fix for this!
from infer.
+1
from infer.
+1
from infer.
+1 for Butterknife, would also love to use Dagger and I believe the Dagger2 generated classes have similar naming to Butterknife so potentially same issue here. Possibly a way to exclude generated classes?
from infer.
Yes, we will just skip the classes with the name containing $$ for now, while we are trying to fix the library used to parse the bytecode.
from infer.
I met the same problem when i used ButterKnife library in my project. Look forward the new feature!:)
from infer.
Here is my log.
Fatal error: exception Invalid_argument("Error : com.packagename.HomeActivity$$InjectAdapter is not a valid name for a class")
[ERROR] Failure during frontend, original command was
[u'inferJ', u'-g', u'-a', 'capture', u'javac', '-source', '1.7', '-target', '1.7', '-d'{bunch project jars}]
Traceback (most recent call last):
File "/Library/infer-osx-v0.1.0/infer/infer/bin/infer", line 142, in <module>
main()
File "/Library/infer-osx-v0.1.0/infer/infer/bin/infer", line 119, in main
capture_exitcode = imported_module.gen_instance(args, cmd).capture()
File "/Library/infer-osx-v0.1.0/infer/infer/bin/../lib/capture/gradle.py", line 42, in capture
return util.run_commands(cmds)
File "/Library/infer-osx-v0.1.0/infer/infer/bin/../lib/capture/util.py", line 34, in run_commands
if not cmd.start():
File "/Library/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 632, in start
if self.capture() == os.EX_OK:
File "/Library/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 400, in capture
return self.run_infer_frontend()
File "/Library/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 391, in run_infer_frontend
self.args.analyzer
File "/Library/infer-osx-v0.1.0/infer/infer/bin/inferlib.py", line 318, in run_command
raise e
subprocess.CalledProcessError: Command '[u'/Library/infer-osx-v0.1.0/infer/infer/bin/InferJava', u'-results_dir', u'/Users/user/GitHub/Android-app/infer-out', u'-verbose_out', '/var/folders/68/4pkjv9fd743040h3dmj98kbm0000gn/T/javac_KjBTQT.out', u'-models', u'/Library/infer-osx-v0.1.0/infer/infer/bin/../lib/java/models.jar', u'-no-static_final']' returned non-zero exit status 2
from infer.
@oshamahue: did you use the Infer binaries or did you compiled Infer from sources ?
from infer.
@jeremydubreil I used the binaries. I added infer-osx-v0.1.0/infer/infer/bin as a path and used it from there.
from infer.
+1 ... a fix for Butterknife (and Dagger, if there's a problem as well) would be highly appreciated 💃 :)
from infer.
This issue has been sidestepped by 4526ada, which stops Infer from crashing when it encounters $$ classnames (though it won't analyze these classes; we are working on that). However, you have to build Infer from source for this to work; we haven't released new binaries with the fix yet.
from infer.
@sblackshear can you release a new version with this fix? Do you have planned release schedules?
from infer.
Hi,
we made a new release today that contains the fix. You could try it out. We are planning to do releases regularly.
from infer.
Any idea when the upstream fix in javelib will get done? For those of us using Dagger, not analyzing the Dagger injected classes basically means that very little in our Android projects get analyzed. All our "services" / "business logic" classes are injected.
from infer.
Hey @dmorehouse,
As dulmarod mentioned above, they pushed a new build which fixes this issue. Download the latest binaries and try again.
from infer.
@plowman The fix right now is just sidestepping the $$
classes and not analyzing them.
from infer.
This problem should be fixed soon and will likely make it to the next release of Infer in the next few days. Stay tuned!
from infer.
Aha, that makes more sense. Thanks @mattblang.
from infer.
This has been fixed in the latest release.
from infer.
Related Issues (20)
- [java] DEADLOCK: False Negative in Infer analysis results after converting anonymous classes to lambda expressions HOT 1
- [java] STARVATION: False Negative in Infer analysis results after converting anonymous classes to lambda expressions HOT 1
- False positive of Infer/Pulse when `std::unique_ptr` is used with no throw `new` HOT 2
- how to use --custom-symbols?
- How to check custom malloc and free functions for memory leak?
- can infer find out all suspecious bugs? HOT 2
- java: Infer injects outdated, buggy maven-compiler-plugin version 3.8.0
- False positive memory leak on loop HOT 4
- Dockerfile: US-ASCII locale causes crash on UTF-8 input
- How to add extra nullability condition to NULL_DEREFERENCE checking
- Is Adding a C++ Infer Port to the VSCode Plugin on the Roadmap? HOT 3
- [java] A false negative about the rule NULL_DEREFERENCE
- [java] A false positive about the rule THREAD_SAFETY_VIOLATION
- `--biabduction-unsafe-malloc` doesn't assume that `calloc()` and `realloc()` never return null HOT 1
- Error building the `Resource Leak analysis` lab in docker
- False positive Uninitialized Value in C code
- Need help when using infer run or capture during maven compilation HOT 1
- Query on --changed-files-index option HOT 3
- Meta leak HOT 1
- Infer - clang plugin OCaml - Issue HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from infer.