-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
random getornull error spammed in console #60406
Comments
@AndHalfAFish Please upload a minimal reproduction project to make this easier to troubleshoot. In the future, please do not create issues if you have neither reproduction steps nor a minimal reproduction project. |
Thanks for including the complete error message this time 🙂 You said that this occurs regardless of whether your project is using any breakpoints. Could you upload a project where you've gotten this error message to appear even when there are no breakpoints set?
We have a lot of issue reports. Godot's issue tracker is one of the most active issue trackers on all of GitHub – about 25 new issues are created every day on average. However, we only have a limited amount of contributors willing to triage, comment and resolve issues. We have to be selective about the kinds of issue reports we can accept, so we can ensure that valid issue reports have a chance to be resolved. Over the years, we are becoming more selective on issue reporting to keep issue quality high. Most software projects out there do something similar as the community grows. For reference, cc @tinmanjuggernaut, as they made #54650 but it apparently didn't resolve the issue on your end. Perhaps @lawnjelly knows something about this too. |
I was just about to delete my (snippy) reply (sorry - I was frustrated), but you had already answerred. Thanks for taking the time ! =) I do understand your point, but, having worked as a software analyst and project manager (small team, but working together with other teams on a larger project), I have always preferred to be made aware of a problem even if I knew my team would not have the time to look into it / fix it. I did (of course) do a web search before reporting the problem, and I did find out that this also happened randomly in other people's projects and with different versions of Godot. |
This might need a project that shows these errors, or running with a Although the main build doesn't give much info, it's a bit of a generic error which if I remember right usually means it is trying to get an object from a RID that is referring to an object that has already been deleted (dangling RID), or a RID from another owner or garbage RID is calling If you use a build with the My memory is a bit hazy of this, maybe Probably also the gdscript for those functions in the callstack would be useful info too, or some indication what they are doing. |
@Calinou They? @lawnjelly did not accept my RID rewrite and rolled his own in #54907 Also my other rid PR #55764 has long been ignored, even after prompting. Maybe that PR fixes the issue for Op. However, it's just as plausible that a new instance of rid abuse was created, as the root cause wasn't fixed in what was merged. #54907 (comment) At the least, rid tracking should be the default setting in release_debug builds so that rid abuse can be identified quickly by all users. If it takes effort just to get an error message from users, how much more effort will it take to get them to make a custom build? Lol. The next 3.5 beta is the ideal time to turn this on. @akien-mga @AndHalfAFish RIDs are used throughout the entire engine. Right now, your environment is the only known one with this error message. Most other instance of these messages regarding Id maps and rids were resolved with other changes that came about due to #53374. This is an example of a thorough report that led to a major system getting rebuilt. Please check it out so you get a sense of what is useful when tracking intermittent errors. It is not happening randomly. It is happening after you are doing something. Maybe several somethings. It could be switching scenes. It could be clicking a UI element. It could be just moving the mouse. Regardless, it's helpful to know what you and your code are doing at the moment the errors are triggered. This means having the console on screen all the time so you can observe, then documenting behavior. For the instances you gave:
You could include some of your code identified in the error message stack trace. We need to know if you're operating with the editor in code, the physics system (2d or 3d), the visual server, the gridmap, or some other system that uses Id maps. We don't know anything about your project, whether it's 2D or 3D, or what portions of the engine you're using, or even a game/plugin/app, etc. The fastest way for this to be fixed is for you to make a custom build of the engine with rid tracking as Lawnjelly stated, and described in #54907. This will print out the sources of rids so the right section of code can be identified. Without any of this information, it could be months, years, or never until this is fixed as right now you're the only one with the environment and any info about it. |
I compiled a Godot 3.5beta4 64-bit Windows editor debug binary with Make a backup of your project before using this build, just in case. |
Thank you all ! Maybe this is a good time to remind you, the engine builders, that we, the Godot users, also care about what happens to the engine. Just like you, we have invested a lot of time and energy into it. Many of us want to help .. but the only way we know how to, is by report bugs to the best of our ability (which might not always be up to your standards). =) |
I think things like this need a check by reduz, you might need to pester him on rocketchat. I added another comment on the PR though as it was a while since I looked at it.
This is perhaps something we could consider now some time has passed. As far as I remember it from the time:
The other question is whether we might use On the other hand there is always the potential to introduce new nasty hard to find bugs if we change this in the release templates, particularly threading bugs, which the handles is more susceptible to. So on balance I am probably still slightly in favour of keeping the current release template to use I'm personally fairly agnostic on this really, and we should also weigh in how often RID errors happen in practice (not very often it seems now that we have fixed the major existing bugs), and we do have the tools to investigate them now when they do crop up. Another option is to build with |
Update : @Calinou : last night, I tried your Godot 3.5beta4 version and I did no longer see the bug brought on by placing a breakpoint in my code, and then running the game (F5) I am using Godot 3.4.4 in my project, so I was wondering if maybe I caused the bug by changing something in the Godot settings (project or editor). So, I re-downloaded from the webside. This morning, I tried compiling from source : setting up : 1) Python 3.8.1 , 2) SCons script: v3.1.2 (2019-12-17), engine: v3.1.2 (2019-12-17) download src : 3.4.4-stable (source code as zip) from github releases build with default settings to see if everything works : build with tracked_handles arg (not sure if I did this correctly) : Notes : Let me know if there's anything else I can do. godot.344.w.BP.1.mp4 |
Good, you have a reproducible error. As soon as you do that action in the video 112 errors appear. Let's look at your console, and the log file. Please post the whole thing of a single run. Attach text files. Also what is the code that is run immediately after the click, and for the next 3 seconds while the errors appear? Edit: Also project settings are saved in your project folder, so apply to any version of the engine you run. |
I found a log file here : C:\Users\sc\AppData\Roaming\Godot\app_userdata\Shade\logs The 2 different warnings are from before the time when this error started showing up. The error happens with the breakpoint placed at different places within that function ( do_hsd_click() ), eg/ BP at lines 39, 43, 55, ... The one shown in the clip is for line 79. Only 1 breakpoint is placed per run. After running through that function, some _process() code runs in several files (setting a bool for an animationplayer, or checking player move ftionality). These bits of _process() code are used by other files as well. After testing some other files that have a do_hsd_click() function (placed BP on the first line of code within) : it appears they have the same problem even though the scenes don't share assets and the code within the function is different. The function do_hsd_click() is called from an obj_under_mouse() function. I'm currently using 2 different versions but they give the same result (error if BP). Next when I have some more time, I will check inventory code. |
Yes. These log files did give us new information:
You mean two versions of the engine? 3.4.4-stable and ?? But the 3.5b4 from Calinou does not produce errors? These errors only appear if there is a breakpoint set, otherwise not? I don't see the RID database, that should have been built with
Ah, #54907 has the RID database, which was merged into 3.x on Dec 2021. It is not in 3.4. Please build from the 3.x source and see if you get an RID database. Perhaps the reason you don't see the errors in Calinou's 3.5 build is because the problems were already fixed. Most likely the cause is in the engine, not your code. But you may be using a function of the engine that has the bug that not many others are using, or if they are, they aren't triggering the error. RID errors are like a 2-key door. One key causes the problem, another key triggers the error but is unrelated to the cause, both are necessary to get the error. Let's wait until you can get the error message in any of the 3.5 builds, or preferably your own 3.x build with |
@tinmanjuggernaut : Thanks for your help ! 'You mean two versions of the engine?' 'Please build from the 3.x source and see if you get an RID database.' 'Most likely the cause is in the engine, not your code.' |
The command is correct, the code base is not. Rid handles is not in 3.4. It's only in 3.5, or the 3.x branch. |
Sorry, what is the 3.x branch ? Is 3.4 not a 3.x branch ??? |
The branch is called 3.x That is where 3.5 and beyond are being developed. |
thanks |
Thanks to @tinmanjuggernaut for helping with this.
When it is compiling correctly you should see a "WARNING: Building with RIDs as tracked handles." message in the scons output. If it isn't happening in Calinou's 3.5 build, then it suggests:
It would be interesting to try it with e.g. 3.5 beta 4 and confirm whether or not the problem occurs, if you haven't already, that should let us know whether it is something that is fixed in 3.5 at least. One thing that can definitely cause all kinds of bugs is multithreading, if you are using any of this in your scripts, that would be helpful to know. From your later output it seems like the problem is occurring with a texture RID. Other than that, it may be necessary to create a minimum reproduction project, as tracking down RID bugs is incredibly difficult without the handles build (well that was our experience with the previous RID bugs). In fact even with info from the handles build it is likely we'd end up needing an MRP to solve this. Some tips for creating a MRP are here: Another option if and only if it is fixed in 3.5, is for you to manually bisect the commits and find the commit that fixed it. This can be quite time consuming, and is only worth providing instructions if we can confirm it is fixed in 3.5 and have exhausted other options I guess. |
Alright, some more info : . Calinou's 3.5b4 build (debug build) : placing breakpoint is fine . I'm not using multithreading . I'll try to create am MRP ... but, this isn't a project I started last month =) Question : what actually happens when I place a breakpoint in the editor (I have no experience with engine code) ? How can it introduce a bug/bring a bug to the foreground in something I wrote ? |
I'm unfamiliar with how the editor breakpointing is implemented, but you could have, for example, the editor trying to print out the value of some local variable that has just been deleted (QTCreator actually has / had a similar bug). There's still a huge amount of possibilities here, that probably only an MRP can be used to pin down. In terms of differences between the handles build and non-handles, one possibility is that there is a mutex in the handles build which may make it more thread safe in some situations. If you managed to compile and run both a 3.x (i.e. the current Godot 3 master branch) regular debug build and a 3.x tracked_handles debug build that would be comparing apples to apples and be slightly better to deduce this. But really the MRP is the biggest priority. For the MRP, you should be able to use https://en.wikipedia.org/wiki/Bisection_method to eliminate large parts of your project quickly, you don't have to remove one node at a time, remove entire branches. And the project doesn't have to "run", if the error appears in the editor. If it is taking you a significant amount of time, you are probably doing it wrong (it should probably take 5-30 mins max). Another possibility if you feel this is beyond you, is to email a private confidential link to one of the core devs (we often end up doing this for bespoke help with games). |
@lawnjelly : I have managed to create a much smaller project (zip 2.75MB) ... How do I get it to you ? |
@AndHalfAFish: You can attach files to GitHub comments or to the opening post of this issue. Zip files are accepted. |
Yes you can either (preferably) just drag and drop a zip file into a post on here, or you can email me if it contains assets you don't want public. My username here @gmail.com . 🙂 |
The 2 files of interest are res://game.gd and res://p5_spiro.gd When you run the project, you'll see a 'gear' object and a 'table' object, as well as an inventory. |
Quoting from the doc I posted:
Given that this is a reference counting bug, it is possible that it is a misuse of references in the gdscript (rather than an engine bug). This should become more obvious with an MRP. |
I suspect the error is happening here:
That might tally in with it calling Can confirm if that 3rd line is commented out, the RID error is gone. So it looks like the refcount of "res://icons_inv/objs/p5_p" is out of sync because it is still being used somewhere. Where else are you using this "res://icons_inv/objs/p5_p" texture? Ok the plot thickens, as I suspected something is also being set as a result of mouse click (which may come in out of sync or on another thread?):
This line is also being called perhaps causing a race condition here. My best guess is that something in the ordering of events is getting mucked up by having the breakpoint in the debugger in the Godot IDE. I have absolutely no idea how the debugger works, so this issue may end up needing to be solved by someone who works on the debugger. But yes paring it down to an MRP is necessary I think before spending more time investigating this. |
You know ... that's a weird name "p5_p". It should have some numbers, and end in "_cell.png" or "_dv.png". Can you let me know if the name really is "p5_p", or if it is "p5_p20c_cell.png" ? The problem area you're describing, is where I set an image following the mouse pointer, depending on whether an item is clicked in the inventory. If something is selected, the mouse image is changed to that of the selected object. If nothing is selected, the image goes back to the 'empty' image. But yes, I'll continue to try and get rid of more stuff in the project. |
This is a limitation of the debugger in QTCreator I'm currently using, it only seems to display a certain number of characters. So it is one of those two textures likely. |
@lawnjelly : Based on all the information you gave me, I decided to print out the RIDs of the Textures used in the inventory. Result :
=> bp is reached before last RIDs print (= expected) . conditions (game.gd) of err with bp :
=> last RIDs print before bp is reached ; seems as if bp stops inventory code right in the middle of it removing the gear texture from the inventory (=white image displayed) I have made recordings of the RID prints in both situations (1 and 1.7 MB) and another recording focussing on the white image. I'm not sure if it's ok to post all of them, so I'll just post the last one. Let me know if you want to see the other ones too. getornull_a_bp_err_2_cut.mp4 |
For completeness : there is an even smaller project now. I also added the other movie clips (show the timing of the RID refresh for the cell images in the inventory) |
@AndHalfAFish Can you (or anyone else) still reproduce this bug in Godot 3.5.1 or any later release? |
Hi,
I tried the minimal_project in Godot 3.5.1.
I still get the same error (only when I place a breakpoint), but there is no longer any console spamming. [attachment console.png]
I have found a way to work arround the issue, so for me it's ok if you put it in the 'some-day' bin. It may be some weird timing issue specific to my project ...
Siska.
Sent with [Proton Mail](https://proton.me/) secure email.
…------- Original Message -------
On Sunday, November 6th, 2022 at 6:32 PM, Hugo Locurcio ***@***.***> wrote:
***@***.***(https://github.com/AndHalfAFish) Can you (or anyone else) still reproduce this bug in [Godot 3.5.1](https://godotengine.org/article/maintenance-release-godot-3-5-1) or any later release?
—
Reply to this email directly, [view it on GitHub](#60406 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AOCYBZSH2NPCEEI25NVNIELWG7TUNANCNFSM5T6PU7ZA).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Attachment didn't attach |
I was referring to this : #60406 (comment) |
Godot version
3.4.4
System information
windows 10
Issue description
I've been getting a lot of 'getornull' errors lately.
I'm not sure what's causing them (seems random).
One thing that seems to trigger them sometimes, is adding a breakpoint.
I also got them with a faulty decision tree, and when trying to assign a non-existant animation to an animationplayer. I think these should give me different error messages, no ?
The only thing I can think of that might be causing this, is perhaps a high(er) vertex count ??? But the error doesn't happen all the time, so ... ?
Steps to reproduce
random error spam
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: