Built application hang (Mac OS X)


I received a user report for an app compiled in RS2012r2 (Carbon), running on Mac OS X 10.6.

The report states that the application hangs every time shortly after initialization, with the following report from a 3 second sample:

2299 Thread_1599: Main Thread   DispatchQueue_<multiple>
  2264 start
    2264 _start
      2264 % main
        2264 _Main
          2264 REALbasic._RuntimeRun
            2264 RuntimeRun
              2264 mainloop()
                2264 CallFunctionWithExceptionHandling(void (*)())
                  2264 Application._CallFunctionWithExceptionHandling%%o<Application>p
                    2264 Delegate.Invoke%%
                      2264 UpdateMouseCursor()
                        2264 PumpedEventQueueHandleEvents()
                          2264 PumpedEventQueueInternalHandleEvents()
                            2264 PumpedEventQueue::HandleInMenuBar(PumpedEvent*, Window*)
                              2264 MenuSelect
                                2264 MenuSelectCore(MenuData*, Point, double, unsigned long, OpaqueMenuRef**, unsigned short*)
                                  2264 TrackMenuCommon(MenuSelectData&, unsigned char*)
                                    2264 IsUserStillTracking(MenuSelectData*, unsigned char*)
                                      2264 ReceiveNextEventCommon
                                        2264 RunCurrentEventLoopInMode
                                          2264 CFRunLoopRunInMode
                                            2264 CFRunLoopRunSpecific
                                              2263 __CFRunLoopRun
                                                2243 mach_msg
                                                  2243 mach_msg_trap

I would be grateful if anyone can shed any light on what is happening here. The issue is specific to the one user’s machine.

It occurred to me that mach_msg_trap might indicate that the main thread is in fact healthy and just sitting there idling, and that the ‘hang’ symptom might be produced by some other thread. Here it is, in case that rings any bells with anyone:

2299 Thread_1808
  2299 thread_start
    2299 _pthread_start
      2299 __NSThread__main__
        2299 -[NSThread main]
          2299 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:]
            2299 CFRunLoopRunInMode
              2299 CFRunLoopRunSpecific
                2299 __CFRunLoopRun
                  2243 __CFRunLoopDoSources0
                    2243 MultiplexerSource::perform()
                      2243 URLConnectionLoader::processEvents()
                        2243 URLConnectionLoader::LoaderConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XLoaderEvent, XLoaderEventParams>*, long)
                          2243 URLConnectionLoader::loaderScheduleLoad(_CFURLRequest const*)
                            2243 CFURLCacheCopyResponseForRequest
                              2243 __CFURLCache::CopyResponseForRequest(_CFURLRequest const*, bool)
                                2243 __CFURLCache::LookupCachedURLResponse(__CFURLCacheNode*)
                                  2243 __CFURLCache::ExecuteSQLSelectAndCreateResponse(__CFString const*)
                                    2243 sqlite3_step
                                      2243 sqlite3VdbeExec
                                        2243 sqlite3BtreeMovetoUnpacked
                                          2243 getAndInitPage
                                            2243 sqlite3PagerAcquire
                                              2243 unixRead
                                                2243 pread$UNIX2003

Any ideas?

Can you tell us what your app does at startup, relating to fetching data over the network and using / opening a database?

I wonder if that user’s sqlite db wasn’t closed properly and now it has problems unrolling the rollback or wal file that might be next to the main db file. Can you have the user check the sqlite db file that your app seems to work with?

Alternatively, maybe the db file is somehow locked. Have him try to move the db file somewhere save so that there is no more db file where you app may expect it, to see if that resolves the issue. If it does, you might want to figure out what’s wrong with the db. Maybe it’s in use by another app, or otherwise protected from being modified.

Thanks for the response.

This is the strange thing - the application does not contain code related to sqlite nor accessing any other type of database.

Given that the app does not (knowingly) access any db file, are there any other likely operating system / RS framework related db files which are likely candidates for this which I could request the user to delete / reinstall / unlock?

Some other things which may be relevant: The application does use HTTPSocket and HTTPSecureSocket to communicate with some scripts on the internet via POST. It also makes basic use of an HTMLViewer to download and render a website.