I converted my private ssh keys in June to a PKCS #8 format by following Martin Kleppmann’s instructions. This worked fine on both my personal and work machines for the past few months.
With the Mavericks update, I suddenly found myself unable to ssh to hosts that were set to only use private/public key authentication. It turns out that PKCS #8 isn’t supported by
openssl, and attempting to open my converted ssh key just fails.
I was able to restore my old keys from a Time Machine backup prior to when I converted them (which, you’ll note, somewhat defeats the purpose of the above conversion, but so it goes.) If you don’t have a time-dated backup to retrieve them from, I’m not sure what hoops you’ll need to jump through to convert your keys back into a format that 10.9’s
openssl can read. I suspect options are limited to either using a version of
openssl running on Mavericks that can read the format, or using a different machine altogether.
Update: November 8th: Joe Johnson posted some instructions on how to install
openssh with Homebrew to get things working again.
What’s New in Xcode 5.0 contains a very short mention of some very fantastic documentation generation that’s been added to the IDE:
Project documentation from framework API reference documentation and structured comments in your own source code are displayed in the quick help panel and in code completion popover views. Doxygen and HeaderDoc structured comments are supported formats.
Doxygen’s documentation contains many, many examples of the multitude of ways to document your code, but here’s a simple version that’s easy to comprehend at a glance:
/** * Add a data point to the data source. * (Removes the oldest data point if the data source contains kMaxDataPoints objects.) * * @param aDataPoint An instance of ABCDataPoint. * @return The oldest data point, if any. */ - (ABCDataPoint *)addDataToDataSource:(ABCDataPoint *)aDataPoint;
This renders in Xcode as:
(Don’t worry about the mismatch between the code above and my actual declaration from the screenshot, this is merely illustrative.)
My personal favorite, though, is how incredibly, fantastically, amazingly simple and easy it is to add documentation to a property:
/// Base64-encoded data. @property (nonatomic, strong) NSData *data;
When option-clicked, this lovely popover appears:
If you’ve been practicing good documentation and already had comments above your properties, you’re in luck:
// This property stores the name of a user.`
You can add that comment to the option-click documentation by adding a single forward slash to that comment. How great is that?!
… Clang parses the comments and can detect syntactic and semantic errors in comments. These warnings are off by default. Pass -Wdocumentation flag to enable warnings about documentation comments.
This will warn when the documentation’s variable names or return types don’t match the method signature.
Xcode’s documentation appears to bind to the first declaration of a method. If you’ve not DRY-ed out your code when Xcode 4.3 made forward-declarations of methods optional, that means you’ll want to add your documentation to your forward declared method, not your actual implementation.
More information about Xcode’s DRY improvements coming soon.
“We often think that freedom means saying yes to what we want to do, but freedom also comes from saying no to the stuff we don’t want to do.”
When an iOS application is built for release to beta testers or for submission to the App Store, its debugging symbols are stripped. This makes the application’s binary smaller, but it also makes the OS-generated crash reports not very human-readable. Crashlytics, HockeyApp, and other third-party crash reporting services handle symbolication automatically, but sometimes things break. This article is for those times when you need it done right, and that means doing it yourself.
To symbolicate an unsymbolicated crash report, you’ll need the raw crash log, and the archive for the particular application that produced it. The application archive will include a copy of the application’s
.app bundle, and a
dSYM file that contains its debugging information.1
symbolicatecrash.pl, simply execute the script with the crash log passed as an argument:
% symbolicatecrash.pl crash.log
The script will output a symbolicated copy of the crash log.
This sometimes happens. Check that Spotlight is working properly:
symbolicatecrash.pl (and Xcode) use
mdfind to locate the necessary iOS and application symbol files, so it needs to be enabled on the volume containing the
To diagnose what step of symbolication went wrong, run
-v to see what it’s doing, and to get more information about what caused the failure.
symbolicatecrash.pl has found the symbols for
CoreFoundation in the iOS Device Support directory in
~/Library. If the OS version of the crash report is one that doesn’t have symbols in
~/Library/Developer/Xcode/iOS DeviceSupport/, you’ll need to gather them from a device running that version of iOS. To collect symbols from a device, simply plug it into your machine while Xcode is running. If you don’t have a device, ask a colleague/friend/the internet for a copy of collected symbols for that iOS version. (In this example, it’s iOS 6.1.4, build number 10B350).
symbolicatecrash.pl looking for the symbols for an app called “DemoApp”:
fetching symbol file for DemoApp--[undef] Searching ...-- NO MATCH Searching in Spotlight for dsym with UUID of 4c5aea04bc8f40d59124abd5d87191c4 Running mdfind 'com_apple_xcode_dsym_uuids == 4C5AEA04-BC8F-40D5-9124-ABD5D87191C4" Running mdls -name com_apple_xcode_dsym_paths <path to .dSYM file> @dsym_paths = ( ~/Desktop/DemoApp.app.dSYM/Contents/Resources/DWARF/DemoApp ) @exec_names = ( DemoApp ) Running mdfind "kMDItemContentType == com.apple.application-bundle && kMDItemFSName == 'DemoApp.app'" Running mdfind "kMDItemContentType == public.unix-executable && kMDItemFSName == 'DemoApp'" [output snipped] Running xcrun -sdk iphoneos lipo -info '<path to .app>/<app name>' Running xcrun -sdk iphoneos otool -arch armv7s -l '<path to .app>/<app name>' Number of symbols in <path to .app>/<app name>: 1 + 1 = 2 Found executable <path to .app>/<app name> -- MATCH
If you’ve got a Finder window with the archive selected, but
symbolicatecrash.pl is insisting it can’t find it, run
mdfind manually with the same content type or UUID parameters to debug why. In the few times this has been the case, it’s been a Spotlight-related issue where the archive file or its parent folder isn’t in the Spotlight index. To solve this, open Spotlight preference pane’s, add the parent folder to the excluded folders list, then remove it (thereby re-indexing the folder).
If you’re still having problems, post a question on Stack Overflow and we’ll figure it out.
References and Further Reading:
When manually using
atos, there’s some funny math to do because of address sliding and the in-memory layout used in iOS. iOS crash reports: atos not working as expected discusses that, though I can’t vouch for its accuracy on iOS 7.0.
(Editor’s note: for the first time, The Confusatory has a commenting system. I’d love to discuss these topics and links and hear your thoughts about them. More generally, I’d also like some feedback regarding which topics you’ve enjoyed reading about.)
The Writing Revolution. The Atlantic examines literacy and basic grammar skills in the United States’ education system. They look at some reasons why students are, or more commonly, are not, graduating with strong writing skills.
The Suburbanization of Poverty. Sub-urban regions are stumbling in the post-recession economy. Their residents have suffered job losses and shrunken payrolls similar to other regions, but higher fixed costs and a lack of housing mobility has made it a much stickier downturn. Weak or no public transit means choosing between buying gas and buying groceries, and underwater mortgages are more difficult to walk away from than too-expensive rent.
Hey programmers, we need to talk. Discourse on the internet is almost universally recognized as somewhere between “not worth the trouble” and “full of horrible people”. Comments are the worst offenders, whether it’s on the political blogs on the Washington Post or on a technical article on Hacker News. This author discusses the time-vs-reward trade-off for internet commentary and contributing Real Work to the community, and I enjoyed the unscientific but disappointingly accurate graphs that accompany his discussion.
How Caffeine Can Cramp Creativity. I’ve been careful about my caffeine intake since 2010, when I first noticed its impact on my focus at work. My last two client engagements were fantastic opportunities to experiment with my sleep, food, exercise, and caffeine habits and see how they affected my energy levels and my creativity, focus, and problem-solving abilities throughout the day.
Code Reviews as Relationship Builders. A developer from the Khan Academy and Fog Creek discusses some very useful modes of thinking and specifics lessons for code reviews. I spent four months working on an iOS application with a very strict code review policy, and while it’s likely I’ll institute a review process in my next position, the goals and implementation will differ significantly.
Suddenly, We’re Ubiquitous. There are thousands of photos of each of us on the internet. Almost none of them were taken by people we know. Those photos are one quick algorithmic scrape away from becoming an irrevocable part of our semi-public internet persona.
“[F]ew weapons in the arsenal of freedom are more useful than the power to compel a government to disclose the evidence on which it seeks to forfeit the liberty of its citizens.”
The news around the NSA surveillance programs has been a roller coaster, and I think there’s something to be learned from the behaviour of The Guardian and The Washington Post.
From June to August, the news cycle in the US was singularly focused on one topic: where is Edward Snowden? Will he flee Hong Kong before a government operative disappears him? Where will he go to avoid extradition to the United States?
Snowden’s request to Russia for asylum was granted at the beginning of August. With his short-term safety somewhat more assured, the human interest angle disappeared, and coverage of the topic was forced to shift to real news: the massive size and scope of un-Constitutional domestic spying (and un-ethical foreign spying) programs run by the NSA and other government agencies in the name of “thwarting terrorism”.
Both publications (and many others) have been steadily releasing documents since they received them in June. The government has, surprisingly, reacted to each revelation in isolation. The papers have been playing a masterful game of chess. They release a document and let the reactions happen: the public shrugs it off out of incomprehensibility while domain experts are outraged; officials make on-the-record statements about its meaning; the president informs us that we’re simply misunderstanding a program’s purpose and goals, and it’s not directly targeted at citizens so don’t worry about it; a director assures us that despite a program’s abuse-of-power potential, it simply isn’t happening in any significant or meaningful quantity. The next document is published once the dust has settled, and it shows how every statement made by public officials lies on a spectrum ranging from misleading denial to “least untruthful answer” or just plain lying.
Here’s a simple guide to publishing a massive amount of information, like the State Department cables or the NSA documents.
I’ve been very, very pleased with the tone and focus of the news the past few weeks around the NSA’s spying programs. Substantive topics are finally being discussed, polls from the public are turning against the government for the first time in decades, and even though I know the words I’m typing will be routed through a closet in an AT&T building in downtown San Francisco and routed to an analyst’s desk for a quick risk assessment (I should be so lucky), I believe our years of editorializing and harping on the topic and the numerous Thanksgiving dinners spent explaining online privacy and encryption to mom and pop are starting to add up to something.
I’ve taken my phone out of my pocket about 15 times today to check Twitter, only to remember that I’m not getting back on it yet/ever. The habit is still there. Walking from the underground station towards home? Let’s see what’s happened since I got on the train; surely there has been a funny thing said by someone.