Warning: geeky Mac post
I had a problem with the iTunes Match process on my Mac – it would get stuck sometimes at the stage of ‘Gathering information about your iTunes library…’. It turned out to be one or two dodgy tracks that were confusing it, but how to find out which they were?
I found the solution on tmksnyder’s post in this thread. He suggested using Activity Monitor, selecting the iTunes process, and clicking the ‘Inspect’ button, which I confess I’d never previously noticed. Here you can find a tab named ‘Open Files and Ports’, which tells you which files (& ports!) the app is currently using. Potentially useful for all sorts of things. (It’s roughly the inverse of the command-line ‘fuser’ utility, which tells which apps have a particular file or mount-point open.)
The window updates dynamically, so if you expand it to a good size and watch it carefully, you can see the filenames of tracks being opened and closed, and, in my case, a couple on which it hiccupped and kept trying to re-open. Deleting and re-downloading those sorted it out.