I recently ran into an error that occured to me while running an Opengl ES 3 application with a memory debugging tool on an Arm Aarch64 embedded system with a powervr chip using linux.
Basically what seems to happen is that the driver tries to load a file called “/etc/powervr.ini”, allocating a buffer that is exactly as big as this file, then copies the file into it, then appearently decomposes this buffer into lines using the libc strcspn function. However, the strcspn function seems to read beyond the end of this buffer/string as it doesn’t have a null terminator.
There seems to be an EOF marker in memory but it is located right behind the end of the area allocated by malloc.
Is this problem known? If yes, has it been fixed?
Edit: May be a libc problem (version: 2.23)
Edit 2: Just a guess: Do you map stuff with mmap assuming that it will null out everything behind the map, then use c functions that need null terminated strings?