-
Notifications
You must be signed in to change notification settings - Fork 632
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
Crash with 'Recursion detected' on absolute-position
#7402
Comments
absolute-position
in dynamically created element's init
absolute-position
Looks like even mentioning
|
Thanks for the detailed bug report. Regarding the |
Thanks for the time to take a look at it. Makes sense about the compiler crash being fixed with the not-yet-materialized fix. The |
Bug Description
In the provided Slint code, the program crashes when trying to read the
absolute-position
in theinit
block of a Rectangle (but issue is not limited to the Rectangle only). The specific line that causes the crash is:port.y = self.absolute-position.y;
This assignment is done within a
Rectangle
component that is part of a larger layout. However, theabsolute-position
is not accessible or valid in this context at the time of the assignment, which leads to the crash. The expectation is thatabsolute-position
should be available and usable in this situation, but it appears to be causing the program to crash instead. Or, in the very least, should not crash the program with aRecursion detected
.Reproducible Code
Link to Slintpad with this code: https://slintpad.com/?load_url=https%3A%2F%2Fgist.github.com%2Fbasdp%2F90196efdc11d4e0d82117df9051f6371
Upon further inspection, I found out this also crashes:
Slintpad: https://slintpad.com/?load_url=https%3A%2F%2Fgist.github.com%2Fbasdp%2F69a55227c846fdaaa85222e57dc495bd
Not entirely sure it's related, but at least it's another
absolute-position
in aninit
that crashes.For what it's worth, this also crashes:
... changed absolute-position => { debug(self.absolute-position); } ...
Note: the above (
changed absolute-position
) code even crashes when the callback is empty (e.g. comment out the debug line). Again, not sure if this is the same issue, or if it is a separate one.Hypothesis
I suspect it is not intended to read
absolute-position
frominit
, as theinit
callback is being called inside-out (ref: https://docs.slint.dev/latest/docs/slint/reference/common/#init). Maybe the layout pass hasn't decided its absolute position yet. If this is not intended to be called frominit
, what other options do we have to do something similar? Also, I think no Slint code should crash, so this is a bug nonetheless (?).Environment Details
Product Impact
I am making a node based editor, similar to what has been discussed here: #5248
Note, that this issue has been discussed there as crashing too. I just made a minimal example that might be easier to track.
The text was updated successfully, but these errors were encountered: