-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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 _get_debug_tooltip
crash if tooltip string is too large
#81018
Fix _get_debug_tooltip
crash if tooltip string is too large
#81018
Conversation
0ef617c
to
e46b31e
Compare
Related / Alternative PR: |
Oh I missed that, but there is on other thing I can do to help this pr. |
e46b31e
to
eb1c773
Compare
eb1c773
to
a602682
Compare
_get_debug_tooltip
will crash if tooltip string is too large
abf7e19
to
93203dc
Compare
_get_debug_tooltip
will crash if tooltip string is too large_get_debug_tooltip
crash if tooltip string is too large
93203dc
to
9854f31
Compare
I would suggest word "truncated" instead of "overflowing". Overflow sounds like an error to me. |
a2ca2f5
to
8e19994
Compare
8e19994
to
28d8251
Compare
I think that warning is excessive, and will end up spamming users that hover over some long values. Nothing they can do about it either, so it's not very useful. I also think 200 is a very short threshold? What kind of content do we expect there? |
Just the content shown when you hover over a gdscript variable. The crash I tried to fix comes from a extremely large json map, the whole content of this map will crash vulkan since the tooltip box is too long, vma can't allocate so much big. |
28d8251
to
0867a27
Compare
@jsjtxietian Well, yes, I understand that. But I assume that a very large JSON is far beyond 200 characters? I'm just trying to see if this is not an overzealous threshold. |
Yes, > 1w characters.
It maybe too small, but as far as I can see, a tooltip longer than several dozens is already hard too read. 200 is just an arbitary number I chose, it can be changed. Just a safe guard to prevent vulkan's crash. I feel the ultimate solution for this should be a tooltip like what you can get from visual studio (rather than just a tip) , you can expand it to see the whole content. |
I think this threshold can be extended to 250 or even 300, but I'm fine with the idea in principle. Remember to test this at high editor scales too, as the issue may occur earlier at high editor scales. |
Tested locally, 300 with scale at 200% is fine. |
Not that it matters much whether it's 200 or 300, but let's go with that, I guess :) Could you also put the number into a local constant so it's easier to modify if needs be and so it's less magical? |
Oh another thing, I just found that we can use '\n' to seperate strings so they won't become too long, should I do something like , let's say after every 50 characters, insert a '\n' into it. |
I think for now plugging the crash is what's important. Improving usability or solving this in a better way can be done later. |
0867a27
to
2e715bb
Compare
2e715bb
to
155d738
Compare
Thanks! |
Cherry-picked for 4.1.4. |
This pr solves part of #80959
There are three problems raised from this issue, this pr only deals with the problem that if the stack variable's tooltip string is smaller than 1Mb ( if bigger than 1Mb, the case is addressed by another pr) but still very big, vulkan will crash at creating the buffer for the tooltip's flat style box since it's too long.
I choose to truncate the string at position 200 and append a ' [...] overflowed!' at the end of the string. The number is arbitrary but I dont think it's necessary to expose the value for user to config.