The Boston Diaries

The ongoing saga of a programmer who doesn't live in Boston, nor does he even like Boston, but yet named his weblog/journal “The Boston Diaries.”

Go figure.

Saturday, June 06, 2015

I'm lucky in that I run the server, so I can do this type of debugging

As I was unable to reproduce the issue on the development system, but it was all too easy to reproduce on server, I had no choice but to debug on the server. It's not an ideal situation but in this case, as I run the server in question and the appropriate software tools are installed, I figured I might as well debug on the server.

The approach I took is one I've been using for a long time—insert this bit of code:

volatile int g_debug = 1;


into the proper code path (in this case, the program was crashing in cmd_cgi_post_show(), which is the function called when I want to preview a post from the web interface). Then I can submit the data, the web server will spawn mod_blog, and the infinite loop will give me a chance to attach the debugger to it (setting up a fake web environment to debug CGI programs is a pain). And from there, it was pretty straightforward to isolate the issue by setting breakpoints and examining memory.

The issue ended up being multiple calls to free(), and I suppose the difference in behavior between the development system and server can be attributed to the different versions of the standard C library. Yes, in an ideal world, there would be no difference between the two, but this isn't an ideal world and I have to make do with what I have.

Obligatory Picture

[It's the most wonderful time of the year!]

Obligatory Contact Info

Obligatory Feeds

Obligatory Links

Obligatory Miscellaneous

You have my permission to link freely to any entry here. Go ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or entry, if there is only one entry). The titles are the permanent links to that entry only. The format for the links are simple: Start with the base link for this site:, then add the date you are interested in, say 2000/08/01, so that would make the final URL:

You can also specify the entire month by leaving off the day portion. You can even select an arbitrary portion of time.

You may also note subtle shading of the links and that's intentional: the “closer” the link is (relative to the page) the “brighter” it appears. It's an experiment in using color shading to denote the distance a link is from here. If you don't notice it, don't worry; it's not all that important.

It is assumed that every brand name, slogan, corporate name, symbol, design element, et cetera mentioned in these pages is a protected and/or trademarked entity, the sole property of its owner(s), and acknowledgement of this status is implied.

Copyright © 1999-2021 by Sean Conner. All Rights Reserved.