`infer -- javac Hello.java` fails to run when the current path contains whitespaces #99

Open
randikapw opened this Issue Jun 24, 2015 · 24 comments

Projects

None yet

8 participants

@randikapw

I have tried to test infer using Hello.java which was located in Desktop/Hello folder in my mac. And it said "Failed to load any Java source code". (Refer below commands that I tried.).

CD-RWEERASOORI:Desktop rweerasooriya$ infer -v
Infer version v0.1.1
Copyright 2009 - present Facebook. All Rights Reserved.

CD-RWEERASOORI:Desktop rweerasooriya$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)

CD-RWEERASOORI:Desktop rweerasooriya$ cd Hello/
CD-RWEERASOORI:Hello rweerasooriya$ ls
Hello.java

CD-RWEERASOORI:Hello rweerasooriya$ infer -- javac Hello.java
Fatal error: exception Failure("Failed to load any Java source code")
[ERROR] Failure during frontend, original command was

[u'inferJ', u'-g', u'-a', 'infer', u'javac', 'Hello.java']

Traceback (most recent call last):
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/inferJ", line 19, in
stats = analysis.start()
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/inferlib.py", line 632, in start
if self.capture() == os.EX_OK:
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/inferlib.py", line 400, in capture
return self.run_infer_frontend()
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/inferlib.py", line 391, in run_infer_frontend
self.args.analyzer
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/inferlib.py", line 318, in run_command
raise e
subprocess.CalledProcessError: Command '[u'/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/InferJava', u'-results_dir', '/Users/rweerasooriya/Desktop/Hello/infer-out', u'-verbose_out', '/var/folders/x0/_9n0fqgj2zngnvt0642_h384zc4l_4/T/javac_hTItgR.out', u'-models', u'/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/../lib/java/models.jar', u'-no-static_final']' returned non-zero exit status 2
CD-RWEERASOORI:Hello rweerasooriya$

@jvillard
Contributor

Hi @randikapw, thanks for the detailed report. It looks like a duplicate of #30. The workaround for now is to upgrade java and javac to version 1.7.

Please reopen and update this issue if java and javac 1.7 do not solve it for you.

@jvillard jvillard closed this Jun 24, 2015
@randikapw

Thanks @jvillard
Just installed latest version of JDK and it worked for me.
And I had already followed #30 and reason to open this was i have received different message :)
Thanks for quick reply.

@jvillard
Contributor

@randikapw yes indeed, we removed the "TODO" message in favour of raising the exception you're seeing in a8a8501

@randikapw

Actually my main requirement was to try infer for an Eclipse + Android project. And it failed again with same message. Any idea about this?

CD-RWEERASOORI:expandablelistsample rweerasooriya$ java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

CD-RWEERASOORI:expandablelistsample rweerasooriya$ ant debug
Buildfile: /Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/build.xml

-set-mode-check:

-set-debug-files:

-check-env:
[checkenv] Android SDK Tools Revision 24.1.2
[checkenv] Installed at /Users/rweerasooriya/Desktop/adt-bundle-mac-x86_64-20131030u/sdk

-setup:
[echo] Project Name: expandablelistsample
[gettype] Project Type: Application

{some content has removed here for short this post }

[propertyfile] Updating property file: /Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/bin/build.prop

-post-build:

debug:

BUILD SUCCESSFUL
Total time: 2 seconds

CD-RWEERASOORI:expandablelistsample rweerasooriya$ ant clean
Buildfile: /Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/build.xml

{some content has removed here for short this post }

[getlibpath] No Libraries
[subant] No sub-builds to iterate on

BUILD SUCCESSFUL
Total time: 0 seconds

CD-RWEERASOORI:expandablelistsample rweerasooriya$ infer -- ant debug
Fatal error: exception Failure("Failed to load any Java source code")
[ERROR] Failure during frontend, original command was

[u'inferJ', u'-g', u'-a', 'capture', u'javac', '-d', '/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/bin/classes', '-classpath', '/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/bin/classes:/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/libs/android-support-v4.jar', '-sourcepath', '/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/src:/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/gen', '-target', '1.5', '-bootclasspath', '/Users/rweerasooriya/Desktop/adt-bundle-mac-x86_64-20131030u/sdk/platforms/android-19/android.jar', '-encoding', 'UTF-8', '-g', '-source', '1.5', '/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/src/com/example/expandablelistsample/ExpandableListAdapter.java', '/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/src/com/example/expandablelistsample/MainActivity.java', '/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/gen/com/example/expandablelistsample/BuildConfig.java', '/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/gen/com/example/expandablelistsample/R.java']

