2013-05-28

TrustEvaluationAgent

Yesterday, after pressing the "Renew DHCP Lease" in the System Preferences app on a WiFi connection:

Process:         trustevaluationagent [6678]
Path:            /System/Library/PrivateFrameworks/TrustEvaluationAgent.framework/Versions/A/Resources/trustevaluationagent
Identifier:      trustevaluationagent
Version:         23
Code Type:       X86-64 (Native)
Parent Process:  launchd [154]
User ID:         501

Date/Time:       2013-05-27 15:46:32.765 +0200
OS Version:      Mac OS X 10.8.3 (12D78)

Crashed Thread:  8  Dispatch queue: com.apple.root.default-priority

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: EXC_I386_GPFLT

Thread 8 Crashed:: Dispatch queue: com.apple.root.default-priority
0   com.apple.security             0x00007fff83d77df5 Security::RefPointer<Security::CssmClient::ObjectImpl>::release() + 21
1   com.apple.security             0x00007fff83dc95c6 std::_Rb_tree<long, std::pair<long const, SSDatabase>, std::_Select1st<std::pair<long const, SSDatabase> >, std::less<long>, std::allocator<std::pair<long const, SSDatabase> > >::_M_erase(std::_Rb_tree_node<std::pair<long const, SSDatabase> >*) + 46
2   com.apple.security             0x00007fff83e20f2e SSDLSession::~SSDLSession() + 590
3   com.apple.security             0x00007fff83dc932a SSDLSession::~SSDLSession() + 18
4   com.apple.security             0x00007fff83d9cb0a Security::CssmPlugin::moduleDetach(long) + 220
5   com.apple.security             0x00007fff83dc928f CSSM_SPI_ModuleDetach__apple_cspdl + 35
6   com.apple.security             0x00007fff83d9c861 Attachment::detach(bool) + 127
7   com.apple.security             0x00007fff83d9c64f CSSM_ModuleDetach + 33
8   com.apple.security             0x00007fff83d9c5f8 Security::CssmClient::AttachmentImpl::deactivate() + 44
9   com.apple.security             0x00007fff83d9c593 Security::CssmClient::AttachmentImpl::~AttachmentImpl() + 31
10  com.apple.security             0x00007fff83dc9226 Security::CssmClient::CSPDLImpl::~CSPDLImpl() + 32
11  com.apple.security             0x00007fff83e3a421 Security::CssmClient::SSCSPDLImpl::~SSCSPDLImpl() + 25
12  com.apple.security             0x00007fff83d77e28 Security::RefPointer<Security::CssmClient::ObjectImpl>::release() + 72
13  com.apple.security             0x00007fff83d9101c Security::CssmClient::ObjectImpl::~ObjectImpl() + 54
14  com.apple.security             0x00007fff83dc90a3 Security::CssmClient::SSDbImpl::~SSDbImpl() + 25
15  com.apple.security             0x00007fff83d77e28 Security::RefPointer<Security::CssmClient::ObjectImpl>::release() + 72
16  com.apple.security             0x00007fff83edf937 Security::KeychainCore::KeychainImpl::~KeychainImpl() + 239
17  com.apple.security             0x00007fff83dc8f32 Security::KeychainCore::KeychainImpl::~KeychainImpl() + 18
18  com.apple.security             0x00007fff83d77f2a Security::CFClass::refCountForType(long, void const*) + 190
19  com.apple.CoreFoundation       0x00007fff89e2e324 CFRelease + 324
20  com.apple.security             0x00007fff83d97a5f std::vector<Security::KeychainCore::Keychain, std::allocator<Security::KeychainCore::Keychain> >::~vector() + 33
21  com.apple.security             0x00007fff83ed94b4 Security::KeychainCore::Trust::~Trust() + 48
22  com.apple.security             0x00007fff83dc8a86 Security::KeychainCore::Trust::~Trust() + 18
23  com.apple.security             0x00007fff83d77f2a Security::CFClass::refCountForType(long, void const*) + 190
24  com.apple.CoreFoundation       0x00007fff89e2e324 CFRelease + 324
25  trustevaluationagent           0x000000010044c635 0x10044b000 + 5685
26  libdispatch.dylib             0x00007fff8a20df01 _dispatch_call_block_and_release + 15
27  libdispatch.dylib             0x00007fff8a20a0b6 _dispatch_client_callout + 8
28  libdispatch.dylib             0x00007fff8a20b1fa _dispatch_worker_thread2 + 304
29  libsystem_c.dylib             0x00007fff83c8bd0b _pthread_wqthread + 404
30  libsystem_c.dylib             0x00007fff83c761d1 start_wqthread + 13


