mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Hardware

Reply
 
Thread Tools
Old 2014-08-06, 22:31   #1
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

2CA716 Posts
Default 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

Symptom #1:
-bash: ./Mlucas: Bad CPU type in executable

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

Symptom #2:
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

Mlucas: Mach-O 64-bit executable x86_64

which is the correct type for this CPU/OS. So now I am stumped - any hints/things-to-try will be appreciated.
ewmayer is offline   Reply With Quote
Old 2014-08-06, 22:47   #2
WMHalsdorf
 
WMHalsdorf's Avatar
 
Feb 2005
Bristol, CT

33·19 Posts
Default

There is a MacCPUID from Intel, it me give you some insight as to what is going on.
WMHalsdorf is offline   Reply With Quote
Old 2014-08-06, 23:07   #3
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

7·23·71 Posts
Default

Quote:
Originally Posted by WMHalsdorf View Post
There is a MacCPUID from Intel, it me give you some insight as to what is going on.
Is that a command (or 3rd-party app) or something to look for in the mac system profiler results?
ewmayer is offline   Reply With Quote
Old 2014-08-06, 23:11   #4
sdbardwick
 
sdbardwick's Avatar
 
Aug 2002
North San Diego County

2A416 Posts
Default

MacCPUID here.
sdbardwick is offline   Reply With Quote
Old 2014-08-07, 02:44   #5
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

7×23×71 Posts
Default

Quote:
Originally Posted by sdbardwick View Post
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:

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

And, the system software overview suspiciously shows an empty line for "64 bit kernel and extensions":

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 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?
Attached Files
File Type: gz maccpuid_crash.txt.gz (8.2 KB, 64 views)
ewmayer is offline   Reply With Quote
Old 2014-08-07, 03:00   #6
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

2CA716 Posts
Default

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?
ewmayer is offline   Reply With Quote
Old 2014-08-07, 03:20   #7
sdbardwick
 
sdbardwick's Avatar
 
Aug 2002
North San Diego County

12448 Posts
Default

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: Boot with 32 or 64 bit kernel

Maybe that will work on your system.
sdbardwick is offline   Reply With Quote
Old 2014-08-07, 04:43   #8
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

7×23×71 Posts
Default

Quote:
Originally Posted by sdbardwick View Post
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: Boot with 32 or 64 bit kernel

Maybe that will work on your system.
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.
ewmayer is offline   Reply With Quote
Old 2014-08-07, 13:13   #9
rogue
 
rogue's Avatar
 
"Mark"
Apr 2003
Between here and the

2×29×101 Posts
Default

Go here to see if your CPU supports 64-bit: http://support.apple.com/kb/ht3696. You can also look here: http://support.apple.com/kb/HT4287
rogue is offline   Reply With Quote
Old 2014-08-07, 21:50   #10
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

101100101001112 Posts
Default

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:

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.


Quote:
Originally Posted by rogue View Post
Go here to see if your CPU supports 64-bit: http://support.apple.com/kb/ht3696. You can also look here: http://support.apple.com/kb/HT4287
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.]
ewmayer is offline   Reply With Quote
Old 2014-08-07, 22:07   #11
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

D0B16 Posts
Default

According to this wiki page, a core duo is a "socket M", whereas some core 2 are also "socket M"

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

Having said this, perhaps the mainboard is incompatible

Last fiddled with by paulunderwood on 2014-08-07 at 22:32
paulunderwood is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
"lanczos error: only trivial dependencies found" with massive oversieving eigma Msieve 21 2015-05-28 03:27
64 bit mprime "not in executable format" Mr. P-1 Information & Answers 5 2013-02-08 16:06
What is work type "LL Test with no factoring"? Svenie25 PrimeNet 4 2011-02-22 20:08
"Connection to socket failed" error for about 24 hours jasong Factoring 2 2006-02-26 22:18
Would Minimizing "iterations between results file" may reveal "is not prime" earlier? nitai1999 Software 7 2004-08-26 18:12

All times are UTC. The time now is 06:01.

Sat Aug 15 06:01:54 UTC 2020 up 2 days, 2:37, 0 users, load averages: 3.14, 3.44, 3.32

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.