Skip to content
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

[BUG] GC error. The client crashes after each round of the game. #60

Open
jzfed opened this issue Jun 17, 2024 · 18 comments
Open

[BUG] GC error. The client crashes after each round of the game. #60

jzfed opened this issue Jun 17, 2024 · 18 comments
Labels
bug Something isn't working

Comments

@jzfed
Copy link

jzfed commented Jun 17, 2024

2024-06-18 03_01_42-DEVOUR

The game or the the DevourClient reported a GC error after each round, which causes an error and the DevourClient accesses an unreachable memory address.

Game version:
2024-06-18 03_24_56-DEVOUR exe 属性

No error in the log.

[Dissonance:Network] (19:17:58.875) BoltCommsNetwork: Client update encountered an error - shutting down client
[Dissonance:Network] (19:17:58.876) BoltCommsNetwork: Attempting to restart client
[Dissonance:Network] (19:17:58.937) BoltClient: Received a 'RemoveClient' packet with incorrect session ID. Expected 0, got 286924579
[Dissonance:Network] (19:17:59.138) ConnectionNegotiator`1: Received handshake response from server, joined session '121300627'
SteamInventory.GetAllItems(out m_SteamInventoryResult) : True -- 0
[4702 - SteamInventoryDefinitionUpdate]
[4701 - SteamInventoryFullUpdate] - 0
[4700 - SteamInventoryResultReady] - 0 -- k_EResultOK
SteamInventory.GetResultItems(0, null, out OutItemsArraySize) - True -- 0
SteamInventory.DestroyResult(0)
[4700 - SteamInventoryResultReady] - 0 -- k_EResultOK
SteamInventory.GetResultItems(0, m_SteamItemDetails, out OutItemsArraySize) - True -- 1
Items returned: 1
New items total: 1
@ALittlePatate
Copy link
Owner

Does it happen when you disable the ESP before the end of the round and activate it again once back in game ?

@jzfed
Copy link
Author

jzfed commented Jun 18, 2024

Yeah. The way you say it will happen much less often. For now, the temporary solution is to disable all ESPs at the end of each round, and then enable them again after the game start in the next round. My guess is that unreachable memory was accessed during a method call while waiting in the lobby.

File:
\lib\public\UnityEngine\Object.h

Relate code:

app::Object_1* obj_1 = app::Object_1_FindObjectOfType(reinterpret_cast<app::Type*>(object), nullptr);

Since there is no way to take screenshots when the game is stuck, I will try to send a detailed error stack the next time it happens again.

@jzfed
Copy link
Author

jzfed commented Jun 18, 2024

@ALittlePatate Below it the screenshot of error call stack. Please check it.
Error stack:

Error1:
2024-06-19 00_14_10-DevourClient (正在调试) - Microsoft Visual Studio

Error2:
2024-06-19 01_36_28-DevourClient (正在调试) - Microsoft Visual Studio

@jzfed
Copy link
Author

jzfed commented Jun 19, 2024

The temporary solution does not fix this error, and the game will still crash in 2-4 rounds. And it crashed during the game. And not just in the waiting lobby.

@jzfed
Copy link
Author

jzfed commented Jun 19, 2024

2024-06-19 17_18_21-Window

@ALittlePatate
Copy link
Owner

that's very weird, but not surprising, I heard that FindObjectOfType and FindObjectsOfType were not "thread safe", i'm not sure how it translates to the present usage tho. I'll try to think of a fix

@ALittlePatate ALittlePatate added the bug Something isn't working label Jun 21, 2024
@JozielBorges
Copy link
Contributor

2024-06-18 03_01_42-DEVOUR

The game or the the DevourClient reported a GC error after each round, which causes an error and the DevourClient accesses an unreachable memory address.

Game version: 2024-06-18 03_24_56-DEVOUR exe 属性

No error in the log.

[Dissonance:Network] (19:17:58.875) BoltCommsNetwork: Client update encountered an error - shutting down client
[Dissonance:Network] (19:17:58.876) BoltCommsNetwork: Attempting to restart client
[Dissonance:Network] (19:17:58.937) BoltClient: Received a 'RemoveClient' packet with incorrect session ID. Expected 0, got 286924579
[Dissonance:Network] (19:17:59.138) ConnectionNegotiator`1: Received handshake response from server, joined session '121300627'
SteamInventory.GetAllItems(out m_SteamInventoryResult) : True -- 0
[4702 - SteamInventoryDefinitionUpdate]
[4701 - SteamInventoryFullUpdate] - 0
[4700 - SteamInventoryResultReady] - 0 -- k_EResultOK
SteamInventory.GetResultItems(0, null, out OutItemsArraySize) - True -- 0
SteamInventory.DestroyResult(0)
[4700 - SteamInventoryResultReady] - 0 -- k_EResultOK
SteamInventory.GetResultItems(0, m_SteamItemDetails, out OutItemsArraySize) - True -- 1
Items returned: 1
New items total: 1