I'll check it in more detail later..

2013-05-15

GoPro CodecStatus Menu bar item

After installing the GoPro software suite to update your GoPro's firmware, your Menu bar will have a beautiful new icon: 
This screen real-estate hijacking has to be stopped of course. It turns out this icon is backed by the "StereoModeStatus" application. Cleverly named in a strange way by GoPro, so normal users would not associate it to the CodecStatus menu item.

There already is a nice article about the fact that this menu item is bad. And a step-by-step procedure to get rid of the icon. The suggested way could be improved tough.

Knowing that the menu bar icons are always backed with a running application, and knowing that this application must be started during the system startup (or user login), I went out to find the startup applications. There are a few places where applications can be configured to start automatically.
First one to look is in the System Preferences under Users & Groups. Next to the current user, you'll find a tab Login Items. No sign of GoPro here.

Next place is /Library/LaunchAgents/ to go there, open Finder press CMD+Shift+g, type the path and press enter.

There you'll find com.gopro.stereomodestatus.plist, it contains the configuration that will start the StereoModeStatus with every system boot.
Simply delete this file (back it up if you want to be careful), and you will not see the CodecStatus menu icon after rebooting.

To get rid of the icon without rebooting, just select Quit Codecstatus from the menu.


2013-05-14

mdworker: unable to talk to lsboxd

Too long without a crash already. Yesterday nothing interesting happened. Today no sign of anything crashing on my machine. Time to find something broken.
In my Console.app, a few messages repeat endlessly. I have noticed them before, but did not give it much attention as nothing seemed really broken. These are the messages:

May 14 15:28:41 Berik.local mdworker[88273]: Unable to talk to lsboxd
May 14 15:28:41 Berik.local sandboxd[88275] ([88274]): mdworker(88274) deny mach-lookup com.apple.ls.boxd
May 14 15:28:41 Berik kernel[0]: Sandbox: sandboxd(88275) deny mach-lookup com.apple.coresymbolicationd

These messages are related. Jay Barnes suggests to boot in safe mode to fix these warnings.
So, here we go.
There is an apple support page on how to boot in safe mode.
When I tried, the boot got stuck on 1/3rd on the progress bar. I waited for an hour, but the boot was obviously not going to happen.

Which brings me to this article about resolving failing safe mode boots. It turs out that I had some file system errors, and needed to boot to "Recovery" mode. After fixing the filesystem issues, and sending a bugreport to apple for the hanging safe boot (there should at least be some message displayed to the user),  the safe boot still hangs at 1/3rd of the progress bar.

Next will be to see the logs during the safe boot by changing the nvram: sudo nvram boot-args="-v -x"

This command will change the NVRam, memory that is not erased by rebooting and not erased by changing disk drives. The CNet article suggests to reset the NVRam after the safe boot was done.
The nvram command line utility can safe your current nvram to a file so you can restore it later.

To safe your current nvram: nvram -p > ~/nvram
To later restore the nvram: nvram -f ~/nvram

Before rebooting, I write down the keyboard shortcut to reset the nvram: Cmd-Opt-P-R These keys should be pressed while your machine is booting. The nvram will be reset when the screen becomes grey, then goes black. This is when you should release the keys and wait for the machine to boot normally again.

The debug output during the safe mode boot did not yield much. The last lines where:
** /dev/rdisk0s2
    Using cacheBlockSize=32K cacheTotalBlock=98304 cacheSize=3145728K.
** Root file system
    Executing fsck_hfs (version diskdev_cmds-557~393).
** Checking Journaled HFS Plus volume.
   The volume name is Mackintosh HD
** Checking extents overflow file.
** Checking catalog file.
AppleUSBMultitouchDriver::checkStatus - received Status Packet, Payload 2: device was reinitialised
** Checking multi-linked files.
** Checking catalog hierarchy.
** Checking extended attributes file.

The apple bug report was closed as "duplicate". Apple already knows that booting in safe mode can cause a system hang.



Xcode: lockdown_connection_destroy

After a reboot I opened DiskUtility, and clicked verify disk on the main system disk.
Xcode started (automatically because it was open before the shut-down) and crashed with the following report:

