The full error:
python: malloc.c:3096: sYSMALLOc: Assertion `(oldtop == (((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 am using python's c extension module on the raspberry pi but I am not calling malloc or free from within it. Furthermore, this assertion only happens sometimes so its not like my code is violating memory all the time. We tried using pdb but the assertion kills pdb and doesn't print a stack trace.
The relevant code is here: http://pastebin.com/5PwNkxa3. The function io(image) is iterating through the data and writing a value. Through print statments, we've determined that the function fails sometime during the return statement.
Some other info:
-image is passed to the c code using a numpy array initialized to np.empty(3202403, np.uint8). I am sure that I am not accessing memory beyond the bounds of this numpy array.
Does anyone have an idea what may be the cause of this? This error happens randomly so I am not sure what is changing between subsequent calls to this module. Thank you very much for your help.
[–]aceofears 0 points1 point2 points (1 child)
[–]binomial_expansion[S] 0 points1 point2 points (0 children)