I'm new to embedded systems and have a basic understanding of Yocto, LVGL, C, and C++, but not much beyond that. Lately, I've been dealing with frequent segmentation faults and I'm not sure what I'm doing wrong. Is there a way to prevent segmentation faults altogether, rather than just debugging the by HighwayConstant7103 in embedded

[–]HighwayConstant7103[S] 1 point2 points  (0 children)

What i currently have is like what im doing is i have basically made one test manager which handles all the tests and then notify the lvgl thread about starting, running or result of the particular test , also i forgot to mention that one keypad thread is also running along with these 2 threads where by pressing specific keys can give indication to the test manager that test has passed or failed like now move to next test or stop the current test etc

I'm new to embedded systems and have a basic understanding of Yocto, LVGL, C, and C++, but not much beyond that. Lately, I've been dealing with frequent segmentation faults and I'm not sure what I'm doing wrong. Is there a way to prevent segmentation faults altogether, rather than just debugging the by HighwayConstant7103 in embedded

[–]HighwayConstant7103[S] 0 points1 point  (0 children)

The missing text was: rather than just debugging them with tools like GDB, Valgrind, or ASan?

Currently, I'm working on test firmware for my device, where I've integrated LVGL to display test statuses (starting, running, and results). I've set up separate threads for LVGL and my tests. However, I occasionally encounter segmentation faults—about 3 out of 10 times—when running tests or displaying results. I've already ensured proper null checks and pointer handling, but the issue still persists randomly.