Traceback (most recent call last):
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/infer", line 141, in
main()
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/infer", line 118, in main
capture_exitcode = imported_module.gen_instance(args, cmd).capture()
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/../lib/capture/ant.py", line 69, in capture
return util.run_commands(cmds)
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/../lib/capture/util.py", line 34, in run_commands
if not cmd.start():
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/inferlib.py", line 632, in start
if self.capture() == os.EX_OK:
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/inferlib.py", line 400, in capture
return self.run_infer_frontend()
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/inferlib.py", line 391, in run_infer_frontend
self.args.analyzer
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/inferlib.py", line 318, in run_command
raise e
subprocess.CalledProcessError: Command '[u'/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/InferJava', u'-results_dir', u'/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/infer-out', u'-verbose_out', '/var/folders/x0/_9n0fqgj2zngnvt0642_h384zc4l_4/T/javac_wcxDvQ.out', u'-models', u'/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/../lib/java/models.jar', u'-no-static_final']' returned non-zero exit status 2
CD-RWEERASOORI:expandablelistsample rweerasooriya$

@jvillard
Contributor

Now your version of java and javac may be too recent. That'd be #30 again. Does this work if you downgrade java and javac to 1.7?

@occho
Contributor
occho commented Jun 24, 2015

Hi @randikapw
I'm just curious, but could you show me the output of the following command?
$ javac -verbose Hello.java

Your error messages are similar to those I had before.
#94

@randikapw

@jvillard
Just downgraded it :( still not working

CD-RWEERASOORI:expandablelistsample rweerasooriya$ export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
CD-RWEERASOORI:expandablelistsample rweerasooriya$ java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
CD-RWEERASOORI:expandablelistsample rweerasooriya$ ant clean
Buildfile: /Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/build.xml

{removed some stuff}

BUILD SUCCESSFUL
Total time: 2 seconds

CD-RWEERASOORI:expandablelistsample rweerasooriya$ infer -- ant debug
Fatal error: exception Failure("Failed to load any Java source code")
[ERROR] Failure during frontend, original command was

[u'inferJ', u'-g', u'-a', 'capture', u'javac', '-d', '/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/bin/classes', '-classpath', '/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/bin/classes:/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/libs/android-support-v4.jar', '-sourcepath', '/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/src:/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/gen', '-target', '1.5', '-bootclasspath', '/Users/rweerasooriya/Desktop/adt-bundle-mac-x86_64-20131030u/sdk/platforms/android-19/android.jar', '-encoding', 'UTF-8', '-g', '-source', '1.5', '/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/src/com/example/expandablelistsample/ExpandableListAdapter.java', '/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/src/com/example/expandablelistsample/MainActivity.java', '/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/gen/com/example/expandablelistsample/BuildConfig.java', '/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/gen/com/example/expandablelistsample/R.java']

Traceback (most recent call last):
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/infer", line 141, in
main()
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/infer", line 118, in main
capture_exitcode = imported_module.gen_instance(args, cmd).capture()
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/../lib/capture/ant.py", line 69, in capture
return util.run_commands(cmds)
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/../lib/capture/util.py", line 34, in run_commands
if not cmd.start():
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/inferlib.py", line 632, in start
if self.capture() == os.EX_OK:
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/inferlib.py", line 400, in capture
return self.run_infer_frontend()
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/inferlib.py", line 391, in run_infer_frontend
self.args.analyzer
File "/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/inferlib.py", line 318, in run_command
raise e
subprocess.CalledProcessError: Command '[u'/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/InferJava', u'-results_dir', u'/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/infer-out', u'-verbose_out', '/var/folders/x0/_9n0fqgj2zngnvt0642_h384zc4l_4/T/javac_KhlBW9.out', u'-models', u'/Users/rweerasooriya/infer-osx-v0.1.1/infer/infer/bin/../lib/java/models.jar', u'-no-static_final']' returned non-zero exit status 2
CD-RWEERASOORI:expandablelistsample rweerasooriya$

@randikapw

Hi @occho
Give me few minutes.. ill post it

@randikapw

Hi @occho, This is the result

CD-RWEERASOORI:expandablelistsample rweerasooriya$ cd ~/Desktop/Hello/

CD-RWEERASOORI:Hello rweerasooriya$ javac -verbose Hello.java
[parsing started RegularFileObject[Hello.java]]
[parsing completed 15ms]
[search path for source files: .]
[search path for class files: /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/lib/resources.jar,/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/lib/rt.jar,/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/lib/sunrsasign.jar,/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/lib/jsse.jar,/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/lib/jce.jar,/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/lib/charsets.jar,/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/lib/jfr.jar,/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/classes,/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/lib/ext/dnsns.jar,/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/lib/ext/localedata.jar,/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/lib/ext/sunec.jar,/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar,/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar,/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/lib/ext/zipfs.jar,/System/Library/Java/Extensions/AppleScriptEngine.jar,/System/Library/Java/Extensions/dns_sd.jar,/System/Library/Java/Extensions/j3daudio.jar,/System/Library/Java/Extensions/j3dcore.jar,/System/Library/Java/Extensions/j3dutils.jar,/System/Library/Java/Extensions/jai_codec.jar,/System/Library/Java/Extensions/jai_core.jar,/System/Library/Java/Extensions/mlibwrapper_jai.jar,/System/Library/Java/Extensions/MRJToolkit.jar,/System/Library/Java/Extensions/vecmath.jar,.]
[loading ZipFileIndexFileObject[/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Object.class)]]
[checking Hello]
[loading ZipFileIndexFileObject[/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/lib/ct.sym(META-INF/sym/rt.jar/java/lang/AutoCloseable.class)]]
[loading ZipFileIndexFileObject[/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/lib/ct.sym(META-INF/sym/rt.jar/java/lang/String.class)]]
[wrote RegularFileObject[Hello.class]]
[total 563ms]

