Tuesday, January 15, 2008

Time Machine Restore

To my immense relief, restoring from a Time Machine backup seems to (mostly) have Just Worked. Phew!

The minor things I've spotted so far are:

  • Apache stopped working after the restore. As discussed here and here, a simple sudo mkdir /private/var/log/apache2 sorted things out.
  • My local Bugzilla installation seems to have lost some bugs I entered before the crash. However, it's entirely possible that I entered them just before the crash, and so they didn't make it across to the backup.

Wednesday, January 02, 2008


Bit of a disaster this evening—the hard drive on the Powerbook has died. No booting, no sign of it in Disk Utility (when booting from CD), and a strange clicking noise at startup. (I was in the middle of updating an iPod Classic to 1.0.3 firmware at the time, and the sync process had already failed a couple of times for no apparent reason.)

The really distressing part is that it died while it was in the process of updating the offsite backup (which is my iPod), and it managed to trash that too.

So let's hope that Time Machine lives up to its billing.

Wednesday, December 12, 2007

From Firefox to Safari

So I've finally had it with Firefox for Mac: one crash too many and it's time to go back to Safari and see what the Leopard version is like.

The easy part of the shift is transferring the bookmarks. First export them in Firefox:

  • Bookmarks, Organize Bookmarks… opens the Bookmarks Manager
  • File, Export… dumps the bookmarks to file
and then File, Import Bookmarks… in Safari allows the bookmarks to be dragged into place.

More problematic are the Firefox add-ons. I can live without Leet Key, and I can always reload Firefox if I need to debug things with DOM Inspector or Firebug, but I really can't do without Flashblock.

Fortunately, Pith Helmet seems to do the similar sorts of things for Safari.

Sunday, November 11, 2007

ML-2250 Printer Problems

I had some difficulties with support for my Samsung ML-2250 printer before, and with the Leopard install they seem to be back. Leopard appears to detect the printer automatically, but on startup and whenever I try to print, the printer just spits out sheets with random bits of PostScript on them.

This looks to be the core of the problem: the printer driver describes itself as "Samsung ML-2250 Series PS", but according to the printer manual PostScript is an optional extra that I don't have.

So maybe I need to revisit the helpful comment I got about Foomatic

Wednesday, November 07, 2007

Finder hang

After rebooting with the latest software update, the Finder hang that I had before is back.

I'm trying out a hint from this thread, which is to rename the /Library/Application Support/DivXNetworks. Given that it's an intermittent fault, if I don't mention the hang again that will probably mean that it worked…

Monday, November 05, 2007

c++filt, aka cxxfilt

Aha. Via the list of Leopard open source stuff I found a download for the relevant patched version of binutils to produce cxxfilt (a.k.a. c++filt), so that particular project directory is back in business.

GraphicConverter 6.0.1

Easy solution to the GraphicConverter problem: upgrade to the latest version and buy an upgrade license. It's only $20 for an upgrade (from the bundled Mac OS X version), which is cheap given the current USD/GBP rate.

Sunday, November 04, 2007

Filesharing fixed

Looking at the logs in the Console application, there seem to be a lot of errors of the form:

tdb(unnamed): tdb_open_ex: spinlocks no longer supported

If I get rid of /private/var/db/samba/secrets.tdb, then there are more errors complaining about different .tdb files in the /private/var/samba/ directory. So I tried getting rid of the whole /private/var/samba/ directory (after having saved off a copy, of course), and I can suddenly see the Mac from the Windows machine again.

Of course, this BFMI approach isn't really a solution to be recommended: I've got no idea what the files were there for and whether this has just made my Samba connections dreadfully insecure.

Filesharing problems

I discovered that the Mac box is no longer visible from the PC, so it looks like I've got some Samba problems under Leopard. Looking at the logs in the Console app, it looks like smbd keeps exiting immediately after startup. Running from the command line also fails:

/etc:smbd -i -S
smbd version 3.0.25b-apple started.
Copyright Andrew Tridgell and the Samba Team 1992-2007
WARNING: The "printer admin" option is deprecated
Failed to open /private/var/db/samba/secrets.tdb
ERROR: we did not create the shmem (owned by another user, uid 0, gid 0)
ERROR: failed to setup profiling

No clue on this one—the only hint out there looks to be unrelated (shutting down Apache makes no difference).

Apache setup

My pre-Leopard setup for Apache had a number of tweaks, but they have all stopped working with the upgrade.

The configuration file seems to have moved to /etc/apache2/httpd.conf, and now Includes various *.conf files from the extra/ and other/ directories.

So I just created a other/dmd.conf file with the configuration that I'd previously added to httpd.conf, forced a refresh with sudo killall -HUP httpd and things were working again.

I also found that my user web directory (the stuff under ~/Sites) was no longer visible—browsers would get a 403 Access Denied. Following a couple of useful hints, I added a users/dmd.conf file and all was well:

