Thursday, December 19, 2019

Where am I?

Over the course of this week I've been mostly investigating the final memory leaks on GWindow in Linux. There are only two left but they're from the same source and both the same amount of bytes. 40 bytes, that is. I jumped firmly over the garden wall in my search to unravel these and as I continue I'm feeling like I'm getting more and more lost instead of closer to the answer.

Valgrind gives me a stack trace of the leaks and it reports each bit of memory as advancing from unitTestMain all the way to the very first call of OpenWindow in the GWindow unitTests, enters the function, and disappears.

The very last place the memory can be seen is hitting the XInitThreads function from X11, so I decided to start trying to unravel that knot.

The first day of my search I exhausted a pretty high number of resources to tell me what XInitThreads does, and ended up further into the woods. Both descriptions I could find had the same unhelpful, copy-pasted description.

The second day of my search I exhausted even more resources looking for a definition of the function, only to find nothing by lunchtime. I spent the rest of the day trying and hoping to find something else in the code that would be leaking the memory instead and got further into the woods.

The third day Alex gave me a source for the X11 repo and I downloaded it to start searching for the source code of XInitThreads and after scouring the entire thing the only thing I found was, guess what, more trees.

Today I'm back to trying to drag out the source code from anywhere on the internet. My hope has been gone for a while, this is an awful problem to try to fix. If nothing comes up by the end of the day I may just hard eject from the situation and try to start something new once the break is over. Two blocks of 40 bytes that only leak once isn't the worst memory leak ever, and I'm certain there's something more important I could be doing with all the time I've wasted trying every combination of words to ask Linux for help.

No comments:

Post a Comment