Monday, August 15, 2011

Yesterday I found an annoying bug in some vector code I was working on. Initially I thought it was a math problem, but then I noticed that some line segments were coming back from a function call modified. Basically, I was sending in a line with a random slope, and coming back with a flat line.

It turned out that I was attempting to re-use a struct that was almost guaranteed to be freed. The fact that it came back flat was because I malloc a set of flat lines to test for bounds. So, the fact that it was flat was totally coincidental - it just happened to malloc an area which previously stored a valid variable, thus resulting in undefined behavior. Probably when that line was later freed it would crash.

I went on a hike with some friends. We talked about movies and I watched Kiss of Death. Very decent movie. Features babysitter-fucking. Patched a huge rip in my bike tire. Thought it was too big to patch, but then it turned out fine. Cleaned house quite a bit. Did lots of laundry. Hardly cooked at all, mostly grazed.

Almost modeled at the weekly life-drawing class. Kind of disappointed that I didn't get to. The room was locked and the model hadn't showed up. We were going to improvise, but couldn't find an even moderately suitable location. It would have been a lot of fun, and I think out of all the young people there I was the only one who wasn't too self-conscious to get naked in front of strangers.

No comments:

Post a Comment