<Directory "/Users/dmd/Sites/">
  Options Indexes MultiViews
  AllowOverride None
  Order allow,deny
  Allow from all

Monday, October 29, 2007

Fortran and c++filt

Discovered an added wrinkle to the missing c++filt problem, which is that the GNU Fortran compiler g77 seems (bizarrely) to need c++filt—and so generates errors on execution (it still seems to produce executable binary files, though).

I tried installing the old 10.3.9 tools/SDK off the Leopard DVD in the hope that there might be a c++filt lurking somewhere, but no joy (with either find or Spotlight).

In other news, it looks like the version of GraphicConverter that came bundled with the machine isn't coping well with Leopard. It doesn't always refresh/redraw its windows—leaving them grey and blank (until they're scrolled to force a redraw).

X11 in the Dock

OK, it looks like my X11 problems aren't unique to me.

Sunday, October 28, 2007

Getting rid of .dSYM/ directories

So the new --work-properly option for this is to use -gstabs rather than plain old -g.

For Xcode projects, it looks like there's a choice of setting DEBUG_INFORMATION_FORMAT to one of stabs, dwarf or dwarf-with-dsym (where the last of these is apparently the default), but as far as I can tell the Xcode settings don't affect the proper way of doing things (the command line).

dvips and relative paths

Next oddity: dvips stopped finding figure files in a different relative directory:

dvips: Could not find figure file ../figures/lyapunov.ps; continuing
With a hint from this discussion, it looks like the appropriate --work-properly option is dvips -R0 (although I've no idea why a relative path is considered a security hole, nor why this is now a problem given that I've not updated dvips).

gv and libXaw3d

Found another small application that's not working, namely gv. The error message is:

dyld: Library not loaded: /usr/X11R6/lib/libXaw3d.7.dylib
  Referenced from: /usr/local/bin/gv
  Reason: image not found
Trace/BPT trap
so as before I looked in /usr/X11R6 1/lib, and lo and behold, there's the relevant library.

A quick

/usr/X11R6 1/lib:ls /usr/X11R6/lib/*Xaw3d*
ls: /usr/X11R6/lib/*Xaw3d*: No such file or directory
/usr/X11R6 1/lib:sudo mv *Xaw3d* /usr/X11R6/lib/
and gv is good to go again.

Turning off the Spotlight

Almost certainly old news to 10.4 users, but when I plugged in an external hard drive, I noticed that Spotlight kicked off the process of trying to index it. Perusing a couple of useful web pages, it looks like the easiest way to stop this is just to add the external hard disk to the Spotlight Privacy list.

Saturday, October 27, 2007

Upgrading from 10.3.9 to 10.5 (Leopard)

I passed on installing Tiger, but it looked like Leopard might be worth the upgrade (and might have a side bonus that my new iPod might now work), so off I went.

After backing things up, I whacked in the install DVD and left it to run an upgrade. I had to deselect a few things to get it to fit on my nearly-full hard disk, but sadly I couldn't deselect all of the additional languages which appeared to need a bunch of space (presumably they were there from the 10.3 install, and the Leopard installer only allows upgrade/install not removal).

The install took about an hour and a half, and was mostly fairly smooth. However, there were a couple of serious oddities afterwards: the Finder would only hang, and everything seemed to run very slowly. Relaunching the Finder didn't help, but just as I was starting to get worried the problem went away after a couple of reboots. (Bizarrely, the Finder problem seemed to affect my Emacs startup too—it didn't read my .emacs and showed an error message: "Finder got an error: Apple Event timed out.")

For the slowdown, I finally noticed the new magnifying glass in the top right corner of the screen, and discovered that it was due to Spotlight indexing the disk. Once it had finished (which I would guess took around 3 hours, but I left it overnight), the speed seems to be roughly back to normal.

The upgraded X11 seems to be the biggest step backwards so far. The upgrade lost my customized shortcut applications, and in trying to recreate them I discovered that it's no longer possible to include command line options for an application (so I've had to create shell scripts and execute them instead). More seriously, the interaction of X11 with the Dock gets confused, so I end up with a bunch of big "X" icons in the dock, and Command-Tabbing to a X11 doesn't bring any window to the foreground.

Trying to rebuild all of my source code projects failed miserably at first, but that was just because I hadn't upgraded Xcode yet. Once that was installed, things started to work much better—but a few chunks of my source code needed updating for the newer, stricter compiler (GCC 4.0.1).

Some things were a little more taxing, however. The new version of M4 (1.4.6) has a bug dealing with input files that don't end in a newline; the easiest way of dealing with this was just to add newlines.

My installation of xfig disappeared during the upgrade, which is a bit of a problem as a lot of my older projects rely on it. Consulting my notes it looks like I originally got xfig using the i-Installer, but that now fails to re-install the package (and has dire warnings about the unsupported level of both the particular package and the installer itself).

Spotlight may be spangly, but it didn't find where xfig had gotten to. Good old UNIX find, on the other hand, quickly determined that xfig and friends had been shuffled off to a separate /usr/X11R6 1/bin/ directory. A quick mv * /usr/X11R6/bin/ and all was sorted.

Another problem was what initially looked like a problem with the C++ compiler's internal header files:

~/text/recipes: c++ -I. -c temp.cpp
/usr/include/c++/4.0.0/bits/locale_facets.tcc: In member function 'virtual long int std::collate<_CharT>::do_hash(const _CharT*, const _CharT*) const':
/usr/include/c++/4.0.0/bits/locale_facets.tcc:2417: error: 'digits' is not a member of 'std::numeric_limits<long unsigned int>'
/usr/include/c++/4.0.0/bits/istream.tcc: In member function 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&)':
/usr/include/c++/4.0.0/bits/istream.tcc:151: error: 'min' is not a member of 'std::numeric_limits<short int>'
/usr/include/c++/4.0.0/bits/istream.tcc:152: error: 'max' is not a member of 'std::numeric_limits<short int>'
However, skipping the "-I." on the command line made the problem disappear, so it looked like a name clash between one of my local header files and one of the system header files. Again, the magic of the UNIX command line (specifically for ii in *; do find /usr/include/c++ -name $ii; done) found the culprit so I could rename it. (It was actually a local version of the limits header file that I'd created ages ago to cope with the deficiencies of the previous version of the C++ compiler.)

Having made all of the required changes to my project files, I noticed a bunch of deprecation warnings when I checked them in to CVS. The net result of the instructions for getting rid of this was to:

  • add UseNewInfoFmtStrings=yes to $CVSROOT/CVSROOT/config
  • adjust the commitinfo script so that it took (and ignored) parameters " %r/%p %s"

Still to investigate further:

  • With the updates to a variety of projects, I also noticed the appearance of a bunch of exefile.dSYM directories all over the place. According to the docs, since Xcode 2.4 these directories look to hold debugging information for generated executables, held separately from the executables themselves. Given that I never distribute binaries, I'd prefer the normal behavior of binding the debugging information into the executable file itself. So I guess I need to look for the appropriate --work-properly option.
  • Also, c++filt has gone missing. Not normally a big deal, but it's specifically needed for one particular old project of mine. It's normally in the GNU binutils package, so I'll start the hunt there.
  • See if there's any solution to the X11 issues.

Sunday, June 03, 2007

System Failure

Here's a first (which is pretty impressive for two+ years in):

System Failure: cpu=0; code=0000001 (Corrupt stack)
Latest crash info for cpi 0:
   Exception stat (sv=0x2ABBCC80)
      PC=0x000940A0; MSR=0x00001030; DAR=0x175AFFF4; DSISR=0x42000000; LR=0x00093F8C; R1=0x175AFEE0; XCP=0x00000098 (System Failure)

         backtrace terminated - frame not mapped or invalid: 0x175AFEE0

Proceeding back via exception chain:
   Exception state (sv=0x2ABBCC80)
     PC=0x001D9FCC; MSR=0x00009030; DAR=0x175AFFF4; DSISR=0x42000000; LR=0x001D9FFC; R1=0x175B00000; XCP=0x0000000C (0x300 - Data access)
        0x52415449 0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 
        0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 
        0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 
        0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 0x001D9FFC 
     backtrace continues...
   Exception state (sv=0x2AD90280)
     PC=0x9002E76C; MSR=0x0000D030; DAR=0x017B9000; DSISR=0x42000000; LR=0x90025290; R1=0xBFFFF7B00; XCP=0x00000030 (0xC00 - System call)

Kernel version:
Darwin Kernel Version 7.9.0:
Wed Mar 30 20:11:17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC

Memory access exception (1,0,0)
ethernet MAC Address: 00:00:00:00:00:00
ip address:

Waiting for remote debugger connection

For now, I shall just assume it's down to cosmic rays.

Sunday, April 22, 2007

Tidying up "Open With"

Adobe Photoshop and ImageReady really clutter up the "Open With" context menu (in Finder) with lots of extra actions for images—things like "Constrain to 200x200 pixels.exe", "Slide Thumbnail.exe", etc. There's around 25 of them, which makes it much harder to select the proper image processing application.

These extra entries correspond to "Droplets", which are small image processing scripts. Thanks to this page, getting rid of them is simple:

cd /Applications/Adobe Photoshop CS2/Samples
mv Droplets Droplets.hidden

[Edit 2008-07-19: Following these instructions may also be needed]

Monday, March 05, 2007

Keyboard Shortcuts

For future reference, some keyboard shortcuts I keep forgetting:

  • Ctrl-F2 jumps focus to the menu bar
  • Ctrl-F3 jumps focus to the Dock
  • Tab and Shift-Tab jump around buttons in modal dialogs, Space selects (not Enter, which triggers the default button (i.e. the one in blue)

(The last of these need the System Preferences/Keyboard & Mouse/Keyboard Shortcuts/Turn on full keyboard access option to be turned on).