Projects completed

My current home improvement projects are finally finished, when I had the remaining tile put down today.

I started this series of projects in December, when I converted a spare bedroom to an office, with built-in cabinets & desks. Next, I had my patio enclosed. Finally I had the patio tiled & replaced the carpet in my dining room with tile.

My condo association has also been doing a lot of work in the last few months. We just put in 100 new palm trees to replace destructive black olive trees. Last weekend I helped lay down sod around some of the new trees. We just finished installing lights around the newly planted trees at the entrance.

Flag Burning Amendment Passes

Via Minipundit: Carpetbagger is reporting that the U.S. House has passed an amendment to the U.S. Constitution banning the burning of the American flag. The margin more than satisfied to two-thirds requirement for such amendments.

Congress loves to spend time on meaningless “feel good” nonsense like this instead of issues that really matter to their constituents. They’re also grabbing at any opportunity to piss on the constitution and turn it into a worthless piece of paper. Crap like this simply doesn’t belong in the constitution.

This is yet another example of the government being out of touch with the people and no longer representing us. Ask 100 Americans what they consider the most important issues facing the country and I’m sure flag burning won’t be anywhere on the list. How about putting as much effort into health care or education?

Father's Day

Father’s Day feels weird for me. I used to have Father’s Day, my father’s birthday, and my parent’s anniversary in June and now nothing.

My father died in January 1991 (while I was at MacWorld San Francisco). I got a call that morning at the hotel from my friend telling me my father died. I spent the rest of the day wandering around in shock. The next morning I flew back to my home in L.A. and the following day I flew to New York, where my parents lived, for his funeral.

Thankfully my mom is still alive.

I often regret never having kids so I can have someone to pass my legacy to after I’m gone. I guess there’s still time, but as a single gay man there’s very little chance I’d have a family.

Mactel

Apple has registered the name Mactel for the new x86 Macs, which sounds too much like a Mac clone. The name reminds me of the Mactell XB 203/DT, a clone based on the Tanzania motherboard, very similar to a Motorola Starmax 3000. I had one before my B&W G3.

The zen of blogging

After using Blosxom to render static archive pages for MacMegasite, I’m now falling in love with it. I like that Blosxom is simple, lightweight, and consists of only a single file. I’ll probably use it for other things in the future.

Categories Web

Exporting static pages from Drupal

As part of my plan to reduce MacMegasite’s hefty resource usage, I’m reducing the size of the database by archiving all stories from 2004 or earlier as static pages. Using a simple Perl script, I exported each node as a text file, which I then rendered as static pages using Blosxom.

Read more

CPU Hog

I got a warning from DreamHost that my account is using way too much CPU time. The problem seems to be with Drupal, especially at MacMegasite, which is getting heavy traffic. If that continues I may be forced to switch to a dedicated server. In that case I will most likely shut down macmegasite or switch to a much more lightweight & feature limited version using Blosxom.

Categories Web

Attack of the zombie processes

I have an application that consists of a background process which launches another tool at certain times to do some work. I was doing this the standard Unix way:

if ((pid = fork()) == 0) {
    exec("/some/application");
} else {
    wait(&status);
}

I’ve been attempting to convert it to a single binary rather than two separate files. I figured I could simply have it run the code to do the timed task inline after I fork() instead of launching a separate binary.

I found that the forked process was crashing immediately when it attempted to use a CFRunLoop function. Even more annoying, the child process can’t be debugged in gdb as far as I can tell. It ended up crashing, and getting respawned so quickly it filled up the process table with zombie processes so I could no longer run anything else.

$ ps ax
-bash: fork: Resource temporarily unavailable

It turns out you can’t continue after a fork() without execing.

The problem is that fork() does not actually replicate all kernel resources (and perhaps other bits I don’t know about) from the parent process into the child, but it does replicate memory. Thus there can be code which thinks everything is happy because the memory holding handles to kernel esources looks like it is initialized and whatnot, but the kernel resources are missing underneath.

Basically, after fork() you need to execve() (or other exec variant), so that library initializers and whatnot are executed in the context of the child to do any 1-time set-up or whatever else the libraries normally do when an app is launched.

Thanks to Chris Hanson for pointing this out.