{"id":4552,"date":"2013-02-03T00:51:33","date_gmt":"2013-02-02T23:51:33","guid":{"rendered":"http:\/\/blog.netspark.de\/?p=4552"},"modified":"2013-02-04T01:05:46","modified_gmt":"2013-02-04T00:05:46","slug":"mac-programs-easily-to-crash","status":"publish","type":"post","link":"https:\/\/blog.netspark.de\/?p=4552","title":{"rendered":"Mac programs easily to crash"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"size-Post Icon wp-image-1899 alignleft\" title=\"AppleWorm\" src=\"https:\/\/blog.netspark.de\/wp-content\/uploads\/2011\/11\/1227973349555699557rg1024_cartoon_apple_with_worm_svg_hi-64x64.png\" alt=\"\" width=\"64\" height=\"64\" srcset=\"https:\/\/blog.netspark.de\/wp-content\/uploads\/2011\/11\/1227973349555699557rg1024_cartoon_apple_with_worm_svg_hi-64x64.png 64w, https:\/\/blog.netspark.de\/wp-content\/uploads\/2011\/11\/1227973349555699557rg1024_cartoon_apple_with_worm_svg_hi-150x150.png 150w, https:\/\/blog.netspark.de\/wp-content\/uploads\/2011\/11\/1227973349555699557rg1024_cartoon_apple_with_worm_svg_hi-24x24.png 24w\" sizes=\"auto, (max-width: 64px) 100vw, 64px\" \/>It seems as if Apple has an internal problem with the Spell checking routine that<br \/>\nis serving many programs in OS X to use the correct words. However a simple<br \/>\nstring may crash exactly this routine as the string ends up in a procedure that is<br \/>\nnot supported properly and thus crashing every application using Spell checking.<\/p>\n<p><!--more-->Nik Cubrilovic has investigated the problem:<\/p>\n<div class=\"post_citation\">\n<p>checkDataDetectors will  extract &#8216;File:\/\/a\/&#8217; &#8211; or any other &#8216;complete&#8217; file URL &#8211; which at a  minimum is a schema (file:\/\/) and a path &#8216;\/&#8217; &#8211; as a valid data URL and  then pass it to  DDResultCopyExtractURL, which does some additional  sanity checking.There it validates it by asserting that the URL  begins with &#8216;file:\/\/&#8217;, which it doesn&#8217;t. It then converts to an  NSInternalInconsistencyException which is what crashes the application,  since it isn&#8217;t caught.<\/p>\n<p>The timing differences that people are  seeing is because the NSSpellCheckerCheckString process checks the  spelling only after your key entry has been idle for a short period.<\/p>\n<p>checkDataDetectors  will also run if you simply open a file or application with this text  inside it in a text control. When declaring your text control class you  can disable the automated spell checking and data extraction (which will  run even if you have spell checking disabled).<\/p>\n<p>There really is no  need for this thread to be filling up with &#8216;it works on x, doesn&#8217;t work  on y&#8217;, since we know what causes this (any NSTextField on Mountain  Lion).<\/p>\n<p>If you want to have a look at it and can&#8217;t read the crash report, attach to TextEdit with gdb<\/p>\n<pre><span style=\"font-size: small;\"><code>    $ gdb \/Applications\/TextEdit.app\/Contents\/MacOS\/TextEdit\r\n    (gdb) r\r\n    &lt;switch to textmate and type 'file:\/\/a\/aaaaa' into a new doc'&gt;\r\n    (gdb) &lt;crash report&gt;\r\n    (gdb) disass DDResultCopyExtractedURL\r\n    &lt;dump of function&gt;\r\n<\/code><\/span><\/pre>\n<p>Also, this means the bug can&#8217;t be exploited<\/p>\n<\/div>\n<p>So although this problem may affect workflow locally, the bug cannot be used for a security exploit. But it is annoying. I guess it won&#8217;t take long until Apple is bringing out a patch that fixes this issue.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It seems as if Apple has an internal problem with the Spell checking routine that is serving many programs in OS X to use the correct words. However a simple string may crash exactly this routine as the string ends up in a procedure that is not supported properly and thus crashing every application using [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[55,4,3],"tags":[385,1919,2372,2371],"class_list":["post-4552","post","type-post","status-publish","format-standard","hentry","category-computer-2","category-curiosities","category-news","tag-apple","tag-bug","tag-exploit","tag-spell-check"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.netspark.de\/index.php?rest_route=\/wp\/v2\/posts\/4552","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.netspark.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.netspark.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.netspark.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.netspark.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4552"}],"version-history":[{"count":0,"href":"https:\/\/blog.netspark.de\/index.php?rest_route=\/wp\/v2\/posts\/4552\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.netspark.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4552"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.netspark.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4552"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.netspark.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4552"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}