[How to] How to solve this runtime error?


I create some projects with lvgl dev7.0 based on commit d108b2e.
Normally they can run fine.

However sometime some project can run for a while
(sometime about 10minutes, sometime more than 30 minutes)
, it occurs a runtime-error.

When I check at this runtime-error by decoding the error’s stack .
It shows some messages that the error occurs at

lv_task_handler()  at D:\Arduino\libraries\.....\lvgl-dev-7.0\src\lv_misc\ 
lv_task.c line 181

When I look at lv_task.c (dev7.0 commit d108b2e ) line 181

L178:    time_till_next = LV_NO_TASK_READY;
L179:    next = lv_ll_get_head(&LV_GC_ROOT(_lv_task_ll));
L180:    while(next) {
L181:        if(next->prio != LV_TASK_PRIO_OFF) {
L182:            uint32_t delay = lv_task_time_remaining(next);
L183:            if(delay < time_till_next)
L184:                time_till_next = delay;
L185:        }
L187:        next = lv_ll_get_next(&LV_GC_ROOT(_lv_task_ll), next); /*Find the next task*/
L188:    }
L190:    already_running = false; /*Release the mutex*/

I dont’ have any idea to solve the task’s error at L181.
How to solve this error that occurs by lv_task_handler() ?

Thank you very much.

What MCU/Processor/Board and compiler are you using?

  • ESP32

What do you want to achieve?

What have you tried so far?

Code to reproduce

Screenshot and/or video

It’s probably a memory corruption issue. next is probably pointing to an invalid task.

1 Like

If next is NULL , it doestn’t go into the while loop ?

Do you have any idea how to check variable next ?

next is probably an invalid value (not NULL). I suggest you use a debugger and set a breakpoint on the fault handler.

1 Like

Can you enable logginf of LVGL with TRACE level?

You can also add enable LV_USE_ASSERT_MEM_INTEGRITY. In some places it checks if there is memory corruption.

Can you somehow reduce the object used on the screen to see which one causes the corruption?

1 Like