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

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

Closed
lrtfm opened this issue Jul 28, 2022 · 1 comment
Closed

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

lrtfm opened this issue Jul 28, 2022 · 1 comment
Labels
Milestone

Comments

@lrtfm
Copy link
Contributor

lrtfm commented Jul 28, 2022

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;
@jhasse jhasse added this to the 1.11.1 milestone Aug 23, 2022
@jhasse jhasse added the bug label Aug 23, 2022
@jhasse jhasse closed this as completed Aug 23, 2022
jhasse pushed a commit that referenced this issue Aug 30, 2022
bradking pushed a commit to bradking/ninja that referenced this issue Oct 6, 2022
PolynomialDivision pushed a commit to PolynomialDivision/ninja that referenced this issue Nov 3, 2022
@AyandaRevon
Copy link

*123

johanneslerch pushed a commit to johanneslerch/ninja that referenced this issue Jun 2, 2023
This will fix the issue (ninja-build#2173).

(cherry picked from commit d502d19)
johanneslerch pushed a commit to johanneslerch/ninja that referenced this issue Jun 2, 2023
This will fix the issue (ninja-build#2173).

(cherry picked from commit d502d19)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
@jhasse @lrtfm @AyandaRevon and others