evaG
evaG

Reputation: 21

c++ running error

I am getting this error while running my-program (which compiles fine with g++):

my-program: malloc.c:2451: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.

I usually understand the error but this time I have no idea what's wrong.

Upvotes: 0

Views: 906

Answers (1)

Oliver Charlesworth
Oliver Charlesworth

Reputation: 272457

There was a failure inside malloc, which means that you've probably corrupted the heap. Probably by writing past the end of some dynamically-allocated memory somewhere.

Upvotes: 5

Related Questions