mtrace(1) and mtrace(3) are my new bicycle. The
manual for debugging tool design should read SEE ALSO mtrace(1),
mtrace(3). One header file, one environment variable and one on/off
switch.
The catch to this free lunch is that it doesn't completely work with C++.
If run over a C program, it can print the file/line that allocated a leaked
block. If run over a C++ program, it can't do anything but count
blocks that are allocated but not freed. This is still gun-in-a-knife-fight
useful. Saying it's a C++ issue is a bit of a lie: because the
new and delete operators use malloc
internally, allocations using these operators are reported as coming from
libstdc++. If you use malloc in C++, it works fine. Because
the actual call to malloc or free is within
new or delete, the file/line notation is at best
useless and at worst an unadorned memory address.
I found it beneficial to create a single-threaded "test script" version
of my program for mtrace-ing. With a bunch of threads thrashing about,
there was too much noise from freeing memory that had been allocated in
other threads for the output to be very useful. Fortunately, removing
threads was (for me) a functional and expedient solution.
The bug turned out to be difficult to find but embarrassing, so I'm
not going to tell you what it was.
Comments (4)
How do programmers like Aker or why or John Resig get so much done?
Perhaps the answer is that they have that dream job that allows you to
play all day. Perhaps they really are superhuman engineers. Either way,
I've been itching to do something with this growing list of
projects scribbled on my coffee table. How about a blog post? Yes.
FireDopplr extension for Flickr Uploadr
This one's for Aaron. I suspect it'll turn out to be more of a Dopplr
extension for Uploadr
because of Fire Eagle's insistence on forgetting historical data. I've
sadly fallen off on the Flickr hacking since leaving there and really
should take this as an opportunity to revisit. Plus, there's so much new
API goodness to explore.
More smarts for Curvr
I've made incremental fixes to Curvr since writing it but
have yet to really take on a big enhancement. It performs well on sunny
days but suffers badly in low-contrast situations. The low-hanging fruit
is to look into the EXIF data to process differently based on the aperture
and shutter speed (as a way to infer how much light was available) and
whether the flash fired (in which case I'd like to give up).
XULRunner really did follow me to my new job
I haven't looked into it fully but I see a Windows service control
extension for XPCOM in my future. Bleak, I know.
But wait, there's OAuth
I will procrastinate as long as I possibly can on this one but I may
end up having to be the guy to write a C/C++ OAuth client. That'll be
one for the day job.
My evil overlords at City Hall have changed a bunch of street cleaning
schedules and replaced easy-to-parse descriptions with pains-in-my-ass like
"1st and 3rd Tuesdays." Oh joy-of-joys, now my parsing must be sensitive to
the current week and not just the current day. As I type this it's actually
getting easier in my head. If your neighborhood was recently changed, have
no fear, I'll be back to save you from parking tickets once more.
I am doubly encouraged by the accumulation in front of me. First, I'm
still unsatisfied, thinking and tinkering. Second, I have no time to
actually do anything about it because I'm enjoying my job at OpenDNS.
Perhaps if I keep this up I'll never be a super-hacker.
Comments (2)
I really did make a mistake a few weeks ago, losing my old Wordpress blog,
the theme, and all of the non-Wordpress extras I had in that directory tree.
More fuel for the argument that upgrading Wordpress is too hard. I thought
I was smart enough to do it. I was wrong. So I took that as motivation to
build the command-line blog I’ve always wanted. Then I went on
vacation. As you can see, it's finished now. More soon on the code.
I kept a text file open during my flights to and from Kentucky. On the
plane I was reading The World Is Flat and it surprisingly tempered
very few of the thoughts I liked enough to write down. (Afterthoughts
in bold.)
The things that suck about being an adult are the same ones that suck
about being a kid: dishes, laundry and paying for things. The rest is just
details.
My del.icio.us network is better for me than Digg/Reddit/whatever because
I trust the sources. I don’t like everyone being little CmdrTacos.
I’m the Commander and I pick my Generals carefully. (After
reading Del.icio.us vs. Friendfeed.)
Neverminding your opinion of Chris Matthews and his Hardball
show, it’s depressing that the airport cuts away from the last 20
minutes in favor of an Olympic human-interest segment on using chopsticks in
Beijing.
I also spent some time thinking about my upcoming move. Moving within
the city and with over a year’s experience living here have
significantly changed my criteria. Most importantly, Katherine will be
moving out, too. Beyond the need for a bigger apartment, here are some
of my current considerations:
- Opportunity to grill.
- A deck or yard or something to go with the grilling.
- Dishwasher.
- A proper sink in the kitchen instead of the miniature joke of one
I have now. This is perhaps less important with the addition of a
dishwasher.
- More windows! I miss my 7-window bedroom from senior year of
college.
- A grocery store within walking distance. (I’ve grown quite
fond of Real Foods being 3 blocks from my house.)
Lesser concerns that didn't make the cut:
- A garage.
- Non-coin-operated laundry.
- Higher-speed Internet access (LAN, plz).
Anything I’m missing?
Comments (3)