[SERVER-55620] Coverity analysis defect 117956: Uninitialized scalar field Created: 30/Mar/21  Updated: 27/Oct/23  Resolved: 30/Mar/21

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: David Storch
Resolution: Works as Designed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Sprint: Query Execution 2021-04-05
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/scan.h:174: UNINIT_CTOR 117956 Class member declaration for "_catalogEpoch".
/src/mongo/db/exec/sbe/stages/scan.cpp:385: UNINIT_CTOR 117956 Non-static class member "_catalogEpoch" is not initialized in this constructor nor in any functions that it calls.



 Comments   
Comment by David Storch [ 30/Mar/21 ]

This is a false positive, so I'm closing it as "Works as Designed". It is true that the SBE scan stage (as well as pscan and ixscan) do not initialize their _catalogEpoch member variable on construction. Instead, the design is to initialized it during prepare() and subsequently make use of it when the plan is save/restored in order to detect whether the catalog has been closed and reopened.

milkie I seem to no longer be able to log into Coverity in order to mark this report as a false positive. Do you know who might be able to help me log in?

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