Process:         Xcode [178]
Path:            /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:      com.apple.dt.Xcode
Version:         4.6.2 (2067.2)
Build Info:      IDEApplication-2067002000000000~2
App Item ID:     497799835
App External ID: 15055625
Code Type:       X86-64 (Native)

Date/Time:       2013-05-14 18:07:50.136 +0200
OS Version:      Mac OS X 10.8.3 (12D78)

Crashed Thread:  7  Dispatch queue: gputools.DYMobileDevice.0x40260e0a0.main

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000010000000108

VM Regions Near 0x10000000108:
    MALLOC (reserved)      0000000608000000-0000000800000000 [  7.9G] rw-/rwx SM=NUL  reserved VM address space (unallocated)
--> 
    JS JIT generated code  00005f925b400000-00005f925b401000 [    4K] ---/rwx SM=NUL  

Application Specific Information:
ProductBuildVersion: 4H1003
objc[178]: garbage collection is ON

Thread 7 Crashed:: Dispatch queue: gputools.DYMobileDevice.0x40260e0a0.main
0   com.apple.mobiledevice         0x00000001112a0b24 lockdown_connection_destroy + 14
1   com.apple.mobiledevice         0x00000001112a3a87 AMDeviceDisconnect + 44
2   com.apple.mobiledevice         0x00000001112a3900 AMDeviceConnect + 103
3   com.apple.GPUToolsMobileFoundation 0x0000000113030dae -[DYMobileDevice _startSession:] + 54
4   com.apple.GPUToolsMobileFoundation 0x000000011303108f -[DYMobileDevice _runInSession:] + 41
5   com.apple.GPUToolsMobileFoundation 0x0000000113031229 -[DYMobileDevice _cacheCommonAttributes:] + 162
6   com.apple.GPUToolsMobileFoundation 0x0000000113030a02 __39-[DYMobileDevice setAppleMobileDevice:]_block_invoke_2 + 165
7   libdispatch.dylib             0x00007fff947f50b6 _dispatch_client_callout + 8
8   libdispatch.dylib             0x00007fff947f6723 _dispatch_barrier_sync_f_invoke + 39
9   com.apple.GPUToolsMobileFoundation 0x0000000113030903 __39-[DYMobileDevice setAppleMobileDevice:]_block_invoke + 127
10  libdispatch.dylib             0x00007fff947f50b6 _dispatch_client_callout + 8
11  libdispatch.dylib             0x00007fff947f6723 _dispatch_barrier_sync_f_invoke + 39
12  com.apple.GPUToolsMobileFoundation 0x000000011303087b -[DYMobileDevice setAppleMobileDevice:] + 97
13  com.apple.GPUToolsMobileFoundation 0x000000011303626b __47-[DYMobileDeviceManager _handleDeviceAttached:]_block_invoke + 224
14  libdispatch.dylib             0x00007fff947f8f01 _dispatch_call_block_and_release + 15
15  libdispatch.dylib             0x00007fff947f50b6 _dispatch_client_callout + 8
16  libdispatch.dylib             0x00007fff947f647f _dispatch_queue_drain + 235
17  libdispatch.dylib             0x00007fff947f62f1 _dispatch_queue_invoke + 52
18  libdispatch.dylib             0x00007fff947f61c3 _dispatch_worker_thread2 + 249
19  libsystem_c.dylib             0x00007fff8e276d0b _pthread_wqthread + 404
20  libsystem_c.dylib             0x00007fff8e2611d1 start_wqthread + 13


It seems that the GPU might not have been in the stat that Xcode expected.



2013-05-08

No more user input



Just in the nik of time, 23:11, my system stops accepting any input accept for the power button. Trackpad nor keyboard give any response, the cursor is stuck to the screen.
The power button does give a dialog window with some options, but no way to press them.
After closing the laptop lid and reopening, the screen stays black.

I could recover the machine by long-pressing the power button. After that, all applications are neatly restored (accept Chrome, the Chrome tabs do not get restored somehow..). So I set out for a quick check what went wrong.

No crash report, and in the system logs is little information. The only suspicious lines I could find are these:


