- Some leaks in gtk
- Read 1 to 8 bytes outside a block..... (That can sometimes be ok)
When you say leaks in gtk, do you mean that gtk will throw up some false positives that I need to ignore to focus on the errors caused by my code?
Your crash, and the leaks are not related.
A leak is memory that is never freed. Other than running out of memory, it will not cause crashes.
You are writing to "the wrong mem" (either never allocated, freed, or cross boundaries (enable range checks!)).
valgrind reports both.
As for the "gtk leaks" I do not know if they are in gtk or lcl. But I know you get a lot of reports.
You are looking for errors like
==23779== Invalid write of size 4
==23779== Address 0x4c30068 is 0 bytes after a block of size 40 alloc'd
or the memory is part of a block that was freed.
You will get traces
- where the error happened,
- where the memory was allocated
- and where it was freed (in case of)
You may also have read errors that are relevant. Reading from a block that was freed could cause crashes too.
Reading just 1 to 3 bytes extra could be something the compiler added, and that will do no harm.
I.e. if you read a single byte from memory that was allocated as 1 byte only, the cpu may read a full integer, and then use only the byte. But valgrind will report it. (as it technically is out of bounds)
But reading more than 3 bytes behind the block, may indicate a real error.
There may be an option (not sure) to suppress the leak reports, since you do not need them (well not to find the crash)