LVGL crashes on petalinux/zynq-7000

I use the current v8.3.10 version from github. I just copied the code into my project(Vitis, arm-gcc, cross-compile on windows host machine), setup the lv_conf.h to support 32bit per pixel, enable transparent background.

Code compiles fine but I get all sorts of random crashes related to memory management. It crashes at some realloc step where it tries to resize a NULL pointer during initialization.

Disabling custom memory management(LV_MEM_CUSTOM 0) results in an assertion fail in lv_tslf.c, line 458, function “block_next”.

I tried to debug it but the overall behaviour seems just odd to me. It seems that LVGL does not use the malloc/free provided by the linux environment at all steps.

Is this an issue with the current version, or do I miss something?

My code:

buf1 = (lv_color_t *)malloc(MY_DISP_HOR_RES * MY_DISP_VER_RES / 5 * sizeof(lv_color_t));


	lv_disp_draw_buf_init(&draw_buf, buf1, NULL, MY_DISP_HOR_RES * MY_DISP_VER_RES / 5);

	lv_disp_drv_init(&disp_drv);          /*Basic initialization*/
	disp_drv.flush_cb = lvglDisplayFlush;    /*Set your driver function*/
	disp_drv.draw_buf = &draw_buf;        /*Assign the buffer to the display*/
	disp_drv.hor_res = MY_DISP_HOR_RES;   /*Set the horizontal resolution of the display*/
	disp_drv.ver_res = MY_DISP_VER_RES;   /*Set the vertical resolution of the display*/
	dispPtr = lv_disp_drv_register(&disp_drv);      /*Finally register the driver*/

	lv_obj_set_style_bg_opa(lv_scr_act(), LV_OPA_TRANSP, LV_PART_MAIN | LV_STATE_DEFAULT);
	lv_disp_set_bg_opa(NULL, LV_OPA_TRANSP);

	EnableVMixOverlayLayer(0, 0, MY_DISP_HOR_RES, MY_DISP_VER_RES, XVMIX_LAYER_5, addr);

	printf("INFO: Finished display init, sizeof lv_color_t %d!\n", sizeof(lv_color_t));
	label = lv_label_create(lv_scr_act());
	lv_label_set_text(label, "Hello");
	lv_obj_set_style_text_color(label, lv_color_hex(0xffffff), LV_PART_MAIN);
	lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);

You can refer to the answer here: Under what condition would tlsf_assert(block_size(block) >= size) occur - #3 by FASTSHIFT