A (long) story about almost losing my PowerMail database and how I got it
back.

Two nights ago, when getting my mail, PowerMail (5.1.1a1) was unusually
sluggish. Then I just started to get a spinning pizza icon whenever I
opened PowerMail. No response to anything.

I suspect that this is related to a problem that I have reported earlier.
I keep my PowerMail database on one computer and often access it from a
different computer under Apple File Sharing. If you delete an attachment
under this arrangement, PowerMail seems to get confused about where the
attachment is and can hang. Perhaps I finally did something that caused
PowerMail to hang on opening the database, trying to resolve an alias?

I killed and relaunched PowerMail a number of times, and I noticed that
sometimes I could get 1 or 2 events into the app before it hung. I could
pull down a menu, or have it respond to one command-key operation, but
the response was very sluggish and then it would hang completely. One of
the events I got it to respond to was a command-W, so now my Mail Browser
window was closed.

What was interesting was that trying to kill PowerMail using the "Force
Quit Applications" window (cmd-opt-Esc) was very difficult. I had to kill
PowerMail 2 times in order to have the menus and windows disappear, but
then I would have to "kill" it many more times for the application to
really go away.

I started up PowerMail with command and option keys down, and rebuilt my
database a number of times, including a low-level rebuild. This took a
few hours for all the different permutations. The problem remained.

I keep my PowerMail database on my laptop, so the next thing I did was to
mount my Powerbook on my desktop (using FireWire target mode). I copied
the database onto my desktop and tried from there, and it still hung, so
the problem wasn't a file error. I rebuilt the database on my desktop and
it still wouldn't open.

I then sampled PowerMail when it was hung (from Activity Monitor) and it
looked like it was trying to do something over the network. So I went to
the Network panel in System Preferences and turned off all networking.

To my surprise, this solved the problem. Now I could open my PowerMail
database! But of course I can't send or receive mail with the network
turned off. Testing revealed that the database wouldn't open whenever a
network was active. (I did not try turning on the network after launching
Powermail.)

So now I figured that maybe if I exported and imported my database the
problem might go away. Which it did, but only after about 10 hours of work.

The first time I tried to export my database, Powermail went through all
the steps (choose how to export, where to export, etc) and then just sat
there quietly. After a few minutes I figured out it wasn't doing anything.

Rule 1: If the browser window is closed, PowerMail goes through the
motions of exporting but doesn't actually do anything.

The second time I exported my database, I got everything exported
including attachments (about 60 minutes on a dual-G5!) and then imported
(about 90 minutes), but looking through my browser window it appeared
that not everything got transferred. It appears that if you don't have
"View All" set for every mailbox, mail from those mailboxes is silently
discarded on export.

Rule 2: You have to go through every mailbox and turn on "View All"
before exporting "everything" or else PowerMail doesn't export everything.

So I reexported and reimported (another 2.5 hours of work). Now I
compared the mailboxes and the attachments folder. Somehow my attachments
have multiplied. Before I had 2,241 attachments, and now I have 4,794
attachments. I don't know where these attachments came from!

Rule 3: Some of your attachments will be duplicated when you export and
import your database. It is hard to tell how or why.

After all this I tried to just copy over the "Setup Database" file but
when I looked at them, I saw that my filter rules were all strange,
referring to the wrong mailbox as part of the filter. I suspect that the
filter rules refer to mailboxes by some internal identifier which doesn't
copy over when you export and import a PowerMail database.

Rule 4: After exporting and importing, you need to re-set up all your
filters and accounts. Allow a couple of hours for this.

There is no easy way to look at your filters and accounts in both the old
and new databases at the same time. What I did was to go through every
filter (3 panels each) and every account (3 panels + 1 pop-up window
each) and take a snapshop of the window (cmd-shift 4 followed by space)
and then opened all the snapshots in Preview to see them in order to re-
enter them. Of course, you had better have written down your passwords in
another place since you can't view them from PowerMail.

Rule 5: If you ever need to recover your PowerMail database expect to
spend about 8 or more hours doing this (estimated from a fast computer +
a 700MB database). You have to be very careful in order to not lose email
in the process. You will duplicate some of your attachments, and it is
impossible to figure out which ones or why.

Rule 6: (of course). None of this is mentioned in the PowerMail manual or
any of the FAQs that I could find on the web.

Jerôme: If you want to know the call graph where PowerMail seemed to
hang, it is copied below.

=======