CD-RWEERASOORI:Hello rweerasooriya$ infer -- javac -verbose Hello.java
Starting analysis (Infer version v0.1.1)
Analysis done

1 file analyzed

/Users/rweerasooriya/Desktop/Hello/Hello.java:4: error: NULL_DEREFERENCE
object s last assigned on line 3 could be null and is dereferenced at line 4

CD-RWEERASOORI:Hello rweerasooriya$

@jvillard jvillard reopened this Jun 24, 2015
@occho
Contributor
occho commented Jun 24, 2015

Thanks @randikapw
Well, I'm sorry, I misunderstood.
I had thought that you were still stuck with Hello.java.

In my case, verbose output contained characters that the lexer did not expect, which caused parsing errors.

I'll check spaces are allowed for file paths

@randikapw

@occho 👍

@occho
Contributor
occho commented Jun 24, 2015

@randikapw
I am guessing that the spaces cause the bug.
https://github.com/facebook/infer/blob/master/infer/src/java/jVerboseLexer.mll#L25

I mean the spaces in "Review Work Space".
/Users/rweerasooriya/Documents/EAG/Review Work Space/expandablelistsample/bin/classes

@sblackshear
Contributor

Interesting! Spaces in the path do indeed seem to be the problem. We will work on fixing this.

@jvillard jvillard added bug java labels Jun 24, 2015
@Stupidcoding

I hava the same error.
Fatal error: exception Failure("Failed to load any Java source code")
Traceback (most recent call last):
File "/Users/mengdongsheng/Documents/infer-osx-v0.2.0/infer/infer/bin/infer", line 168, in
main()
File "/Users/mengdongsheng/Documents/infer-osx-v0.2.0/infer/infer/bin/infer", line 143, in main
capture_exitcode = imported_module.gen_instance(args, cmd).capture()
File "/Users/mengdongsheng/Documents/infer-osx-v0.2.0/infer/infer/bin/../lib/capture/javac.py", line 33, in capture
if self.args.debug:
AttributeError: JavacCapture instance has no attribute 'args'

java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
javac -version
javac 1.7.0_79

@yolinkxzw

I have tried to test infer using Hello.java in my ubuntu.
And it said "Failed to load any Java source code". (Refer below commands that I tried.).

