createinstallmedia for macOS Sierra is a fork bomb!

Apple have posted a set of download links for installers for older versions of macOS on their website here:

https://support.apple.com/en-us/HT201372

There’s a teeny-tiny problem with the macOS Sierra installer though: running the createinstallmedia command as suggested ends up with an infinite loop of createinstallmedia spawning new copies of itself, until the computer’s resources are exhausted (a fork bomb)!

sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ macOS\ Sierra.app

# Boom! The command hangs, and if you leave it for a minute or so your computer will be crippled
# You can abort it by quickly running "sudo killall createinstallmedia" in another tab

createinstallmedia is hard-coded to install a specific version of the operating system package, which is the version it was originally bundled with. So it looks at the CFBundleShortVersionString field of the Contents/Info.plist file in the applicationpath you provided to make sure it matches the version it is expecting.

If it doesn’t match, it assumes that you’re running the wrong copy of createinstallmedia, and the createinstallmedia from the applicationpath should be run instead, so it launches that.

But since there is a version mismatch in the Sierra installer that Apple is currently offering (as of 2020-02-11, the last-modified date of the installer is 2019-10-24) the version of the bundled createinstallmedia doesn’t match the installer’s version, and this triggers an infinite loop!

You can fix this by editing the CFBundleShortVersionString field of the Install macOS Sierra/Contents/Info.plist file to match what createinstallmedia is expecting. For the version currently offered by Apple, that is:

macOS 10.12 Sierra – Version is 12.6.06 and needs to be changed to 12.6.03

Obviously there was a mistake somewhere in Apple’s build process and they forgot to rebuild createinstallmedia to match their latest update.

You can discover which version createinstallmedia requires like so:

# For macOS 10.12, look for strings including "12":

$ strings "/Applications/Install macOS Sierra.app/Contents/Resources/createinstallmedia" | grep 12

12.6.03

28 thoughts on “createinstallmedia for macOS Sierra is a fork bomb!”

  1. Thank you, just ran into this as well… ugh. Can anyone confirm this occurs on when using the `createinstallmedia` method on OS versions /System/Volumes/Data/Applications/` firmlink. Maybe not. Either way, very nice catch with the version string!

  2. Hey! I’ve been spending the better part of a day ramming my head against this problem, and you come along with this incredible piece of code sleuthing to save my sanity. Respect, and thank you! Let me know if there’s a way I can buy you a beer over the internet.

  3. I get these errors halfway starting up.

    Panic(cpu 1 caller 0xffffff00003dc4a3): “TLB invalidation IPI timeout : “ “ CPU(s) failed to respond to interrupts, unresponsive CPU bitmap: 0x10, NMIPI lacks: orig: 0x0, now: 0x0”@Library/Caches/com.apple.xbs/Sources/xnu/xnu-3789.73.49/osfmk/x86_64/pmap.c:2762
    Debugger called:

    Or

    panic(cpu 2 caller 0xffffff801690079e): “Spinlock acquisition timeout: lock=0xffffff80170671f8, lock owner thread=0xffffff8073e1cdf0, current_thread: 0xfffff8074f8e078, lock owner active on CPU 0x0, current owner: 0xffffff8073e1cdf0@/Library/Caches/com.apple.xbs/Sources/xnu/xnu-3789.70.16/osfmk/i386/locks_i386.c:427
    Debugger called:

  4. Man – I was going nuts trying to get to the bottom of it. Thanks very much – this article is a real gem.

  5. Thanks! This was very delightful find after the load jumped to 922.65+ and then whole damn computer crashed. Merry Christmas!

  6. I got an old Mac whose Internet Recovery fails because the macOS image downloaded uses an invalid signature or something, so I had to create an installer medium with Sierra instead and ran into this issue (after having replaced the code signature with an ad-hoc signature).

    Great find and still helpful 2 years later. 👍🏻

  7. Okay, I WASN’T losing it when I saw those createinstallmedia procs explode in my ps output; Was helping a friend out with an old 2010 MB Pro he was gifting to someone for their kid to use and was trying to keep it native (i.e. no OpenCore) and this was making me INSANE. Such a simple fix too! THANK YOU!!

  8. This POS code from apple silently deletes the “install macos app” after it fails to do its job.

    fuck Apple

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.