Lv_snapshot_take is leading to segmentation fault

I’m using LVGL v8.3 with sdl and using as simulator in linux system. I have changed the LV_USE_SNAPSHOT to 1 and I’m allocating memory of LV_MEM_SIZE (8192 * 1024U) in lv_conf.h file. when I call the function lv_snapshot_take I am running into segmentation fault. I debugged the code by using gdb and the problem is the display driver user data is pointing to null. And while trying to dereference it and accessing renderer object the segmentation fault is happening. I checked during the initialization of display driver the user data is not pointing to null. I’m not able to figure it out where the problem is. Looking for any suggestions or solutions.
My code looks like

lv_obj_t * src = lv_scr_act(); // Get the active screen
lv_img_dsc_t * snapshot = NULL;
snapshot = lv_snapshot_take(src, LV_IMG_CF_TRUE_COLOR_ALPHA);
if(snapshot == NULL ){
printf(“Failed to take snapshot\n”);

The following image contains the information that acquired during debugging with gdb.