linux1@linux1-X550VL:/opt/test$ infer -v
Infer version v0.1.1
Copyright 2009 - present Facebook. All Rights Reserved.
linux1@linux1-X550VL:/opt/test$ java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
linux1@linux1-X550VL:/opt/test$ javac -version
javac 1.7.0_79
linux1@linux1-X550VL:/opt/test$ ls -l
-rwxrwxr-x 1 linux1 linux1 79 10:55 Hello.java
linux1@linux1-X550VL:/opt/test$ infer -- javac Hello.java
Fatal error: exception Failure("Failed to load any Java source code")
[ERROR] Failure during frontend, original command was

[u'inferJ', u'-g', u'-a', 'infer', u'javac', 'Hello.java']

Traceback (most recent call last):
File "/usr/local/infer-linux64-v0.1.1/infer/infer/bin/inferJ", line 19, in
stats = analysis.start()
File "/usr/local/infer-linux64-v0.1.1/infer/infer/bin/inferlib.py", line 632, in start
if self.capture() == os.EX_OK:
File "/usr/local/infer-linux64-v0.1.1/infer/infer/bin/inferlib.py", line 400, in capture
return self.run_infer_frontend()
File "/usr/local/infer-linux64-v0.1.1/infer/infer/bin/inferlib.py", line 391, in run_infer_frontend
self.args.analyzer
File "/usr/local/infer-linux64-v0.1.1/infer/infer/bin/inferlib.py", line 318, in run_command
raise e
subprocess.CalledProcessError: Command '[u'/usr/local/infer-linux64-v0.1.1/infer/infer/bin/InferJava', u'-results_dir', '/opt/test/infer-out', u'-verbose_out', '/tmp/javac_iUi6Xa.out', u'-models', u'/usr/local/infer-linux64-v0.1.1/infer/infer/bin/../lib/java/models.jar', u'-no-static_final']' returned non-zero exit status 2
linux1@linux1-X550VL:/opt/test$ sudo uname --m
[sudo] password for linux1:
x86_64
linux1@linux1-X550VL:/opt/test$ cat /etc/issue
Ubuntu 14.04.2 LTS \n \l

linux1@linux1-X550VL:/opt/test$

@jvillard jvillard changed the title from Infer -- javac Hello.java not working with "Failed to load any Java source code" to `infer -- javac Hello.java` fails to run when the current path contains whitespaces Jun 28, 2015
@jvillard
Contributor

@yolinkxzw it looks like you are running infer -- javac Hello.java from a directory that does not contain the file Hello.java (infer/examples in the distribution).

@Stupidcoding: thanks for the report, that's a bug in the error handling path of javac.py! That doesn't explain the root of your issue though. It doesn't seem like it's an instance of this issue. Could you please open a new one and paste the contents of infer-out/toplevel.log there as well?

@yolinkxzw

@yolinkxzw it looks like you are running infer -- javac Hello.java from a directory that does not contain the file Hello.java (infer/examples in the distribution).

I copy Hello.java from directory infer/examples to /opt/test. Maybe, I use chinese ubuntu system, so there is some chinese word confused you. I delete chinese word and paste the error again. please check it again. Thank you!

linux1@linux1-X550VL:/opt/test$ infer -v
Infer version v0.1.1
Copyright 2009 - present Facebook. All Rights Reserved.
linux1@linux1-X550VL:/opt/test$ java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
linux1@linux1-X550VL:/opt/test$ javac -version
javac 1.7.0_79
linux1@linux1-X550VL:/opt/test$ ls -l
-rwxrwxrwx 1 linux1 linux1 79 June 27 10:55 Hello.java
linux1@linux1-X550VL:/opt/test$ infer -- javac Hello.java
Fatal error: exception Failure("Failed to load any Java source code")
[ERROR] Failure during frontend, original command was

[u'inferJ', u'-g', u'-a', 'infer', u'javac', 'Hello.java']