Analysis of sampling pid 434 every 10.000000 milliseconds
Call graph:
    283 Thread_110b
      283 start
        283 _start
          283 main
            283 LApplication::Run()
              283 CPMApp::ProcessNextEvent()
                283 LTSMDocApp::ProcessNextEvent()
                  283 LEventDispatcher::UseIdleTime(EventRecord const&)
                    283 LPeriodical::DevoteTimeToIdlers(EventRecord const&)
                      283 CPMApp::SpendTime(EventRecord const&)
                        283 CMAS::Idle()
                          283 CIndexingEngine::Idle()
                            283 CIndexingEngine::AddMessage(CMsg*)
                              283 CIndexingEngine:
:GetBodyAsPlainText(CMsg*, std::basic_string<unsigned short, std:
:char_traits<unsigned short>, std::allocator<unsigned short> >&)
                                283 CMsgPartContainer:
:GetAllSubParts(std::vector<CMsgPart*, std::allocator<CMsgPart*> >&, __bool8)
                                  283 CMsg::LoadPartList()
                                    283 CMsg::DBReadMsgParts()
                                      283 CMsgPartContainer:
:ReadFromStream(basic_binstream&, long)
                                        283 CMsgPartContainer:
:ReadPartsFromStream(basic_binstream&, long)
                                          283 CPartFactory:
:MakePart(basic_binstream&, long)
                                            283 CEnclosurePart:
:ReadFromStream(basic_binstream&, long)
                                              283 CFileSpecImp:
:ReadFromStream(basic_binstream&, CFileSpec const&)
                                                283 FSResolveAlias
                                                  283
FSResolveAliasWithMountFlags
                                                    283
FSResolveAliasWithMountFlagsInternal
                                                      283 FSMatchAliasInternal
                                                        283 AL_findVolume
                                                          283 AL_mountVolume
                                                            283
AL_mountForeign
                                                              283
AL_aliasVolumeMount
                                                                283
PBVolumeMount
                                                                  283
RemountServerURLAsync
                                                                    283
AFP_RemountServerURL
                                                                      283
afp_Remount

283 SharedVolumeEnumerator::Init(sockaddr*, unsigned char*, unsigned
char*, unsigned char*, void (*)(EventRecord*, void*), void*, unsigned
char (*)(unsigned char*, void*), void*, void (*)(void*, unsigned long,
long, void*), void*, unsigned long)

 283 TServerProxy::Connect(unsigned long)

   283 TServerProxy::GetSrvrInfo(sockaddr*, unsigned char*)

     283 GetStatus

       283 afp_connect

         283 connect

           283 connect
    283 Thread_1203
      283 _pthread_body
        283 CooperativeThread
          283 InvokeThreadEntryUPP
            283 LThread::DoEntry(void*)
              283 LThread::Cleanup::Run()
                283 LSemaphore::Wait(long)
                  283 LSemaphore::BlockThread(long)
                    283 LThread::SemWait(LSemaphore*, long, QHdr&,
unsigned char&)
                      283 SetThreadStateEndCritical
                        283 SetThreadState
                          283 YieldToThread
                            283 SwitchContexts
                              283 mach_msg
                                283 mach_msg_trap
                                  283 mach_msg_trap
    283 Thread_1303
      283 _pthread_body
        283 CarbonSelectThreadFunc
          283 BSD_waitevent
            283 syscall
              283 syscall
    283 Thread_1403
      283 _pthread_body
        283 CarbonOperationThreadFunc
          283 _pthread_cond_wait
            283 semaphore_wait_signal_trap
              283 semaphore_wait_signal_trap
    283 Thread_1503
      283 _pthread_body
        283 CarbonATOperThreadFunc
          283 _pthread_cond_wait
            283 semaphore_wait_signal_trap
              283 semaphore_wait_signal_trap
    283 Thread_1603
      283 _pthread_body
        283 CooperativeThread
          283 InvokeThreadEntryUPP
            283 LThread::DoEntry(void*)
              283 CPPThread::Run()
                283 CBasicThreadImp::Run()
                  283 CAddrBookSyncThread::Run()
                    283 0x3de808
                      283 CSemaphore::Wait(CMutex&)
                        283 CCondition::Wait(CMutex&)
                          283 CConditionImp::Wait(CMutex&)
                            283 CConditionImp::Wait(CMutex*)
                              283 CThreadImp::SuspendPPThread(CPPThread*)
                                283 LThread::Suspend()
                                  283 SetThreadStateEndCritical
                                    283 SetThreadState
                                      283 YieldToThread
                                        283 SwitchContexts
                                          283 mach_msg
                                            283 mach_msg_trap
                                              283 mach_msg_trap

Total number in stack (recursive counted multiple, when >=5):
        5       _pthread_body

Sort by top of stack, same collapsed (when >= 5):
        mach_msg_trap        566
        semaphore_wait_signal_trap        566
        connect        283
        syscall        283
Sample analysis of process 434 written to file /dev/stdout
Sampling process 434 each 10 msecs 300 times




Reply via email to