From d502d19378a40a77a8d66f55c35d8c50c99a2423 Mon Sep 17 00:00:00 2001 From: Yang Zongze Date: Thu, 28 Jul 2022 14:35:24 +0800 Subject: Fixbug: SIGFPE error when cpu.cfs_period_us = 0 This will fix the issue (#2173). --- src/util.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util.cc b/src/util.cc index 483f4a6..ef5f103 100644 --- a/src/util.cc +++ b/src/util.cc @@ -647,6 +647,8 @@ int ParseCPUFromCGroup() { readCount(cpu->second + "/cpu.cfs_period_us"); if (!period.second) return -1; + if (period.first == 0) + return -1; return quota.first / period.first; } #endif -- cgit v0.12