[SERVER-50233] Coverity analysis defect 115732: Division or modulo by float zero Created: 10/Aug/20  Updated: 29/Oct/23  Resolved: 13/Jan/21

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Dan Larkin-York
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2021-01-25
Participants:

 Description   

Division or modulo by float zero

This could cause an immediate crash or incorrect computation. An expression which may be zero is used as a divisor in floating-point arithmetic.
/src/mongo/db/storage/flow_control.cpp:365: DIVIDE_BY_ZERO 115732 Checking "mongo::<unnamed>::getLagMillis(myLastApplied.wallTime, lastCommitted.wallTime) < thresholdLagMillis" implies that "thresholdLagMillis" may be up to 0 on the false branch.



 Comments   
Comment by Githook User [ 13/Jan/21 ]

Author:

{'name': 'Dan Larkin-York', 'email': 'dan.larkin-york@mongodb.com', 'username': 'dhly-etc'}

Message: SERVER-50233 Prevent divide-by-zero in FlowControl::getNumTickets
Branch: master
https://github.com/mongodb/mongo/commit/fb150fd422806a14a43c99451bd5d0e2f33bb47a

Generated at Thu Feb 08 05:22:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.