Today icedove started randomly locking up with 100% CPU when it was apparently doing nothing.
Using strace I tracked it down to a problem with a Junk folder.
# Start icedove with strace to trace filesystem syscalls:
strace -e file -f -s2048 -o /tmp/icedove.log icedove &
tail -f tmp/icedove.log
strace -e file -f -s2048 -o /tmp/icedove.log icedove &
tail -f tmp/icedove.log
When the hang occurred, the following lines were repeating in the log file:
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
11549 stat("/home/chris/.icedove/2cdqwny3.default/Mail/mail.********.com/Junk", {st_mode=S_IFREG|0600, st_size=45516987, ...}) = 0
The Junk file at that path was only 40M so shouldn't have taken long to process.
Since it was a junk folder, I simply deleted it and restarted icedove and this fixed the problem.