Using the provided sample code for the PIC32 platform and FreeRTOS v202112.00. I ran into an issue in tasks.c when enabling the compiler optimizations (XC32 v4.00 compiler, -O2 optimization).
The exception happens in
xTaskResumeAll() when the
listREMOVE_ITEM macro tries to remove an item with a null pointer as the container. The macro creates a pointer pxList and de-references it without checking if it is NULL, causing an exception.
In my case, it seemed to be caused by an aggressive compiler and the fix was to add
#define configLIST_VOLATILE volatile in FreeRTOSConfig.h
I think nevertheless the pointer should be checked for non-null in the macro to gracefully handle exceptions.