2013-05-08 23:06:01.922 warmd[55]: [_bootcachectl_playlist_for_file:3158] Unable to generate playlist for file: 22 Invalid argument
2013-05-08 23:06:01.923 warmd[55]: [_bootcachectl_playlist_for_file:3158] Unable to generate playlist for file: 22 Invalid argument
2013-05-08 23:06:01.923 warmd[55]: [_bootcachectl_playlist_for_file:3158] Unable to generate playlist for file: 22 Invalid argument
2013-05-08 23:06:18.000 kernel[0]: FTDIUSBSerialDriver:        0  4036001 start - ok

This is basically the last exciting thing in the logs before I force-restarted my machine.
Quick searching on Google did not help me to understand the issue better, I'll try to get some more info on this later.

Coming days I will not spend behind the computer, so probably it will be a few days without posts on this blog.

Finder copy bundle folders


No big crashes to report today. But some nasty behaviour in Finder.app.
When trying to copying files from and too a bundle, an infinite spinner pops up. Killing Finder.app removes the spinner, the files not copied. Trying again yielded a grey folder at the destination location.

I got to do this strange action because of the bad design of the Arduino IDE. The libraries of an Arduino project reside inside the Arduino.app. So if you want to add a library to your project, you need to change your IDE. I could continue to rant about the bad software design of Arduino, but that's not the subject of this blog.
Before adding my custom libraries, and hacking some code there, I've made a backup of the libraries folder in Arduino.app. Now I wanted to recover a library from the backup, so I copied from and to the Arduino.app bundle, the destination location already existed. Finder can't handle it.

I went inside the Arduino.app with the Terminal, found that the folder was there, but empty. By using the Terminal, it's easy to just

  rm dir; cp ../libraries_backup/dir . 

So that's what I did, and what Finder couldn't do today.


2013-05-07

IMTransferAgent



Oef, I was worried that there would be no crash today.
I even considered to describe some earlier crashes, which would be a bit lame, although there are some impressive ones I'd like to post here.

But luckily, 17:55, nearing the end of the working day, IMTransferAgent saved the day.
With no apparent cause, just the move of the mouse after some idling, the crashreporter showed this beauty:


Process:         IMTransferAgent [479]
Path:            /System/Library/PrivateFrameworks/IMTransferServices.framework/XPCServices/IMTransferAgent.xpc/Contents/MacOS/IMTransferAgent
Identifier:      IMTransferAgent
Version:         8.0 (900)
Code Type:       X86-64 (Native)
Parent Process:  ??? [1]
User ID:         501

Date/Time:       2013-05-07 17:53:24.873 +0200
OS Version:      Mac OS X 10.8.3 (12D78)
Report Version:  10


Crashed Thread:  3  Dispatch queue: SSLContextHelper

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: EXC_I386_GPFLT



