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

OSError: [Errno 7] Argument list too long #228

Closed
tianyutingxy opened this issue Dec 30, 2015 · 4 comments
Closed

OSError: [Errno 7] Argument list too long #228

tianyutingxy opened this issue Dec 30, 2015 · 4 comments

Comments

@tianyutingxy
Copy link

Traceback (most recent call last):
File "/Users/tianyutingxy/Android/github/infer/infer/bin/infer", line 168, in
main()
File "/Users/tianyutingxy/Android/github/infer/infer/bin/infer", line 143, in main
capture_exitcode = imported_module.gen_instance(args, cmd).capture()
File "/Users/tianyutingxy/Android/github/infer/infer/bin/../lib/capture/gradle.py", line 47, in capture
return util.run_commands(cmds)
File "/Users/tianyutingxy/Android/github/infer/infer/bin/../lib/capture/util.py", line 36, in run_commands
if not cmd.start():
File "/Users/tianyutingxy/Android/github/infer/infer/bin/inferlib.py", line 650, in start
if self.capture() == os.EX_OK:
File "/Users/tianyutingxy/Android/github/infer/infer/bin/inferlib.py", line 417, in capture
javac_status = self.compile()
File "/Users/tianyutingxy/Android/github/infer/infer/bin/inferlib.py", line 414, in compile
return self.javac.run()
File "/Users/tianyutingxy/Android/github/infer/infer/bin/jwlib.py", line 45, in run
subprocess.check_call(javac_cmd, stderr=file_out)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 535, in check_call
retcode = call(_popenargs, *_kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 522, in call
return Popen(_popenargs, *_kwargs).wait()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 7] Argument list too long

still on Infer version git-712d27b5445da91cffad410ca71d31135f351259

@martinoluca
Copy link
Contributor

Hello @tianyutingxy,
can you please provide more information about how you are getting this problem?

Thanks.

@jeremydubreil
Copy link
Contributor

Thanks @tianyutingxy for reporting this. It seems to me that the Gradle integration is creating javac command lines with a number of file exceeding the bash limit. The current Gradle integration is mostly a proof of concept to show that we can analyze Gradle projects with Infer but is very fragile. We are working on a much more robust way to integrate Infer with Java built systems. I will update this issue once it is ready.

@jvillard
Copy link
Contributor

The gradle integration reads the list of Java files to compile from a file, not from the command line, precisely to avoid this error (#131) . Without more information, it's hard to know what's wrong here, so I'm closing this task. Feel free to re-open with more info.

@agpelliza
Copy link

@jvillard @jeremydubreil @martinoluca I'm having this same issue running infer with ant, from a brew install in OSX. Here is the stack trace and the error:

Traceback (most recent call last):
  File "/usr/local/Cellar/infer/0.15.0/lib/infer/infer/bin/../lib/python/infer.py", line 203, in <module>
    main()
  File "/usr/local/Cellar/infer/0.15.0/lib/infer/infer/bin/../lib/python/infer.py", line 185, in main
    capture_exitcode = imported_module.gen_instance(args, cmd).capture()
  File "/usr/local/Cellar/infer/0.15.0/lib/infer/infer/lib/python/inferlib/capture/ant.py", line 84, in capture
    return util.run_compilation_commands(cmds)
  File "/usr/local/Cellar/infer/0.15.0/lib/infer/infer/lib/python/inferlib/capture/util.py", line 46, in run_compilation_commands
    if cmd.start() != os.EX_OK:
  File "/usr/local/Cellar/infer/0.15.0/lib/infer/infer/lib/python/inferlib/jwlib.py", line 35, in start
    raise e
OSError: [Errno 7] Argument list too long
Internal Error:   /usr/local/Cellar/infer/0.15.0/lib/infer/infer/bin/../lib/python/infer.py
  -j 4 --project-root /Users/my_user/my_project
  --out /Users/my_user/my_project/infer-out -- ant
  build_war:
  exited with code 1
Error backtrace:
Raised at file "base/Die.ml" (inlined), line 25, characters 6-36
Called from file "base/Logging.ml", line 314, characters 58-80
Called from file "integration/Driver.ml", line 159, characters 2-16
Called from file "integration/Driver.ml", line 280, characters 6-420
Called from file "infer.ml", line 20, characters 2-36
Called from file "infer.ml", line 130, characters 8-54

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

5 participants