Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] MacOS x86 binary is broken on latest release #1500

Closed
1 task
McFacePunch opened this issue Jan 17, 2024 · 22 comments
Closed
1 task

[Bug] MacOS x86 binary is broken on latest release #1500

McFacePunch opened this issue Jan 17, 2024 · 22 comments
Labels
bug Something isn't working

Comments

@McFacePunch
Copy link

Operating System

MacOS

What's the issue you encountered?

The release from 3 weeks ago on x86 is 100mb but the latest release is only 20, something seems to be very broken and it doesn't run. I havent had time to dive into why but thought I'd create an issue since I didn't see one open.

How can the issue be reproduced?

Download v1.32.2 x86 DMG

ImHex Version

v1.32.2

ImHex Build Type

  • Nightly or built from sources

Installation type

DMG

Additional context?

x86 tested as broken in v1.32.2 but working in v1.32.1. Also cant use the ARM version (even though I'm on an M1 because my OS is 1 major version behind and listed as unsupported by the binary)

@McFacePunch McFacePunch added the bug Something isn't working label Jan 17, 2024
@WerWolv
Copy link
Owner

WerWolv commented Jan 17, 2024

Hey
Could you please provide some more information about what's happening when you run them? Any error messages, logs, etc?

Both the M1 and the x86 work perfectly fine on my M2 macbook air fwiw.

Also cant use the ARM version (even though I'm on an M1 because my OS is 1 major version behind and listed as unsupported by the binary)

That has been fixed since. The latest nightly release now has the same OS version requirement as the x86 version.

@ssnkhan
Copy link

ssnkhan commented Jan 17, 2024

Had the same issue, and this fixed it for me codesign --force --deep --sign - /Applications/imhex.app/. (Thanks to @WerWolv via Discord).

@McFacePunch
Copy link
Author

McFacePunch commented Jan 29, 2024

Had the same issue, and this fixed it for me codesign --force --deep --sign - /Applications/imhex.app/. (Thanks to @WerWolv via Discord).

Same issue, its a code signing problem. I was able to get it to run by signing it myself or forcing an exception but neither are ideal. Will test again once I get a chance.

@WerWolv
Copy link
Owner

WerWolv commented Jan 29, 2024

What's weird is that it works completely fine on my machine. Don't have to re-sign it myself.

@McFacePunch
Copy link
Author

McFacePunch commented Jan 29, 2024

I did check the xattr quarantine attribute but deleting mine and correcting it both didn't fix it so it might be that re-signing its forcing some header rebuilding that is making it valid for older macs? I'm assuming the header itself is specifying it's only for newer MacOS versions regardless of the actual support.

https://en.wikipedia.org/wiki/Mach-O#Minimum_OS_version

As a result it just errors giving you a screen about updating and crossing out the binary.

Screenshot 2024-01-29 at 21 44 53 Screenshot 2024-01-29 at 21 51 20

@ragnar76
Copy link

Stumbled across the same problem, bot with 1.32.2 and latest nightly build. Even signing (mentioned above) does not help. I'm using a 13" MBP with MacOS 14.3

@WerWolv
Copy link
Owner

WerWolv commented Jan 30, 2024

Latest nightly works fine for me too. Opening it regularly shows this screen here:
image

but then right clicking and choosing open shows
image
and I can just click on "Open" to launch ImHex.

Are there any settings you guys have enabled or I have disabled that would cause macOS to refuse to launch it? I seriously can't think of anything else. SIP is still enabled on my machine, that's the only one I know about

@ragnar76
Copy link

I haven't changed anything, at least not that i'm aware of.

@ragnar76
Copy link

I got it working!

I had a look at the files and the problem, for me, was that MacOS put the files in quaratine. By removing the file attribute "com.apple.quaratine" using

xattr -r -d com.apple.quarantine /Applications/imhex.app/

imhex works like a charme now.

@WerWolv
Copy link
Owner

WerWolv commented Jan 30, 2024

That's not really a fix, that just makes macOS not check ImHex's signature anymore.
If there is an issue with the signatures, somehow my mac decided to not care about it or yours has some extra security settings enabled

@ragnar76
Copy link

possible but why is the re-signing process (above, #1500 (comment)) not working then? Or is it working but the extended file attributes, from first start try?, are still there? Will remove imhex tomorrow evening and reinstall it again for testing, my bed's calling me, i can hear it ;)

@McFacePunch
Copy link
Author

That's not really a fix, that just makes macOS not check ImHex's signature anymore. If there is an issue with the signatures, somehow my mac decided to not care about it or yours has some extra security settings enabled

There are 2 problems here. First is the signing issue and second is the min version header.

In my case I can sign and get it working on my mac using MacOS 14 but on my MacOS 13 mac (both are M2 macs) I get the errors in my screenshot above when using the ARM binary. Like I mentioned with the header, the header displays a minimum version of 14 minos 14.0 for ARM. However the x86 binaries have minos 12.7.

As for signing, maybe there is some sort of new trust requirement for externally downloaded files or in the signing setup change under MacOS 14 or xcode 14 which may be causing this? I know of one such change, though the impact I'm not certain of, is the switch from atool to notarytool for xcode14....

@ragnar76
Copy link

ragnar76 commented Feb 1, 2024

No luck here on my 2nd Mac (an older 2019 MBP) still the same after a new install. Right after the start i get this error

grafik
(in german: imhex is demaged and cannot be opened and so on"

I have to remove it from quaratine first before i can use it

@WerWolv
Copy link
Owner

WerWolv commented Feb 1, 2024

Made one more change now, maybe that fixes it. If not, I'll need somebody who can reproduce the issue to try and debug this locally, I honestly don't think there's anything more I can do at this point.

@McFacePunch
Copy link
Author

@WerWolv is that the nightly for x86 macos?

@joshuajohncohen
Copy link

I'm having the same issue. It says the app is damaged and can't be opened, I've tried downloading from Github and through Homebrew. It has xattr of com.apple.quarantine in both cases. I'm on MacOS 12.7.2.

@alexdetrano
Copy link

I also had the damaged app message on my MacBook pro 2019 x86-64 (Sonoma 14.3.1). I ran the command from @ragnar76 to remove the file from quarantine and now I can run ImHex without any issue.

xattr -r -d com.apple.quarantine /Applications/imhex.app/

@ragnar76
Copy link

@alexdetrano thats a workaround and not really a fix. The question is, why does Macos put imhex into quarantine (maybe for the mac guys here easy, i'm not a mac guy) and what could be a solution?

@McFacePunch
Copy link
Author

McFacePunch commented Feb 23, 2024

@alexdetrano thats a workaround and not really a fix. The question is, why does Macos put imhex into quarantine (maybe for the mac guys here easy, i'm not a mac guy) and what could be a solution?

I'm heavily a mac user including driver development and I wasn't able to figure it out in 2-3 hours of reading and exploring. I dont have xcode setup to really dive deeply into the testing apps since I do all my work with clang but it is a weird one and only seems to be a problem on Ventura. It's obviously a gatekeepr behavior change but why exactly it's not obvious at all.

@WerWolv
Copy link
Owner

WerWolv commented Feb 23, 2024

Have you tested the latest nightly build again?
I made some changes a few days ago that, at least for me, made it work fine on my M2 under Rosetta again.

I still find it extremely odd behavior that it would work when emulated on ARM but not on a real Intel machine

@McFacePunch
Copy link
Author

I have not tested the nightly. I will try that now. Also just realised I can run the binary at ImHex.app/Contents/MacOs/imhex just fine but not the app at the top level itself.....

It is extremely weird indeed.

@McFacePunch
Copy link
Author

Checked the nightly artifact for arm and it's working perfectly now! Closing issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants