[SERVER-57797] Coverity analysis defect 120188: Uninitialized scalar field Created: 17/Jun/21  Updated: 27/Oct/23  Resolved: 29/Aug/22

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Backlog - Query Execution
Resolution: Gone away Votes: 0
Labels: coverity, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Operating System: ALL
Participants:

 Description   

Uninitialized scalar field

The field will contain an arbitrary value left over from earlier computations. A scalar field is not initialized by the constructor
/src/mongo/db/exec/sbe/stages/ix_scan.h:119: UNINIT_CTOR 120188 Class member declaration for "_catalogEpoch".
/src/mongo/db/exec/sbe/stages/ix_scan.cpp:69: UNINIT_CTOR 120188 Non-static class member "_catalogEpoch" is not initialized in this constructor nor in any functions that it calls.



 Comments   
Comment by Mihai Andrei [ 24/Jun/21 ]

I think this can be resolved as 'gone away' now that SERVER-57774 is in (_catalogEpoch and _collName now get default constructed to boost::none)? 

Comment by Ethan Zhang (Inactive) [ 22/Jun/21 ]

https://github.com/mongodb/mongo/blob/master/src/mongo/db/exec/sbe/stages/ix_scan.h#L119
https://github.com/mongodb/mongo/blob/master/src/mongo/db/exec/sbe/stages/ix_scan.cpp#L41

Also, should it be cloned in clone()?

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