-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Steam input "crc" errors, and some other Coverity reports of uninitialized scalar variable #91454
Conversation
@@ -141,7 +141,7 @@ struct ReflectionAtlas { | |||
int size = 0; | |||
|
|||
int mipmap_count = 1; // number of mips, including original | |||
int mipmap_size[8]; | |||
int mipmap_size[8] = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a bunch more issues with uninitialized stuff in rendering code, would be good for the rendering team to make a pass on the reports and decide whether to init all the structs properly, or what other approach to take. We've had a number of bugs on some platforms/GPUs due to uninitialized struct members.
} else { | ||
ERR_FAIL_MSG(vformat("GL ERROR: Invalid or unhandled source '%d' in debug callback.", source)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC @lawnjelly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I'm in the blame this is because I'm registered as initial author for 4.x, but this was copy pasted from 3.x GLES2, which is karrofel it looks like.
But fix looks fine to me. 👍
} else if (type == _EXT_DEBUG_TYPE_PERFORMANCE_ARB) { | ||
strcpy(debType, "Performance"); | ||
} else if (type == _EXT_DEBUG_TYPE_OTHER_ARB) { | ||
strcpy(debType, "Other"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed as the early return makes it dead code.
@@ -236,7 +236,7 @@ struct ReferenceContext { | |||
/** | |||
* Include the declaration of the current symbol. | |||
*/ | |||
bool includeDeclaration; | |||
bool includeDeclaration = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int bits[TileSet::CELL_NEIGHBOR_MAX] = {}; | ||
bool is_valid_bit[TileSet::CELL_NEIGHBOR_MAX] = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC @groud
@@ -1495,6 +1495,7 @@ void Input::parse_mapping(const String &p_mapping) { | |||
JoyAxis output_axis = _get_output_axis(output); | |||
if (output_button == JoyButton::INVALID && output_axis == JoyAxis::INVALID) { | |||
print_verbose(vformat("Unrecognized output string \"%s\" in mapping:\n%s", output, p_mapping)); | |||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it makes sense, I didn't notice that detail when changing the error message to a warning 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this should also fix these issues:
float z_far = 0.0; | ||
float y_offset = 0.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about these. To me it seems totally pointless to initialize certain variables when we don't know if they will be used. The trouble is that we assign an RID before configuring the light. So the Coverity scan doesn't have enough information here to be really useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed these changes from the PR for now.
thirdparty/enet/enet/godot.h
Outdated
uint8_t host[16] = {}; | ||
uint16_t port = 0; | ||
uint8_t wildcard = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC @Faless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is C code so my fix was invalid, would need a different approach. Removed from this PR for now.
int variablesReference; | ||
bool expensive; | ||
int variablesReference = 0; | ||
bool expensive = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC @rsubtil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, expensive
ended up never being set in the code, so this was actually causing undefined behavior.
I can confirm it should be false
as AFAIK Godot still doesn't support partial/pagination behavior to requesting variables from stack dumps, so there's no point in hinting such behavior to DAP when Godot will already have all that information.
String format; | ||
bool sendTelemetry = false; // Just in case :) | ||
bool showUser; | ||
bool sendTelemetry = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There goes my little easter egg 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brought it back ;)
7e056c2
to
39b0ed1
Compare
…itialized scalar variable - Fixes godotengine#88630. - Fixes godotengine#92578.
39b0ed1
to
62120c7
Compare
Going through a few reports on https://scan.coverity.com/projects/godotengine-godot?tab=overview
Lots of low hanging fruits there to improve the code quality and find potential bugs.
The input mapping change fixes these issues: