https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116637
--- Comment #4 from Greg Morse <pgmer6809 at yahoo dot com> --- the error comes from an attempt to do a malloc or calloc; it does not come from an attempt to use the pointer.the assertion that causes the crash comes from the malloc source code see here: ******>>>> malloc.c:2617: 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. it has nothing to do with MY code or MY bug. I know exactly which statement fails and when (on the second call). On Friday, September 6, 2024 at 11:43:48 p.m. PDT, pinskia at gcc dot gnu.org <gcc-bugzi...@gcc.gnu.org> wrote: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116637 --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- This sounds like going to past the bounds of the calloc. Try using valgrind or -fsanitize=address one of those two will catch where your bug is.