infer icon indicating copy to clipboard operation
infer copied to clipboard

OSError: [Errno 7] Argument list too long

Open tianyutingxy opened this issue 10 years ago • 4 comments

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

tianyutingxy avatar Dec 30 '15 10:12 tianyutingxy

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

Thanks.

martinoluca avatar Jan 08 '16 09:01 martinoluca

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.

jeremydubreil avatar Jan 08 '16 23:01 jeremydubreil

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.

jvillard avatar Apr 20 '16 15:04 jvillard

@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

agpelliza avatar Feb 28 '19 12:02 agpelliza