Automatically Add to iTunes wrecks iTunes library, permanently beachballs iTunes

Originator:jeremyw.sherman
Number:rdar://9913925 Date Originated:08-Aug-2011 12:11 PM
Status:Open Resolved:
Product:iTunes Product Version:10.5b60 (60)
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
"Automatically Add to iTunes" will continually add the same files if the user running iTunes has read, but not write, access to those files. This will destroy the user's iTunes library and render iTunes unusable: iTunes beachballs for 5 to 20 seconds at a time before beachballing again immediately, as soon as the scan resumes. Even selecting a single track becomes nearly impossible.

Steps to Reproduce:
1. As one user, copy files to the "Automatically Add to iTunes" directory of another user.

Expected Results:
2. iTunes notices it cannot move the files into place in the library.
3. iTunes notifies the user running iTunes that it was unable to add certain files because the user does not have permission to do so.

Actual Results:
2. Watch iTunes add one copy of all the files.
3. Watch iTunes add another copy of all the files.
4. Watch iTunes add yet another copy of all the files.
…

Regression:
No idea, and I don't want to test to find out.

Notes:
This happened to me when I consolidated my music library from two different Macs into the same folder on an external hard drive. Most of my library was on one machine, but the other had a few files. I moved those files to the Automatically Add directory so they could be sorted in with the rest of my library. I had forgotten that my user accounts had different uids: one was the first user on its machine, while the other was the second user.

iTunes seemed fine to begin with. I tend to view just a particular artist, so I didn't see the mushrooming tracks that were being added. iTunes became more and more unresponsive as time went by. By the next morning, it was completely unusable.

I didn't realize what had gone wrong till I wiped out my iTunes library. When I reopened iTunes to an empty library, I immediately relocated my library folder back to where all my music was. I intended to have it scan in all the files. But iTunes immediately began reading in the Automatically Add files. As I saw the same tracks appear once, then twice, then thrice, and then more and more times, I finally realized the Automatically Add directory was the center of the problem. It was then that I realized what was happening.

When I looked on disc, iTunes seemed to be trying to move the files. I could see empty directories in the organized music directory corresponding to the files that iTunes could read but not write. It wasn't making multiple copies into the music folder, just adding multiple copies to its music library database. But because it couldn't move the files out, it kept scanning them over and over.

This bug would make for an awful DoS attack against a user you don't like. As it was, I lost all changes to my iTunes library since the last backup made by Time Machine before I moved those files into Automatically Add to iTunes.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!