[SERVER-69184] Coverity analysis defect 128686: Using a moved object Created: 26/Aug/22  Updated: 29/Oct/23  Resolved: 12/May/23

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 7.1.0-rc0, 7.0.0-rc1

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Sanika Phanse (Inactive)
Resolution: Fixed Votes: 0
Labels: coverity, neweng, sharding-nyc-subteam1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Assigned Teams:
Sharding NYC
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.0
Sprint: Sharding NYC 2023-05-15
Participants:
Story Points: 1

 Description   

Using a moved object

Using a moved object may lead to an unexpected/undefined behavior. An object is used after it's moved.
/src/mongo/db/s/resharding/resharding_metrics.cpp:79: USE_AFTER_MOVE 128686 "role" is moved (indicated by "std::move(role)").
/src/mongo/db/s/resharding/resharding_metrics.cpp:79: USE_AFTER_MOVE 128686 "role" is used after it has been already moved.



 Comments   
Comment by Githook User [ 12/May/23 ]

Author:

{'name': 'Sanika Phanse', 'email': 'sanika.phanse@mongodb.com', 'username': 'sphanse99'}

Message: SERVER-69184 Coverity analysis defect 128686: Using a moved object
Branch: v7.0
https://github.com/mongodb/mongo/commit/267c35e051709fa2c827bf11b2a439a6635aba94

Comment by Githook User [ 12/May/23 ]

Author:

{'name': 'Sanika Phanse', 'email': 'sanika.phanse@mongodb.com', 'username': 'sphanse99'}

Message: SERVER-69184 Coverity analysis defect 128686: Using a moved object
Branch: master
https://github.com/mongodb/mongo/commit/3524229a9780f5dfbbf2beba978629ac8e908f82

Generated at Thu Feb 08 06:12:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.