sounds like a problem with old memory address, maybe the ESP function is trying to get the transform position by the old round address, have you checked it ?

the ESP render thread runs in different speeds with the mainDLL thread as i know, so if the hooked DirectX 11 tries to render the ESP, and the ESP memory is not "allowed" it throws "unreachable memory address."

so one of the possible solutions is, store the current transform address and check it before the ESP try to get it, like the following code:

void GhostHandler::ProcessGhostInfo(app::Ghost* ghost) { // no address if (!ghost) return; // current round ghost if (ghost_ptr == ghost) { return; } // if the old _transform1(address) is equals to the current round ghost if (_transform1 == ghost->fields.gameobject) return; // the address is different, so we are in a new round new_ghost = true; ghost_ptr = ghost;

I'm just supposing stuffs here, i apologize for it...

@jzfed
Copy link
Author

jzfed commented Jun 22, 2024

Thanks @ALittlePatate and @JozielBorges

I don't have much experience in game development, so I can only provide stack information for reference. I'm not quite sure how the program works and the timing of the hookD3D11Present call, the crashes all happen while in multiplayer mode The root cause should be what you guys guessed. Some patterns I've found:

  • they are all ESP related
  • doesn't crash in single player mode (even if ESP is always on)

Could we avoid a program crash for now? Check the validity of the address before each drawing of the ESP, if it is a valid address continue execution, if it is an invalid address return and record it in the log.

@jzfed
Copy link
Author

jzfed commented Jun 23, 2024

Crashed in single player mode.

2024-06-24 03_43_59-DevourClient (正在调试) - Microsoft Visual Studio

2024-06-24 03_44_55-DevourClient (正在调试) - Microsoft Visual Studio

@ALittlePatate
Copy link
Owner

thanks for all the material, we're working on a fix rn

@jzfed
Copy link
Author

jzfed commented Jul 13, 2024

@ALittlePatate @JozielBorges @jadis0x
Hey, guys, the game still crashed with the latest fix version. Please help to check it. Thanks.
Below is the screenshot of stack when game crashes.
2024-07-14 03_21_27-DEVOUR (正在调试) - Microsoft Visual Studio

@JozielBorges
Copy link
Contributor

@ALittlePatate @JozielBorges @jadis0x Hey, guys, the game still crashed with the latest fix version. Please help to check it. Thanks. Below is the screenshot of stack when game crashes. 2024-07-14 03_21_27-DEVOUR (正在调试) - Microsoft Visual Studio

i haven't encountered this error yet, are you playing in single-player or multiplayer ? also the others errors you have encountered they continue to pop up ?

sorry for the late reply : (

@jzfed
Copy link
Author

jzfed commented Jul 17, 2024

@ALittlePatate @JozielBorges @jadis0x Hey, guys, the game still crashed with the latest fix version. Please help to check it. Thanks. Below is the screenshot of stack when game crashes. 2024-07-14 03_21_27-DEVOUR (正在调试) - Microsoft Visual Studio

i haven't encountered this error yet, are you playing in single-player or multiplayer ? also the others errors you have encountered they continue to pop up ?

sorry for the late reply : (

Thanks for the hotfix!

I'll test it later on your branch. This doesn't happen in-game, but on the menu screen after the main game program starts. I updated our latest code on Monday, and unfortunately the game still randomly crashes in 1 or 2 rounds. It's still the same old problem, the program is accessing memory addresses that don't exist.

I don't know much about the logic of our program, I'll make a small suggestion. Could we detect that all ESP related functions are enabled only when the game is in progress.

@JozielBorges
Copy link
Contributor

@ALittlePatate @JozielBorges @jadis0x Hey, guys, the game still crashed with the latest fix version. Please help to check it. Thanks. Below is the screenshot of stack when game crashes. 2024-07-14 03_21_27-DEVOUR (正在调试) - Microsoft Visual Studio

i haven't encountered this error yet, are you playing in single-player or multiplayer ? also the others errors you have encountered they continue to pop up ?
sorry for the late reply : (

Thanks for the hotfix!

I'll test it later on your branch. This doesn't happen in-game, but on the menu screen after the main game program starts. I updated our latest code on Monday, and unfortunately the game still randomly crashes in 1 or 2 rounds. It's still the same old problem, the program is accessing memory addresses that don't exist.

I don't know much about the logic of our program, I'll make a small suggestion. Could we detect that all ESP related functions are enabled only when the game is in progress.

Hello dear friend, how are you ?
I have done a new update in my branch, can you please test it before i do the pull request 😃?

All the changes :

  • Added a toggle feature to the key ESP // Fixed key ESP
  • Fixed issues with the demon ESP // They show up and don't crash the game : )
  • Completed fixes for ESP to prevent crashes // I've tested it for 1 hour, played the game, and had no crash. I hope that any issues with ESP crash are gone 🙏🏻

@ALittlePatate
Copy link
Owner

@ALittlePatate @JozielBorges @jadis0x Hey, guys, the game still crashed with the latest fix version. Please help to check it. Thanks. Below is the screenshot of stack when game crashes. 2024-07-14 03_21_27-DEVOUR (正在调试) - Microsoft Visual Studio

i haven't encountered this error yet, are you playing in single-player or multiplayer ? also the others errors you have encountered they continue to pop up ?
sorry for the late reply : (

Thanks for the hotfix!
I'll test it later on your branch. This doesn't happen in-game, but on the menu screen after the main game program starts. I updated our latest code on Monday, and unfortunately the game still randomly crashes in 1 or 2 rounds. It's still the same old problem, the program is accessing memory addresses that don't exist.
I don't know much about the logic of our program, I'll make a small suggestion. Could we detect that all ESP related functions are enabled only when the game is in progress.

Hello dear friend, how are you ? I have done a new update in my branch, can you please test it before i do the pull request 😃?

All the changes :

* Added a toggle feature to the key ESP         // Fixed key ESP

* Fixed issues with the demon ESP                  // They show up and don't crash the game :  )

* Completed fixes for ESP to prevent crashes // I've tested it for 1 hour, played the game, and had no crash. I hope that any issues with ESP crash are gone 🙏🏻

Hey, I think you have to create a new PR for this.
I can't begin to thank you enough for your work on the ESP, even if i don't always reply I see the messages in the issues and investigate on my free time. Right now my irl work takes the better part of my life, thanks for contributing to the project !

@JozielBorges
Copy link
Contributor

Thank you so much for your kind words! I'm glad to hear that my contributions are helpful. I completely understand how real-life work can take up a lot of time.

I'll go ahead and create a new PR for this. If there's anything specific you need or any issues you want me to prioritize, please feel free to let me know.

By the way, even though I'm kinda new to coding, if you ever need an extra pair of hands at work, I'm always open to job offers. 😉 Ahahahahhaha!

@jzfed
Copy link
Author

jzfed commented Jul 19, 2024

Hi Guys, Thanks for all your efforts.
@JozielBorges I've been testing it for a while on your last PR's branch and it's very stable at times and lasts for 2hours of gameplay. Sometimes it reports this error which related to GetTransform. Could you help to see what this problem is if you have time? I will continue to test the latest code on your branch, thanks for the quick fix.

2024-07-18 17_24_50-DEVOUR (正在调试) - Microsoft Visual Studio

@ALittlePatate
Copy link
Owner

Hi Guys, Thanks for all your efforts. @JozielBorges I've been testing it for a while on your last PR's branch and it's very stable at times and lasts for 2hours of gameplay. Sometimes it reports this error which related to GetTransform. Could you help to see what this problem is if you have time? I will continue to test the latest code on your branch, thanks for the quick fix.

2024-07-18 17_24_50-DEVOUR (正在调试) - Microsoft Visual Studio

There is a function inside Unity that can check wether or not a Gameobject is null (even if the pointer isn't), it is used in some places in the code. It is "Object::IsNull". Maybe it can solve this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants