KEMBAR78
SIGFPE on system with zero in /cgroup/cpu/cpu.cfs_period_us · Issue #2173 · ninja-build/ninja · GitHub
Skip to content

SIGFPE on system with zero in /cgroup/cpu/cpu.cfs_period_us #2173

@lrtfm

Description

@lrtfm

In the code, to calculate the cpu limit, if the value of /cgroup/cpu/cpu.cfs_period_us is 0, the program will generate the signal SIGFPE. Should we protect this by checking the value of period.first?

code:

return quota.first / period.first;

The error information:

Program received signal SIGFPE, Arithmetic exception.
0x000000000042d2d5 in ParseCPUFromCGroup() () at ./src/util.cc:650
650       return quota.first / period.first;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions