-
-
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
ERROR: Condition "p_elem->_root != this" is true. #62970
Comments
I don't think |
This is still present in 3.5.1. I noticed that the issue cropped up while I was sending player move commands in the client. Here's the client send command method: Here's some output from the logs:
Not sure this is related, but this is when it happened. |
Is there anything I could do to get additional debug data to help with testing, @Calinou ? |
We need a minimal reproduction project, with the code isolated as much as possible, and in GDScript (to rule out C# being the cause of the bug). We can't do anything about this otherwise. |
@Calinou You are describing a bit of a chicken-egg troubleshooting challenge. I could create a reproducer if I knew what the problem was. But without additional debugging being spit out by Godot, I can't figure out what the problem is to create a reproducer. I don't even know where in the trace of my code path this error starts being generated or what part of Godot is causing it to continue to be generated. Even if we could figure out more specifically where the problem lies, having to rewrite the reproducer in GDScript could potentially be impossible if the problem is being caused by C#. As this project uses various C# libraries that have no possible analogs in GDScript, this seems like a pretty huge uplift. Put yourself in my shoes -- how would you begin to try to create a reproducer? |
If the issue is caused by C# there's no need to rewrite it in GDScript, an MRP in C# would suffice. We ask for MRPs in GDScript because it's easier for contributors to test (not every contributor uses C#) so you are more likely to get attention. Also, if creating the the equivalent MRP in GDScript does not reproduce the bug, that is a clear indication that the bug is specific to C# so it gives us a hint as to where the issue may come from.
You mentioned that you get Line 80 in 0803b41
Is this the only output you get in the console? Is there anything else that may indicate where the error comes from? Like previous messages that may indicate what was being executed immediately before the error. You can try removing parts of your game until the error stops happening to try and find what causes it, you probably already have an idea of what part of the code is most likely the cause based on what you were doing when the error occurred so try with that first. Since you seem to be using asynchronous methods, take a look at those because it's likely they are not synchronized with Godot's main thread. For example, you are calling CallDeferred("add_child", missileInstance); Alternatively, if you are willing to build Godot from source, you can try running the binary with |
This PR switched everything to
Other than what I've shared above, there is no indication of what is spawning the error. But, once it starts, it seems to spew forever until the client is stopped. It sounds like building Godot from the source may be the only option to troubleshoot further because I can't imagine we will make much more progress without a full stack trace. |
I took a quick spin of the docs and didn't see anything special related to generating debugging symbols. Does this happen automatically when building? |
Oops, totally missed that this issue was about 3.x. I believe in 3.x the debug symbols are generated by default. |
OK well, I have it built, but I don't understand how to use What is the |
@thoraxe I imagine you need this: https://www.cse.unsw.edu.au/~learn/debugging/modules/gdb_conditional_breakpoints/ |
@raulsntos unfortunately, If I set the breakpoint at line 80, I get a PILE of breakpoints, and Godot effectively gets broken/paused constantly because
The above makes Godot unusable. Do you have any other suggestions on how I can use GDB to only break/pause/etc when it spits out this error? Or is there a way to make Godot spit out the backtrace when that error happens? Like can I add something to the macro code? |
Would it be acceptable if I took the macro code and modified WDYT? |
AFAIK the macro is just a compile-time replacement so it should be the same, also feel free to make any modifications you need if they help you debug the issue such as using Once you locate the source of the issue, you may be able to reproduce it more easily without modifying Godot's source code. |
Yes, I'm going to swap the macro call for the code from the macro itself and put that in Alternatively, I have not tried to use VScode to build the Godot project, which could let me debug/backtrace directly in VScode. That may be my next step if I continue to struggle with GDB. |
I added I'm not sure if this is helpful. |
OK, I was finally able to get the debugger inside the game at the time the error condition is raised. Here's the stack at that moment:
I don't know if this tells you anything. |
@raulsntos FYI I took all of the async things that were happening when messages were received and put them into queues that are then processed during I did a quick test with a bunch of players and did not hit this error. We're going to do a deeper soak test later this week but this might have fixed it. Will report back accordingly. |
Did it? |
Just to +1 thoraxe's possible solution, I'd been bashing my head against the same error for a while. |
Since switching to using queues, we have apparently eliminated this problem. It no longer seems to be happening. I can't claim direct causation, but the correlation is strong. However, using standard C# I am closing this as no longer an issue due to a lack of other evidence to show that it's still a problem. Thanks, all, for the tips. |
Godot version
v3.4.4.stable.mono.official.419e713a2
System information
Linux (Fedora), Intel Graphics
Issue description
I am getting this error, which appears to be a recurring problem now and again. It is not clear when it starts occurring or what causes it explicitly.
You can see my entire game client here:
https://github.com/redhat-gamedev/srt-godot-client
There are many closed issues related to this error:
https://github.com/godotengine/godot/issues?q=%22p_elem-%3E_root+%21%3D+this%22+is%3Aclosed
The two that are potentially the most closely related are the following:
#22565
#20085
These both mention threading and node manipulation. The second one explicitly mentions the use of "add_child".
In the game client, there are really only two places where add_child is meaningfully used:
https://github.com/redhat-gamedev/srt-godot-client/blob/main/Scenes/MainScenes/Game.cs#L134
https://github.com/redhat-gamedev/srt-godot-client/blob/main/Scenes/MainScenes/Game.cs#L165
Neither seems to reliably produce the error.
Steps to reproduce
Unfortunately I have no reliable reproducer.
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: