{"id":41069,"date":"2023-11-14T17:26:16","date_gmt":"2023-11-14T22:26:16","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=41069"},"modified":"2023-11-14T17:26:16","modified_gmt":"2023-11-14T22:26:16","slug":"on-crash-backtraces-in-swift","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2023\/11\/14\/on-crash-backtraces-in-swift\/","title":{"rendered":"On-Crash Backtraces in Swift"},"content":{"rendered":"<p><a href=\"https:\/\/www.swift.org\/blog\/swift-5.9-backtraces\/\">Alastair Houghton<\/a>:<\/p>\n<blockquote cite=\"https:\/\/www.swift.org\/blog\/swift-5.9-backtraces\/\">\n<p>Prior to Swift 5.9, all you would get when your program fails is a message from the parent process (often the shell) telling you that the child process crashed[&#8230;]<\/p>\n<p>[&#8230;]<\/p>\n<p>Now, instead of the opaque message above, the result looks something like this[&#8230;]<\/p>\n<p>[&#8230;]<\/p>\n<p>This new feature greatly improves the on-crash debugging experience on Linux, where it is on by default. It is useful on macOS as well, but must be manually enabled.<\/p>\n<\/blockquote>\n<p>There are also interactive backtraces:<\/p>\n<blockquote cite=\"https:\/\/www.swift.org\/blog\/swift-5.9-backtraces\/\"><p>The idea behind this feature is that it leaves the program suspended (by default for 30 seconds, but this is configurable) and provides you with the opportunity to either attach a debugger, or perform some additional inspection of the crashed process.<\/p><p>If you tap the spacebar when this prompt appears, you will be presented with a simple command prompt that allows you to change the backtracer settings, generate a new backtrace, list loaded images, display register and memory contents, and get a listing of all of the threads in the process.<\/p><\/blockquote>\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2023\/10\/16\/what-happened-to-__crashreporter_info__\/\">What Happened to __crashreporter_info__?<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Alastair Houghton: Prior to Swift 5.9, all you would get when your program fails is a message from the parent process (often the shell) telling you that the child process crashed[&#8230;] [&#8230;] Now, instead of the opaque message above, the result looks something like this[&#8230;] [&#8230;] This new feature greatly improves the on-crash debugging experience [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2023-11-14T22:26:19Z","apple_news_api_id":"c3e3047e-db7c-459f-98b1-f4f01fdd2e53","apple_news_api_modified_at":"2023-11-14T22:26:19Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/Aw-MEftt8RZ-YsfTwH90uUw","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[2479,56,448,30,2385,71,901],"class_list":["post-41069","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-crash-reporter","tag-debugging","tag-linux","tag-mac","tag-macos-14-sonoma","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/41069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=41069"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/41069\/revisions"}],"predecessor-version":[{"id":41070,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/41069\/revisions\/41070"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=41069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=41069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=41069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}