![]() |
Refurb. Mac emits "Bad CPU type in executable" error
As I noted elsewhere round these parts, my 2009-vintage macbook recently died in a manner that led me to suspect the mobo (which proved correct).
Monday took delivery of a refurb ordered from a power seller on eBay which is virtually hardware-identical to my defunct one and has the same version of OS X, 10.6.8. Spent the next day checking that everything seems to work and installing some key apps (e.g. Firefox and the handful of add-ons I use for that.) Last night I swapped in the HD from my defunct unit, everything booted up fine, apps all worked fine, no problems until I tried a quick test run of the latest Mlucas/x86_64/sse2 binary I'd built (using llvm/clang) before the system went down. That gave [b] Symptom #1:[/b] [i]-bash: ./Mlucas: Bad CPU type in executable[/i] So I thought maybe there is some kind of binary compatibility related to (perhaps) a subtle CPU version difference (I know, using nothing beyond plain-vanilla sse2 instructions a core2 is a core2 is a core2, but grasping at straws here), so tried a simple spot-check recompile of one of my smaller sources. That gave a preprocessor error indicating that the compiler was not using 64-bit mode, which is required (as of roughly a year ago) for all x86+SIMD (i.e. sse2 or avx) builds. Adding -m64 to the compile line fixed that. But I never needed to invoke that flag before (the list of my standard aliases in .bashrc shows my gcc alias adds the flag, but there is no analogous clang alias). Thus we have [b] Symptom #2:[/b] clang now needs -m64 to trigger 64-bit mode, it did not need this previously. I thought maybe a reinstall of the compiler+etc was called for, so next I did that (still had the .dmg disk-image file in my Downloads folder), it installed flawlessly (took ~15 mins), but the "now needs -m64" issue persisted. Next I did a clean rebuild of all my sources, linked a fresh binary, and again get the above "Bad CPU type in executable" error. One of the online Mac forums suggested to use 'file' to check the binary, 'file Mlucas' gives [i] Mlucas: Mach-O 64-bit executable x86_64 [/i] which is the correct type for this CPU/OS. So now I am stumped - any hints/things-to-try will be appreciated. |
There is a MacCPUID from Intel, it me give you some insight as to what is going on.
|
[QUOTE=WMHalsdorf;379890]There is a MacCPUID from Intel, it me give you some insight as to what is going on.[/QUOTE]
Is that a command (or 3rd-party app) or something to look for in the mac system profiler results? |
[URL="https://software.intel.com/en-us/articles/download-maccpuid/"]MacCPUID here.[/URL]
|
1 Attachment(s)
[QUOTE=sdbardwick;379893][URL="https://software.intel.com/en-us/articles/download-maccpuid/"]MacCPUID here.[/URL][/QUOTE]
Thanks, but that crashed when I tried to open the .app - logfile attached, if anyone is interested. But I wonder - could it simply be that the refurb unit I got has a 32-bit version of os x 10.6.8 installed? I didn't even think there were 32-bit versions of these later os x releases, but online digging have seen such mentioned, and I further see "i386" in the uname -a result: [i] Darwin ernst-w-mayers-macbook.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386 [/i] And, the system software overview suspiciously shows an empty line for "64 bit kernel and extensions": [i] System Software Overview: System Version: Mac OS X 10.6.8 (10K549) Kernel Version: Darwin 10.8.0 Boot Volume: Macintosh HD Boot Mode: Normal Computer Name: Ernst W. Mayer’s MacBook User Name: Ernst W. Mayer (ewmayer) Secure Virtual Memory: Not Enabled 64-bit Kernel and Extensions: No Time since boot: 16:26 [/i] I am now 95% certain I have a 32-bit version of the OS. (Alas I can't test it directly using an Mlucas build because that no longer supports 32-bit builds). Should there be any issue whatsoever to update online to the 64-bit version of 10.6.8? |
Wait a minute - just recalled that (duh!) I am now using my old HD removed from the dead system, which was very definitely running 64-bit 10.6.8. So how could the system, running off of that HD, "think" it's 32-bit? Is there a BIOS flag I need to fiddle with?
|
I know nothing WRT Apple products, but that won't prevent me from commenting...
I wonder if during the initial boot after the HDD transplant, OSX discovered (via unknown ProcessorID or MAC address or other secret sauce) that it did not recognize the current configuration and therefore silently reverted to a baseline known-good config. Sounds very Apple in approach...the computer will (mostly) just work with a baseline config. Anyway look here: [URL="https://support.apple.com/kb/HT3773"]Boot with 32 or 64 bit kernel[/URL] Maybe that will work on your system. |
[QUOTE=sdbardwick;379904]I know nothing WRT Apple products, but that won't prevent me from commenting...
I wonder if during the initial boot after the HDD transplant, OSX discovered (via unknown ProcessorID or MAC address or other secret sauce) that it did not recognize the current configuration and therefore silently reverted to a baseline known-good config. Sounds very Apple in approach...the computer will (mostly) just work with a baseline config. Anyway look here: [URL="https://support.apple.com/kb/HT3773"]Boot with 32 or 64 bit kernel[/URL] Maybe that will work on your system.[/QUOTE] Thanks! That sounded like just the ticket, but tried it (method 2, the persistent 64-bit boot setting via sudo), restarted, no joy. Perhaps the OS install on this machine is 32-bit-only. Sent e-mail to the seller - in any event I believe I have identified the issue, so worst case will need to do a clean OS reinstall. And now - very belatedly - time to grab some dinner and try to get a few hours of relaxation in. |
Go here to see if your CPU supports 64-bit: [url]http://support.apple.com/kb/ht3696[/url]. You can also look here: [url]http://support.apple.com/kb/HT4287[/url]
|
On waking this a.m. I again realized the surmise "maybe I the refurb. has just 32-bit OS X 10.6.8 installed" makes no sense, since I am booting off my legacy HD.
The seller also provided what proves to be a bogus (or at least incomplete) explanation: [i] OS 10.6 is 32 bit. The earliest 64 bit operating system for the Intel MacBooks was 10.7 Lion. You cannot install 10.7 on the Core Duo MacBooks like the one you ordered. I have never had anyone ask about or have issues with the OS being 32 bit, but I will definitely consider updating the ad now that you pointed this out. [/i] [QUOTE=rogue;379923]Go here to see if your CPU supports 64-bit: [url]http://support.apple.com/kb/ht3696[/url]. You can also look here: [url]http://support.apple.com/kb/HT4287[/url][/QUOTE] And, that solves the puzzle - I did not look carefully enough at the CPU type, my eyes saw "dual core" and my subconscious apparently auto-completed that to "Core2 Duo" - in fact it's a Core Duo. Thankfully at this point that is a relatively minor nuisance, since all my ongoing code-dev work is geared toward Haswell and-beyond and GPU, and I can still do 64-bit compiles on the system, I just can't run the resulting executables (not that I'll even be bothering to proceed to the link step now that I know that I'm restricted to 32-bit-executable mode. I expect there's probably some emulation I could use to run 64-bit, but not worth the bother, since I have the Haswell system for that.) Don't suppose I could expect to be lucky enough to be able to plug my leftover Core2 CPU (assuming it was not the mobo component which failed) into this mobo, could I? [p.s.: I also sent the relevant explanation and above links about 32/64-bit boot mode and CPU/bitness to the seller, and suggested he clarify these issues in future item listings. Got the system for $145 including shipping, so for the price it's still a bargain.] |
According to this [URL="https://en.wikipedia.org/wiki/Intel_Core"]wiki page[/URL], a core duo is a "socket M", whereas [i]some[/i] core 2 are also "socket M" :smile:
What is you core 2 model number? Oh you can't boot it! Is there some way of finding out? Maybe extract the chip and read the code from the lid :smile: Having said this, perhaps the mainboard is incompatible :sad: |
| All times are UTC. The time now is 07:08. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.