-
Notifications
You must be signed in to change notification settings - Fork 62
[GEN][ZH] Fix uninitialized memory read in DockUpdate::loadDockPositions #731
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
[GEN][ZH] Fix uninitialized memory read in DockUpdate::loadDockPositions #731
Conversation
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.
Maybe add helmutbuhler as Co-Author when he participated? See https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors
Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/DockUpdate.cpp
Outdated
Show resolved
Hide resolved
GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/DockUpdate.cpp
Outdated
Show resolved
Hide resolved
GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/DockUpdate.cpp
Outdated
Show resolved
Hide resolved
68f9887
to
001bf8f
Compare
Updated with requested changes, just needs rebasing once main is confirmed okay after the hashmap reversion and testing for Compat issues now. |
001bf8f
to
f0d3328
Compare
Rebased with main and pushed so ready for testing. |
Can you give some more details? I just tested the build from CI and it works fine for me. |
Simply I used VC6 one, started the golden replay then exited the game. It
immediately crashed. I have a Ryzen cpu
A quarta, 23/04/2025, 22:38, helmutbuhler ***@***.***>
escreveu:
… *helmutbuhler* left a comment (TheSuperHackers/GeneralsGameCode#731)
<#731 (comment)>
add a replay mismatch in vc6 version, but worse than that. launching any
replay then pressing exit game, gives a immediate crash to desktop:
Can you give some more details? I just tested the build from CI and it
works fine for me.
—
Reply to this email directly, view it on GitHub
<#731 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC2N4ZYPFFEIZ6VLBOMZ6U323AB4VAVCNFSM6AAAAAB3P7F752VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMRVGU2TMMBSGU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Does the binary from CI crash for you as well? I have a Ryzen too, but it doesn't crash for me. |
It was the binary from the ci
A quinta, 24/04/2025, 08:57, helmutbuhler ***@***.***>
escreveu:
… *helmutbuhler* left a comment (TheSuperHackers/GeneralsGameCode#731)
<#731 (comment)>
Does the binary from CI crash for you as well?
You'll find it here:
https://github.com/TheSuperHackers/GeneralsGameCode/actions/runs/14611589339/artifacts/2991550194
I have a Ryzen too, but it doesn't crash for me.
—
Reply to this email directly, view it on GitHub
<#731 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC2N4Z535VYRZN35I7ETVET23CKOPAVCNFSM6AAAAAB3P7F752VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMRWG4YDOMJQGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Can you please download the binary from my link and try again? |
Ok
A quinta, 24/04/2025, 11:30, helmutbuhler ***@***.***>
escreveu:
… *helmutbuhler* left a comment (TheSuperHackers/GeneralsGameCode#731)
<#731 (comment)>
Can you please download the binary from my link and try again?
—
Reply to this email directly, view it on GitHub
<#731 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC2N4Z3NJVBEQPO6GN24ZDT23C4NBAVCNFSM6AAAAAB3P7F752VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMRXGEZDONRQHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
it did crash again |
how to reproduce, load a big replay and ff it. wait some time (20~30s should suffice). then exit game |
I get this error in the main branch as well, without this PR. |
Thanks! I was just about to post as @roossienb that this bug already exists in main. It seems to be what's discussed here: #645 |
Yeah. Sorry about this.
No mismatch then in regards to supply docks on vc6
A sexta, 25/04/2025, 07:46, helmutbuhler ***@***.***>
escreveu:
… *helmutbuhler* left a comment (TheSuperHackers/GeneralsGameCode#731)
<#731 (comment)>
how to reproduce, load a big replay and ff it. wait some time (20~30s
should suffice). then exit game
Thanks! I was just about to post as @roossienb
<https://github.com/roossienb> that this bug already exists in main. It
seems to be what's discussed here: #645
<#645>
—
Reply to this email directly, view it on GitHub
<#731 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC2N4Z673YPMP2T3MV3PAF323HK4JAVCNFSM6AAAAAB3P7F752VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMRZGUYTOMZQGY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
f0d3328
to
6806a2c
Compare
Just rebased this on Main with the recent fixes that should resolve the crash on exit problems. Might be worth a quick retest with replays but it should be good to go. |
4c40871
to
32f2d94
Compare
Tweaked the comment and updated. Fewer than the number of values within the array can be copied to it, but the whole array is considered at a later point so the remaining bins needs to be zeroed. |
Just watched your discussion about this. The point of my comment was to indicate that there are two variables involved, m_numberApproachPositionBones and m_numberApproachPositions, and that they are not used as originally intended. It's easy to confuse this when reading this code (as you two did yourself at first). You can rephrase that if you want, but don't just delete it. I also noted in the original PR about this:
I stumbled upon this while simulating the golden replay without client updates. In that case the stack memory is not all 0 and it mismatches. Other than that, thank you for handling this! |
32f2d94
to
9288b19
Compare
I optimized the description for this change. |
9288b19
to
4c1e902
Compare
Revisited code comment once more after revieweing helmut's last review comment. |
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.
Looks good to me.
…ons() (#731) Co-authored-by: Helmut Buhler <buhler@8gadgetpack.net>
4c1e902
to
a6c5d8d
Compare
This fix was originally discovered by @helmutbuhler and split out of the original PR it was contained in.
This fix initiallises an array that is used immediately but not all of the bins are updated with data.
This can result in random contents being included instead of being zeroed.