Skip to content

Instantly share code, notes, and snippets.

@RightFS
Forked from naveenkrdy/AdobeAMDFix.md
Last active September 25, 2021 21:36
Show Gist options
  • Save RightFS/d696220271ec37e54fc9db9af03b8bcb to your computer and use it in GitHub Desktop.
Save RightFS/d696220271ec37e54fc9db9af03b8bcb to your computer and use it in GitHub Desktop.
To fix adobe products crashes on AMD hackintosh 修复AMD黑苹果Adobe全家桶崩溃

Adobe Crash Fix XLNC

Instructions

  1. Install needed adobe apps from adobe creative cloud.

  2. Open Terminal.

  3. Copy-paste the below command to your terminal and run it (enter password if asked).

for file in MMXCore FastCore TextModel dvaaudiodsp Camera\ Raw libtbbmalloc.dylib libintl.dylib libirc.dylib ibintlc.dylib libtbb.dylib libiomp5.dylib; do
    find /Applications/Adobe* -type f -name $file | while read -r FILE; do
        sudo -v
        echo "found $FILE"
        [[ ! -f ${FILE}.back ]] && sudo cp -f $FILE ${FILE}.back || sudo cp -f ${FILE}.back $FILE
        echo $FILE | grep libiomp5 >/dev/null
        if [[ $? == 0 ]]; then
            dir=$(dirname "$FILE")
            [[ ! -f ${HOME}/libiomp5.dylib ]] && cd $HOME && curl -sO https://excellmedia.dl.sourceforge.net/project/badgui2/libs/mac64/libiomp5.dylib
            echo -n "replacing " && sudo cp -vf ${HOME}/libiomp5.dylib $dir && echo
            continue
        fi
        echo $FILE | grep TextModel >/dev/null
        [[ $? == 0 ]] && echo "emptying $FILE" && sudo echo -n >$FILE && continue
        echo "patching $FILE \n"
        sudo perl -i -pe 's|\x90\x90\x90\x90\x56\xE8\x6A\x00|\x90\x90\x90\x90\x56\xE8\x3A\x00|sg' $FILE
        sudo perl -i -pe 's|\x90\x90\x90\x90\x56\xE8\x4A\x00|\x90\x90\x90\x90\x56\xE8\x1A\x00|sg' $FILE
    done
done
for file in MMXCore FastCore TextModel dvaaudiodsp Camera\ Raw libtbbmalloc.dylib libintl.dylib libirc.dylib ibintlc.dylib libtbb.dylib libiomp5.dylib; do
    find /Library/Application\ Support/Adobe* -type f -name $file | while read -r FILE; do
        sudo -v
        echo "found $FILE"
        [[ ! -f ${FILE}.back ]] && sudo cp -f $FILE ${FILE}.back || sudo cp -f ${FILE}.back $FILE
        echo $FILE | grep libiomp5 >/dev/null
        if [[ $? == 0 ]]; then
            dir=$(dirname "$FILE")
            [[ ! -f ${HOME}/libiomp5.dylib ]] && cd $HOME && curl -sO https://excellmedia.dl.sourceforge.net/project/badgui2/libs/mac64/libiomp5.dylib
            echo -n "replacing " && sudo cp -vf ${HOME}/libiomp5.dylib $dir && echo
            rm -f ${HOME}/libiomp5.dylib
            continue
        fi
        echo $FILE | grep TextModel >/dev/null
        [[ $? == 0 ]] && echo "emptying $FILE" && sudo echo -n >$FILE && continue
        echo "patching $FILE \n"
        sudo perl -i -pe 's|\x90\x90\x90\x90\x56\xE8\x6A\x00|\x90\x90\x90\x90\x56\xE8\x3A\x00|sg' $FILE
        sudo perl -i -pe 's|\x90\x90\x90\x90\x56\xE8\x4A\x00|\x90\x90\x90\x90\x56\xE8\x1A\x00|sg' $FILE
    done
done
  1. Now copy-paste the below command to terminal and run it (enter password if asked).
