local-ci: clang-format hangs in bmcweb sometimes

Lei YU mine260309 at gmail.com
Tue Nov 5 16:46:54 AEDT 2019


On Tue, Nov 5, 2019 at 10:11 AM Lei YU <mine260309 at gmail.com> wrote:
>
> While trying to run local-ci on bmcweb, it's found that the
> clang-format hangs sometimes.
>
> Top shows it's consuming 100% CPU on a single core and the memory
> consumption is increasing.
>
> Smaple top output:
>
>    PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
>  99536 leiyu     20   0 97.067g 0.095t  19520 R 100.0 10.8  10:39.18
> clang-format-8
>
> You can see it already takes 10 minutes and it consues nearly 100GiB memory.
>
> It does not happen always, and it seems like it's happening when I run
> local-ci for a second time.
> E.g. the first local-ci runs OK on a clean repo, and the second
> local-ci run hits the above issue.
>
> Is that known issue?

It looks like it *always* happens on the second run of local-ci, as
long as the repo is not cleaned.

The root cause could be:
1. YOCTO_DEPENDENCIES is disabled by default, so the local-ci
downloads and extracts 3rd party code, e.g. sdbusplus, boost, etc.
2. In the second run of local-ci, format-code.sh finds all the source
code including 3rd party, and run clang-format, and it hangs badly.

So we could either enable YOCTO_DEPENDENCIES by default or put the 3rd
part code's path into ".clang-ignore", so that it's skipped by
format-code.sh.
Ideas?


More information about the openbmc mailing list