Closed Bug 1605879 Opened 5 years ago Closed 5 years ago

./mach static-analysis is failing when too many files

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

defect
Not set
normal

Tracking

(firefox74 fixed)

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: Sylvestre, Assigned: andi)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Example

$ ./mach static-analysis check --checks="-*,readability-redundant-smartptr-get" dom/

returns:

Error running mach:

    ['static-analysis', 'check', '--checks=-*,readability-redundant-smartptr-get', 'dom']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

OSError: [Errno 7] Argument list too long

  File "/home/sylvestre/dev/mozilla/mozilla-central.hg/python/mozbuild/mozbuild/code-analysis/mach_commands.py", line 285, in check
    line_handler=output_manager.on_line, cwd=cwd)
  File "/home/sylvestre/dev/mozilla/mozilla-central.hg/python/mach/mach/mixin/process.py", line 124, in run_process
    p.run()
  File "/home/sylvestre/dev/mozilla/mozilla-central.hg/testing/mozbase/mozprocess/mozprocess/processhandler.py", line 811, in run
    self.proc = self.Process([self.cmd] + self.args, **args)
  File "/home/sylvestre/dev/mozilla/mozilla-central.hg/testing/mozbase/mozprocess/mozprocess/processhandler.py", line 123, in __init__
    universal_newlines, startupinfo, creationflags)
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception

We should probably split the execution

Andi, rings a bell?

Flags: needinfo?(bpostelnicu)
Blocks: 1538770

This is a side effect once we added https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/code-analysis/mach_commands.py#2022 since what we do now is we build a list with all of the files from the path that we specify and past it to run-clang-tidy.py. I propose to keep the list but do something similar to what we do here: https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/code-analysis/mach_commands.py#2179. We will run run-clang-tidy.py on sized chunks.

Flags: needinfo?(bpostelnicu)
Assignee: nobody → bpostelnicu
Attachment #9119155 - Attachment description: Bug 1605879 - for `clang-tidy` based static-analysis pass the files for analysis in fixed size chuncks. r=sylvestre → Bug 1605879 - for `clang-tidy` based static-analysis pass the files for analysis in chuncks. r=sylvestre

The priority flag is not set for this bug.
:Sylvestre, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(sledru)
Pushed by sledru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ca5a75b0c9df for `clang-tidy` based static-analysis pass the files for analysis in chuncks. r=sylvestre
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74

Thanks andi!

Flags: needinfo?(sledru)
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: