Fiber lambda being optimised out? #1258
-
I want to use a Fiber to periodically call the lvgl event loop. It failed (crashes), it only wanted to run in a loop in main(). In the debugger I finally saw that it crashes, a var was marked as "optimized out" early on in the lvgl code. After moving the little loop code to a function and calling the loop once from the main() loop and the lambda Fiber, it works! Is there a cleaner way to do this?
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
That's… odd, I don't have an immediate answer. You can see the annotated dis-assembly with |
Beta Was this translation helpful? Give feedback.
-
Ok, not a known something with Fiber. Or a apply this or that C++ macro sort of thing. |
Beta Was this translation helpful? Give feedback.
-
ok, it is not optimised out. I tried like bunch of things, but in the end, it is lvgl that crashes internally. |
Beta Was this translation helpful? Give feedback.
-
testlvgl.zip Edit: Forgot to say that the test is as small as can be, to isolate as much as possible. |
Beta Was this translation helpful? Give feedback.
-
lvgl-linux-modm.tar.gz |
Beta Was this translation helpful? Give feedback.
Thanks for the simplified example, I was able to reproduce your exact issue.
You're running into a fiber stack overflow. This is caught by the scheduler if you implement the
modm_abandon
handler.Try increasing the stack size. 2kB is enough for the simple example, but you'll likely need more for complex rendering.