Traceback (most recent call last):
File "/usr/local/infer-linux64-v0.1.1/infer/infer/bin/inferJ", line 19, in
stats = analysis.start()
File "/usr/local/infer-linux64-v0.1.1/infer/infer/bin/inferlib.py", line 632, in start
if self.capture() == os.EX_OK:
File "/usr/local/infer-linux64-v0.1.1/infer/infer/bin/inferlib.py", line 400, in capture
return self.run_infer_frontend()
File "/usr/local/infer-linux64-v0.1.1/infer/infer/bin/inferlib.py", line 391, in run_infer_frontend
self.args.analyzer
File "/usr/local/infer-linux64-v0.1.1/infer/infer/bin/inferlib.py", line 318, in run_command
raise e
subprocess.CalledProcessError: Command '[u'/usr/local/infer-linux64-v0.1.1/infer/infer/bin/InferJava', u'-results_dir', '/opt/test/infer-out', u'-verbose_out', '/tmp/javac_MjXPEQ.out', u'-models', u'/usr/local/infer-linux64-v0.1.1/infer/infer/bin/../lib/java/models.jar', u'-no-static_final']' returned non-zero exit status 2
linux1@linux1-X550VL:/opt/test$ sudo uname --m
x86_64
linux1@linux1-X550VL:/opt/test$ cat /etc/issue
Ubuntu 14.04.2 LTS \n \l

linux1@linux1-X550VL:/opt/test$

@yolinkxzw

@jvillard

I try to use infer v0.2.0, the error changes. and folowing is error.

linux1@linux1-X550VL:/opt/test$ ls -l
-rwxrwxrwx 1 linux1 linux1 79 June 27 10:55 Hello.java
linux1@linux1-X550VL:/opt/test$ infer -- javac Hello.java
Fatal error: exception Failure("Failed to load any Java source code")
Traceback (most recent call last):
File "/usr/local/infer-linux64-v0.2.0/infer/infer/bin/infer", line 168, in
main()
File "/usr/local/infer-linux64-v0.2.0/infer/infer/bin/infer", line 143, in main
capture_exitcode = imported_module.gen_instance(args, cmd).capture()
File "/usr/local/infer-linux64-v0.2.0/infer/infer/bin/../lib/capture/javac.py", line 33, in capture
if self.args.debug:
AttributeError: JavacCapture instance has no attribute 'args'
linux1@linux1-X550VL:/opt/test$ ls -l
-rw-rw-r-- 1 linux1 linux1 396 June 29 11:38 Hello.class
-rwxrwxrwx 1 linux1 linux1 79 June 27 10:55 Hello.java
drwxrwxr-x 5 linux1 linux1 4096 June 29 11:38 infer-out
linux1@linux1-X550VL:/opt/test$ cd infer-out/
linux1@linux1-X550VL:/opt/test/infer-out$ ls -l
drwxrwxr-x 2 linux1 linux1 4096 June 29 11:38 captured
drwxrwxr-x 2 linux1 linux1 4096 June 29 11:38 sources
drwxrwxr-x 2 linux1 linux1 4096 June 29 11:38 specs
-rw-rw-r-- 1 linux1 linux1 733 June 29 11:38 toplevel.log
linux1@linux1-X550VL:/opt/test/infer-out$ cat toplevel.log
[INFO] Running command /usr/local/infer-linux64-v0.2.0/infer/infer/bin/infer -- javac Hello.java
[INFO] Path to infer script /usr/local/infer-linux64-v0.2.0/infer/infer/bin/infer (/usr/local/infer-linux64-v0.2.0/infer/infer/bin/infer)
[INFO] Infer version v0.2.0
Copyright 2009 - present Facebook. All Rights Reserved.

[INFO] Platform: Linux-3.16.0-30-generic-x86_64-with-Ubuntu-14.04-trusty
[INFO] PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/jdk1.7.0_79/bin:/usr/local/infer-linux64-v0.2.0/infer/infer/bin
[INFO] SHELL=/bin/bash
[INFO] PWD=/opt/test
[ERROR] Failure during frontend, original command was

[u'inferJ', u'-g', u'-a', u'infer', u'javac', 'Hello.java']

@jeremydubreil
Contributor

@yolinkxzw: do you observe the same thing with: infer -- javac -J-Duser.language=en Hello.java ?

@yolinkxzw

@yolinkxzw: do you observe the same thing with: infer -- javac -J-Duser.language=en Hello.java ?

@jeremydubreil this command fix the problem. thank you very much!

@jeremydubreil
Contributor

@yolinkxzw: Great! @occho found out that this was an when issue using Japanese as local language. Adding -J-Duser.language=en will no longer be necessary once we integrate #94.

@kageiit
Contributor
kageiit commented Apr 20, 2016

This is also a problem if the path contains ';'

@jeremydubreil
Contributor

@kageiit: Thanks for reporting this. Infer indeed crashes if the path contains a semicolon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment