ceph-mon crashes with *** Caught signal (Floating point exception) **
#2 Updated by Dan Mick about 6 years ago
With no OSDs in the cluster, the calculations for
pgs_per_osd can divide by zero (integer, but that still causes the FPE).
int expected_osds = MIN(p.get_pg_num(), osdmap.get_num_osds()); int64_t new_pgs = n - p.get_pg_num(); int64_t pgs_per_osd = new_pgs / expected_osds;
expected_osds can be zero.
Looking briefly, there are a few other places in OSDMonitor where /0 looks possible:
float up_ratio = (float)up / (float)osdmap.get_num_osds();
float in_ratio = (float)in / (float)osdmap.get_num_osds();
two instances of:
double halflife = (double)g_conf->mon_osd_laggy_halflife; double decay_k = ::log(.5) / halflife;
It might be good to review Coverity and maybe increase the priority of such warnings.