Thread 3 Crashed:: Dispatch queue: SSLContextHelper
0   com.apple.security             0x00007fff87dccdf5 Security::RefPointer<Security::CssmClient::ObjectImpl>::release() + 21
1   com.apple.security             0x00007fff87e1e5c6 std::_Rb_tree<long, std::pair<long const, SSDatabase>, std::_Select1st<std::pair<long const, SSDatabase> >, std::less<long>, std::allocator<std::pair<long const, SSDatabase> > >::_M_erase(std::_Rb_tree_node<std::pair<long const, SSDatabase> >*) + 46
2   com.apple.security             0x00007fff87e75f2e SSDLSession::~SSDLSession() + 590
3   com.apple.security             0x00007fff87e1e32a SSDLSession::~SSDLSession() + 18
4   com.apple.security             0x00007fff87df1b0a Security::CssmPlugin::moduleDetach(long) + 220
5   com.apple.security             0x00007fff87e1e28f CSSM_SPI_ModuleDetach__apple_cspdl + 35
6   com.apple.security             0x00007fff87df1861 Attachment::detach(bool) + 127
7   com.apple.security             0x00007fff87df164f CSSM_ModuleDetach + 33
8   com.apple.security             0x00007fff87df15f8 Security::CssmClient::AttachmentImpl::deactivate() + 44
9   com.apple.security             0x00007fff87df1593 Security::CssmClient::AttachmentImpl::~AttachmentImpl() + 31
10  com.apple.security             0x00007fff87e1e226 Security::CssmClient::CSPDLImpl::~CSPDLImpl() + 32
11  com.apple.security             0x00007fff87e8f421 Security::CssmClient::SSCSPDLImpl::~SSCSPDLImpl() + 25
12  com.apple.security             0x00007fff87dcce28 Security::RefPointer<Security::CssmClient::ObjectImpl>::release() + 72
13  com.apple.security             0x00007fff87de601c Security::CssmClient::ObjectImpl::~ObjectImpl() + 54
14  com.apple.security             0x00007fff87e1e0a3 Security::CssmClient::SSDbImpl::~SSDbImpl() + 25
15  com.apple.security             0x00007fff87dcce28 Security::RefPointer<Security::CssmClient::ObjectImpl>::release() + 72
16  com.apple.security             0x00007fff87f34937 Security::KeychainCore::KeychainImpl::~KeychainImpl() + 239
17  com.apple.security             0x00007fff87e1df32 Security::KeychainCore::KeychainImpl::~KeychainImpl() + 18
18  com.apple.security             0x00007fff87dccf2a Security::CFClass::refCountForType(long, void const*) + 190
19  com.apple.CoreFoundation       0x00007fff8de83324 CFRelease + 324
20  com.apple.security             0x00007fff87deca5f std::vector<Security::KeychainCore::Keychain, std::allocator<Security::KeychainCore::Keychain> >::~vector() + 33
21  com.apple.security             0x00007fff87f2e4b4 Security::KeychainCore::Trust::~Trust() + 48
22  com.apple.security             0x00007fff87e1da86 Security::KeychainCore::Trust::~Trust() + 18
23  com.apple.security             0x00007fff87dccf2a Security::CFClass::refCountForType(long, void const*) + 190
24  com.apple.CoreFoundation       0x00007fff8de83324 CFRelease + 324
25  com.apple.security             0x00007fff87e532a3 _sslContextDestroy + 156
26  com.apple.CoreFoundation       0x00007fff8de833df CFRelease + 511
27  com.apple.security             0x00007fff87e2599e SSLDisposeContext + 19
28  com.apple.CFNetwork           0x00007fff910236ae __removeRetain_block_invoke_0 + 39
29  libdispatch.dylib             0x00007fff8e262f01 _dispatch_call_block_and_release + 15
30  libdispatch.dylib             0x00007fff8e25f0b6 _dispatch_client_callout + 8
31  libdispatch.dylib             0x00007fff8e26047f _dispatch_queue_drain + 235
32  libdispatch.dylib             0x00007fff8e2602f1 _dispatch_queue_invoke + 52
33  libdispatch.dylib             0x00007fff8e2601c3 _dispatch_worker_thread2 + 249
34  libsystem_c.dylib             0x00007fff87ce0d0b _pthread_wqthread + 404
35  libsystem_c.dylib             0x00007fff87ccb1d1 start_wqthread + 13



I've posted the relevant parts of the crashlog. Let's see what went wrong here.
IMTransferAgent's name suggests it handles Instant-Message file transfers. Because its name, and the fact that it runs as a deamon, the fact that is uses a lot of Apple libraries, it can only be a helper deamon of Messages.app. The same Messages.app that did not let me log in yesterday.

What's interesting here is that the crash is actually caused by (the usage of) the core apple security library. So what was the IMTransferAgent doing? The stack tells us some object got released, and the implementation of release crashed. Earlier in the stack we see _sslContextDestroy, probably the server communication has ended and upon finalising the deamon crashed.

This code is open source.
Let me find some time later, and describe in more detail what went wrong.

Could this have been done better? YES.
The deamon could have handled it's own crash and restarted without showing a crashlog to the user.





2013-05-06

iMessage

Because I encounter crashes or weird behaviour almost daily on my computer, I decided to blog about it. In the first place to get some piece out of it, maybe to help others, and it might be fun to read also.

Today Messages.app is my antagonist. No more iCloud messages come in since this morning.
I naturally logged out, using the Messages.app preferences. After that, logging back in is no longer possible. After a 30 second spinner I get:

"Could not sign in. Please check your network connection and try again." the alert prompts me.
So I checked my network, everything works fine.

I've quit Messages.app, restarted, no fix.
I've rebooted the computer, retried logging in, no fix.

I've run Charles HTTP Proxy, and can't see any traffic when starting logging in to iMessage. It's not sure wether I should see anything there.

For now, iMessages stays broken.

EDIT: New day, new attempt. First I found this: http://forums.macrumors.com/showthread.php?t=1525106
No help for me there, my hosts file is normal and my computer a real mac (no hackintosh).
After failing twice, Messages has me now logged in again.