[ ! -d $HOME/Library/LaunchAgents ] && mkdir $HOME/Library/LaunchAgents
AGENT=$HOME/Library/LaunchAgents/environment.plist
sysctl -n machdep.cpu.brand_string | grep FX >/dev/null 2>&1
x=$(echo $(($? != 0 ? 5 : 4)))
cat >$AGENT <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
 <key>Label</key>
 <string>mkl-debug</string>
 <key>ProgramArguments</key>
 <array>
 <string>sh</string>
 <string>-c</string>
    <string>launchctl setenv MKL_DEBUG_CPU_TYPE $x;</string>
 </array>
 <key>RunAtLoad</key>
 <true/>
</dict>
</plist>
EOF
launchctl load ${AGENT} >/dev/null 2>&1
launchctl start ${AGENT} >/dev/null 2>&1
  1. If not work, reboot macOS then retry.

Revert Instructions

  1. To revert run the following command in terminal.
for file in MMXCore FastCore TextModel dvaaudiodsp libtbbmalloc.dylib libintl.dylib libirc.dylib ibintlc.dylib libtbb.dylib libiomp5.dylib; do
    find /Applications/Adobe* -type f -name $file | while read -r FILE; do
        sudo -v
        [[ -f ${FILE}.back ]] && echo "found backup $FILE" && sudo mv -f ${FILE}.back $FILE
    done
done

AGENT=$HOME/Library/LaunchAgents/environment.plist
if [[ -f $AGENT ]]; then
    launchctl unload ${AGENT} >/dev/null 2>&1
    launchctl stop ${AGENT} >/dev/null 2>&1
    rm -rf $AGENT
fi
  1. Reboot macOS

Notes

  • Tested Adobe (2020) Photopshop, LightRoom Classic, Illustrator, Premier Pro, After Effects Bridge, Indesign, XD.
  • If you re-install any adobe app then you will need redo the STEP-3 again.

修复Adobe全家桶在AMD上的崩溃问题

操作说明

  1. 用Adobe Creative Cloud安装好你需要的软件.

  2. 打开终端.

  3. 把下面一段脚本粘贴到终端里按下回车,如果让你输密码你就输入电脑的登录密码后回车.-----替换libiomp5并给文件打二进制补丁

    1. 如果卡住不动或者curl报错请按ctrl+c打断脚本执行,手动下载libiomp5.dylib 提取码: 67tx 放到HOME目录下再重新运行一次脚本.
for file in MMXCore FastCore TextModel dvaaudiodsp Camera\ Raw libtbbmalloc.dylib libintl.dylib libirc.dylib ibintlc.dylib libtbb.dylib libiomp5.dylib; do
    find /Applications/Adobe* -type f -name $file | while read -r FILE; do
        sudo -v
        echo "found $FILE"
        [[ ! -f ${FILE}.back ]] && sudo cp -f $FILE ${FILE}.back || sudo cp -f ${FILE}.back $FILE
        echo $FILE | grep libiomp5 >/dev/null
        if [[ $? == 0 ]]; then
            dir=$(dirname "$FILE")
            [[ ! -f ${HOME}/libiomp5.dylib ]] && cd $HOME && curl -sO https://excellmedia.dl.sourceforge.net/project/badgui2/libs/mac64/libiomp5.dylib
            echo -n "replacing " && sudo cp -vf ${HOME}/libiomp5.dylib $dir && echo
            continue
        fi
        echo $FILE | grep TextModel >/dev/null
        [[ $? == 0 ]] && echo "emptying $FILE" && sudo echo -n >$FILE && continue
        echo "patching $FILE \n"
        sudo perl -i -pe 's|\x90\x90\x90\x90\x56\xE8\x6A\x00|\x90\x90\x90\x90\x56\xE8\x3A\x00|sg' $FILE
        sudo perl -i -pe 's|\x90\x90\x90\x90\x56\xE8\x4A\x00|\x90\x90\x90\x90\x56\xE8\x1A\x00|sg' $FILE
    done
done
for file in MMXCore FastCore TextModel dvaaudiodsp Camera\ Raw libtbbmalloc.dylib libintl.dylib libirc.dylib ibintlc.dylib libtbb.dylib libiomp5.dylib; do
    find /Library/Application\ Support/Adobe* -type f -name $file | while read -r FILE; do
        sudo -v
        echo "found $FILE"
        [[ ! -f ${FILE}.back ]] && sudo cp -f $FILE ${FILE}.back || sudo cp -f ${FILE}.back $FILE
        echo $FILE | grep libiomp5 >/dev/null
        if [[ $? == 0 ]]; then
            dir=$(dirname "$FILE")
            [[ ! -f ${HOME}/libiomp5.dylib ]] && cd $HOME && curl -sO https://excellmedia.dl.sourceforge.net/project/badgui2/libs/mac64/libiomp5.dylib
            echo -n "replacing " && sudo cp -vf ${HOME}/libiomp5.dylib $dir && echo
            rm -f ${HOME}/libiomp5.dylib
            continue
        fi
        echo $FILE | grep TextModel >/dev/null
        [[ $? == 0 ]] && echo "emptying $FILE" && sudo echo -n >$FILE && continue
        echo "patching $FILE \n"
        sudo perl -i -pe 's|\x90\x90\x90\x90\x56\xE8\x6A\x00|\x90\x90\x90\x90\x56\xE8\x3A\x00|sg' $FILE
        sudo perl -i -pe 's|\x90\x90\x90\x90\x56\xE8\x4A\x00|\x90\x90\x90\x90\x56\xE8\x1A\x00|sg' $FILE
    done
done
  1. 再把下面一段脚本粘贴到终端里按下回车,如果让你输密码你就输入电脑的登录密码后回车.----加个开机启动项,作用是设置MKL_DEBUG_CPU_TYPE全局环境变量
[ ! -d $HOME/Library/LaunchAgents ] && mkdir $HOME/Library/LaunchAgents
AGENT=$HOME/Library/LaunchAgents/environment.plist
sysctl -n machdep.cpu.brand_string | grep FX >/dev/null 2>&1
x=$(echo $(($? != 0 ? 5 : 4)))
cat >$AGENT <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
 <key>Label</key>
 <string>mkl-debug</string>
 <key>ProgramArguments</key>
 <array>
 <string>sh</string>
 <string>-c</string>
    <string>launchctl setenv MKL_DEBUG_CPU_TYPE $x;</string>
 </array>
 <key>RunAtLoad</key>
 <true/>
</dict>
</plist>
EOF
launchctl load ${AGENT} >/dev/null 2>&1
launchctl start ${AGENT} >/dev/null 2>&1
  1. 正常应该可以工作了,如果不行那就重启一下电脑,再不行把崩溃报告放上来我看下.

如何恢复

  1. 在终端里运行下面这些命令就可以恢复,不用重新安装.
for file in MMXCore FastCore TextModel dvaaudiodsp libtbbmalloc.dylib libintl.dylib libirc.dylib ibintlc.dylib libtbb.dylib libiomp5.dylib; do
    find /Applications/Adobe* -type f -name $file | while read -r FILE; do
        sudo -v
        [[ -f ${FILE}.back ]] && echo "found backup $FILE" && sudo mv -f ${FILE}.back $FILE
    done
done

AGENT=$HOME/Library/LaunchAgents/environment.plist
if [[ -f $AGENT ]]; then
    launchctl unload ${AGENT} >/dev/null 2>&1
    launchctl stop ${AGENT} >/dev/null 2>&1
    rm -rf $AGENT
fi

注意

  • 测试过 Adobe (2020) Photopshop, LightRoom Classic, Illustrator, Premier Pro, After Effects Bridge, Indesign, XD.
  • 如果你重新安装过软件需要再执行步骤3给它们打上补丁.
@jianghaizhi
Copy link

acrobat 不行

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_pthread.dylib 0x00007fff20410d86 pthread_mutex_lock + 4
1 com.adobe.Acrobat.framework 0x000000010903e864 0x108fb8000 + 551012
2 com.adobe.Acrobat.framework 0x000000010abe529d 0x108fb8000 + 29545117
3 com.adobe.Acrobat.framework 0x000000010abe4b36 0x108fb8000 + 29543222
4 com.adobe.Acrobat.framework 0x000000010abe4cac 0x108fb8000 + 29543596
5 com.adobe.Acrobat.framework 0x000000010995e23f 0x108fb8000 + 10117695
6 com.adobe.Acrobat.framework 0x000000010995d984 0x108fb8000 + 10115460
7 com.adobe.Acrobat.framework 0x0000000109f12d47 0x108fb8000 + 16100679
8 com.adobe.Acrobat.framework 0x000000010900c9da 0x108fb8000 + 346586
9 com.adobe.Acrobat.framework 0x0000000109037af0 0x108fb8000 + 522992
10 com.adobe.Acrobat.framework 0x000000010929f068 0x108fb8000 + 3043432
11 com.adobe.Acrobat.framework 0x0000000109298679 0x108fb8000 + 3016313
12 com.adobe.Acrobat.framework 0x0000000109299693 0x108fb8000 + 3020435
13 com.adobe.Acrobat.framework 0x0000000109827697 0x108fb8000 + 8844951
14 com.adobe.Acrobat.framework 0x000000010981ef49 0x108fb8000 + 8810313
15 com.adobe.Acrobat.framework 0x0000000108fc3e23 0x108fb8000 + 48675
16 com.adobe.Acrobat.framework 0x0000000108fc3403 0x108fb8000 + 46083
17 com.adobe.Acrobat.framework 0x0000000108fc2e7b 0x108fb8000 + 44667
18 com.apple.CoreFoundation 0x00007fff205036cf CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 12
19 com.apple.CoreFoundation 0x00007fff2059f0c5 ___CFXRegistrationPost_block_invoke + 49
20 com.apple.CoreFoundation 0x00007fff2059f03f _CFXRegistrationPost + 496
21 com.apple.CoreFoundation 0x00007fff204d4984 _CFXNotificationPost + 795
22 com.apple.Foundation 0x00007fff21170bb8 -[NSNotificationCenter postNotificationName:object:userInfo:] + 59
23 com.apple.AppKit 0x00007fff22c48440 -[NSApplication _postDidFinishNotification] + 305
24 com.apple.AppKit 0x00007fff22c48192 -[NSApplication _sendFinishLaunchingNotification] + 208
25 com.apple.AppKit 0x00007fff22c45331 -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] + 541
26 com.apple.AppKit 0x00007fff22c44f87 -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 665
27 com.apple.Foundation 0x00007fff2119c306 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 308
28 com.apple.Foundation 0x00007fff2119c176 _NSAppleEventManagerGenericHandler + 80
29 com.apple.AE 0x00007fff2624c7f3 0x7fff26240000 + 51187
30 com.apple.AE 0x00007fff2624bf0e 0x7fff26240000 + 48910
31 com.apple.AE 0x00007fff26244c23 aeProcessAppleEvent + 448
32 com.apple.HIToolbox 0x00007fff289c8012 AEProcessAppleEvent + 54
33 com.apple.AppKit 0x00007fff22c3f610 _DPSNextEvent + 2046
34 com.apple.AppKit 0x00007fff22c3d945 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1364
35 com.apple.AppKit 0x00007fff22c2fc69 -[NSApplication run] + 586
36 com.adobe.Acrobat.framework 0x0000000108fc1bf5 0x108fb8000 + 39925
37 com.adobe.Acrobat.framework 0x0000000108fc0543 RunAcrobat + 653
38 com.adobe.Acrobat.Pro 0x0000000106b29ddc main + 196
39 libdyld.dylib 0x00007fff20430f3d start + 1

Thread 1:
0 libsystem_pthread.dylib 0x00007fff20411420 start_wqthread + 0

Thread 2:
0 libsystem_pthread.dylib 0x00007fff20411420 start_wqthread + 0

Thread 3:
0 libsystem_pthread.dylib 0x00007fff20411420 start_wqthread + 0

Thread 4:
0 libsystem_pthread.dylib 0x00007fff20411420 start_wqthread + 0

Thread 5:
0 libsystem_kernel.dylib 0x00007fff203e2cde __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff20415e49 _pthread_cond_wait + 1298
2 com.adobe.AGM 0x000000010c0467f2 AGMMessageQueueImpl::Pull() + 68
3 com.adobe.AGM 0x000000010c046733 AGMWorkQueueTask::operator()() + 73
4 com.adobe.AGM 0x000000010c39fc84 boost::(anonymous namespace)::thread_proxy(void*) + 105
5 libsystem_pthread.dylib 0x00007fff204158fc _pthread_start + 224
6 libsystem_pthread.dylib 0x00007fff20411443 thread_start + 15

Thread 6:
0 libsystem_kernel.dylib 0x00007fff203e2cde __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff20415e49 _pthread_cond_wait + 1298
2 com.adobe.AGM 0x000000010c0467f2 AGMMessageQueueImpl::Pull() + 68
3 com.adobe.AGM 0x000000010c046733 AGMWorkQueueTask::operator()() + 73
4 com.adobe.AGM 0x000000010c39fc84 boost::(anonymous namespace)::thread_proxy(void*) + 105
5 libsystem_pthread.dylib 0x00007fff204158fc _pthread_start + 224
6 libsystem_pthread.dylib 0x00007fff20411443 thread_start + 15

Thread 7:
0 libsystem_kernel.dylib 0x00007fff203e2cde __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff20415e49 _pthread_cond_wait + 1298
2 com.adobe.AGM 0x000000010c0467f2 AGMMessageQueueImpl::Pull() + 68
3 com.adobe.AGM 0x000000010c046733 AGMWorkQueueTask::operator()() + 73
4 com.adobe.AGM 0x000000010c39fc84 boost::(anonymous namespace)::thread_proxy(void*) + 105
5 libsystem_pthread.dylib 0x00007fff204158fc _pthread_start + 224
6 libsystem_pthread.dylib 0x00007fff20411443 thread_start + 15

Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000888 rbx: 0x0000000000000888 rcx: 0x173b78e12c0d0047 rdx: 0x0000000000000004
rdi: 0x0000000000000888 rsi: 0x0000000000000004 rbp: 0x00007ffee90d7800 rsp: 0x00007ffee90d7800
r8: 0x0000000000000000 r9: 0x0000000000000000 r10: 0x00007fff80186600 r11: 0x00007fff2120dd82
r12: 0x0000000000000000 r13: 0x000060000267e170 r14: 0x0000000000000000 r15: 0x0000000000000000
rip: 0x00007fff20410d86 rfl: 0x0000000000010206 cr2: 0x0000000000000888

Logical CPU: 2
Error Code: 0x00000004 (no mapping for user data read)
Trap Number: 14

Thread 0 instruction stream:
48 89 f3 49 89 fe 48 8d-3d 31 ef 2f 60 be 00 00 H..I..H.=1./... 05 00 e8 3d 7e 00 00 b8-00 01 00 00 48 8d 0d 27 ...=~.......H..' ef 2f 60 48 83 3c c1 00-74 12 48 ff c0 48 3d 00 ./H.<..t.H..H=.
03 00 00 75 ee bb 23 00-00 00 eb 0c 48 f7 d3 48 ...u..#.....H..H
89 1c c1 49 89 06 31 db-48 8d 3d ef ee 2f 60 e8 ...I..1.H.=../`.
06 7e 00 00 89 d8 5b 41-5e 5d c3 90 55 48 89 e5 .~....[A^]..UH..
[48]81 3f 5a 54 55 4d 75-73 8b 47 0c 89 c1 81 e1 H.?ZTUMus.G..... <==
c0 01 00 00 83 f9 40 74-6b 0f ba e0 0e 72 6d 48 ......@tk....rmH
8d 57 27 48 83 e2 f8 48-8b 0a f6 c1 02 75 45 4c .W'H...H.....uEL
8d 57 1f 49 83 e2 f8 65-4c 8b 04 25 f8 ff ff ff .W.I...eL..%....
49 b9 00 00 00 00 ff ff-ff ff 48 89 ce f6 c1 02 I.........H.....
75 22 4c 21 ce 89 c8 48-09 f0 83 c9 02 48 09 f1 u"L!...H.....H..

Thread 0 last branch register state not available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment