Details
Description
Following test suite in Evergreen has a few divide by zero errors:
For example, one instance of this error is as follows:
I was able to reproduce this bug locally by adding the following assert:
--- a/src/support/time.c
|
+++ b/src/support/time.c
|
@@ -7,6 +7,7 @@
|
*/
|
|
#include "wt_internal.h"
|
+#include <float.h>
|
|
/*
|
* __time_check_monotonic --
|
@@ -89,6 +90,7 @@ __wt_tsc_to_nsec(WT_SESSION_IMPL *session, uint64_t end, uint64_t begin)
|
if (end < begin)
|
return (0);
|
tsc_diff = (double)(end - begin);
|
+ WT_ASSERT(session, S2C(session)->tsc_nsec_ratio > DBL_EPSILON);
|
return ((uint64_t)(tsc_diff / S2C(session)->tsc_nsec_ratio));
|
}
|
(gdb) bt
|
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
|
#1 0x00007f01e16ee37a in __GI_abort () at abort.c:89
|
#2 0x00007f01e1ddbd90 in __wt_abort (session=0x55d63caaacf8) at ../src/os_common/os_abort.c:31
|
#3 0x00007f01e1e2c8e6 in __wt_assert (session=0x55d63caaacf8, error=0, file_name=0x7f01e1e7f950 <__func__.33150> "__wt_tsc_to_nsec", line_number=93, fmt=0x7f01e1e7f94b "%s") at ../src/support/err.c:501
|
#4 0x00007f01e1e3e33d in __wt_tsc_to_nsec (session=0x55d63caaacf8, end=8169080459640816, begin=8169080459607018) at ../src/support/time.c:93
|
#5 0x00007f01e1d3ba9a in __wt_write (session=0x55d63caaacf8, fh=0x55d63cac1a80, offset=0, len=21, buf=0x7f01e1e64790) at ../src/include/os_fhandle.i:198
|
#6 0x00007f01e1d452d1 in __conn_single (session=0x55d63caaacf8, cfg=0x7ffc402cb670) at ../src/conn/conn_api.c:1776
|
#7 0x00007f01e1d473a4 in wiredtiger_open (home=0x7ffc402cd0be "sec-db-copy/", event_handler=0x0, config=0x55d63caaac20 ",,log=(recover=error)", connectionp=0x7ffc402cb760) at ../src/conn/conn_api.c:2501
|
#8 0x000055d63a8cd686 in main (argc=2, argv=0x7ffc402cb8d0) at ../src/utilities/util_main.c:278
|
(gdb) f 4
|
#4 0x00007f01e1e3e33d in __wt_tsc_to_nsec (session=0x55d63caaacf8, end=8169080459640816, begin=8169080459607018) at ../src/support/time.c:93
|
(gdb) p ((WT_CONNECTION_IMPL *)(session)->iface.connection)->tsc_nsec_ratio
|
$1 = 0
|