{"id":74,"date":"2014-11-28T21:43:37","date_gmt":"2014-11-28T13:43:37","guid":{"rendered":"http:\/\/www.zhuyanbin.com\/?p=74"},"modified":"2014-12-01T22:45:02","modified_gmt":"2014-12-01T14:45:02","slug":"fix-for-chrome-crash-in-yosemite-10-10-2","status":"publish","type":"post","link":"https:\/\/www.yanbin888.com\/?p=74","title":{"rendered":"Fix for Chrome crash in Yosemite 10.10.2"},"content":{"rendered":"<h1>Temporary fix<\/h1>\n<p>Put the following in a file &#8220;patch.m&#8221;:<\/p>\n<blockquote><p>\n#import &lt;AppKit\/AppKit.h&gt;<br \/>\n__attribute((constructor)) void Patch_10_10_2_entry()<br \/>\n{<br \/>\nNSLog(@&#8221;10.10.2 patch loaded&#8221;);<br \/>\n}<br \/>\n@interface NSTouch ()<br \/>\n&#8211; (id)_initWithPreviousTouch:(NSTouch *)touch newPhase:(NSTouchPhase)phase position:(CGPoint)position isResting:(BOOL)isResting force:(double)force;<br \/>\n@end<br \/>\n@implementation NSTouch (Patch_10_10_2)<br \/>\n&#8211; (id)_initWithPreviousTouch:(NSTouch *)touch newPhase:(NSTouchPhase)phase position:(CGPoint)position isResting:(BOOL)isResting<br \/>\n{<br \/>\nreturn [self _initWithPreviousTouch:touch newPhase:phase position:position isResting:isResting force:0];<br \/>\n}<br \/>\n@end\n<\/p><\/blockquote>\n<p>Compile it:<\/p>\n<blockquote><p>clang -dynamiclib -framework AppKit patch.m -o patch.dylib<\/p><\/blockquote>\n<p>Use it:<\/p>\n<blockquote><p>env DYLD_INSERT_LIBRARIES=\/path\/to\/patch.dylib &#8220;\/path\/to\/Google Chrome.app\/Contents\/MacOS\/Google Chrome&#8221;<\/p><\/blockquote>\n<h1><strong>Safer way<\/strong><\/h1>\n<p>A safer way would be to copy the 10.1.1 AppKit.framework and create as a local framework for just Google Chrome:<\/p>\n<blockquote><p>cd \/Applications\/Google Chrome.app\/Contents\/<br \/>\nmkdir Frameworks<br \/>\ncp -R path-to-10.1.1\/AppKit.framework Frameworks\/<br \/>\ninstall_name_tool -change \/System\/Library\/Frameworks\/AppKit.framework\/Versions\/C\/AppKit @executable_path\/..\/Frameworks\/AppKit.framework\/Versions\/C\/AppKit MacOS\/Google Chrome\n<\/p><\/blockquote>\n<p>link: \u00a0<a title=\"http:\/\/www.reddit.com\/r\/apple\/comments\/2n721c\/temporary_fix_for_chrome_crash_in_yosemite_10102\/\" href=\"http:\/\/www.reddit.com\/r\/apple\/comments\/2n721c\/temporary_fix_for_chrome_crash_in_yosemite_10102\/\" target=\"_blank\">http:\/\/www.reddit.com\/r\/apple\/comments\/2n721c\/temporary_fix_for_chrome_crash_in_yosemite_10102\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Temporary fix Put the following in a file &#8220;patch. <span class=\"ellipsis\">&hellip;<\/span> <span class=\"more-link-wrap\"><a href=\"https:\/\/www.yanbin888.com\/?p=74\" class=\"more-link\"><span>Read More &rarr;<\/span><\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[6],"class_list":["post-74","post","type-post","status-publish","format-standard","hentry","category-mac","tag-mac-os-x"],"_links":{"self":[{"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=\/wp\/v2\/posts\/74","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=74"}],"version-history":[{"count":15,"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=\/wp\/v2\/posts\/74\/revisions"}],"predecessor-version":[{"id":89,"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=\/wp\/v2\/posts\/74\/revisions\/89"}],"wp:attachment":[{"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yanbin888.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}