[SERVER-36810] Coverity analysis defect 104983: Unchecked return value Created: 22/Aug/18  Updated: 29/Oct/23  Resolved: 14/Sep/18

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 4.1.4

Type: Bug Priority: Minor - P4
Reporter: Coverity Collector User Assignee: Jonathan Reams
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: Platforms 2018-09-24
Participants:

 Description   

Value returned from a function is not checked for errors before being used

Defect 104983 (STATIC_C)
Checker CHECKED_RETURN (subcategory none)
File: /src/mongo/transport/service_executor_reserved.cpp
Function mongo::transport::ServiceExecutorReserved::_startWorker()::[lambda() (instance 1)]::operator ()() const::[lambda() (instance 1)]::operator ()() const
/src/mongo/transport/service_executor_reserved.cpp, line: 90
Calling "subtractAndFetch" without checking return value (as is done elsewhere 3 out of 6 times).

                _numRunningWorkerThreads.subtractAndFetch(1);



 Comments   
Comment by Githook User [ 27/Sep/18 ]

Author:

{'name': 'Jonathan Reams', 'email': 'jbreams@mongodb.com', 'username': 'jbreams'}

Message: Revert "SERVER-36810 fix unused return value for coverity"

This reverts commit 4fe0de9a46492e9fa747e88234e483d172d9c410.
Branch: master
https://github.com/mongodb/mongo/commit/5c7428d4ef708d2d627ebe63c4c97007e8329582

Comment by Githook User [ 14/Sep/18 ]

Author:

{'name': 'Jonathan Reams', 'email': 'jbreams@mongodb.com', 'username': 'jbreams'}

Message: SERVER-36810 fix unused return value for coverity
Branch: master
https://github.com/mongodb/mongo/commit/4fe0de9a46492e9fa747e88234e483d172d9c410

Comment by Gregory McKeon (Inactive) [ 11/Sep/18 ]

CR: https://mongodbcr.appspot.com/245120001/

Comment by Eric Milkie [ 22/Aug/18 ]

Should we assert that we don't go below zero for this subtractAndFetch?

Generated at Thu Feb 08 04:44:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.