main: malloc.c:2405: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize – 1)) == 0)’ failed.
This most likely means that there is a mistake regarding usage of “sizeof”
Reference
Various methods to allocate 2D array: https://www.geeksforgeeks.org/dynamically-allocate-2d-array-c/
Common mistake: https://stackoverflow.com/questions/46803671/sysmalloc-assertion