Illegal instruction 4 mac os

Что такое «незаконная инструкция: 4″ ошибка и почему » — mmacosx-version-min=10.х» исправить это?

Я Illegal Instruction: 4 ошибки с двоичными файлами, скомпилированными с GCC 4.7.2 под Mac OS X 10.8.2 («Mountain Lion»), когда эти двоичные файлы запускаются под Mac OS X 10.7.x («Лев») и более ранние версии. Двоичные файлы работают правильно под Mac OS X 10.8.x.

добавил -mmacosx-version-min=10.5 к моим флагам компиляции, и это, кажется, помогает решить проблему для 10.5.x, 10.6.x и 10.7.x клиентов, что бы это ни было.

, который попадает на мой вопрос(с):

  • что такое Illegal Instruction: 4 ошибка?
  • почему -mmacosx-version-min=10.x исправить эту конкретную ошибку по 10.x и больше клиентов?

Я хотел бы применить это исправление к моим файлам Makefile, но хотел бы знать, что он делает, прежде чем я нажму на курок. (Будут ли у меня большие двоичные файлы? У меня все еще есть 64-битные двоичные файлы? Есть ли проблемы с таким подходом я должен знать? Побочных эффектов? Так далее.)

6 ответов

«компилятор и компоновщик способны использовать функции и выполнять оптимизации, которые не работают в старых версиях ОС. -mmacosx-version-min сообщает инструментам, с какими версиями ОС вам нужно работать, поэтому инструменты могут отключить оптимизацию, которая не будет работать в этих версиях ОС. Если вам нужно работать на более старых версиях ОС, вы должны использовать этот флаг.

«обратная сторона -mmacosx-version-min что производительность приложения может быть хуже на более новых версиях ОС, чем это могло бы быть, если бы он не должен быть обратно совместимым. В большинстве случаев различия невелики.»

сообщение «незаконная инструкция» просто говорит вам, что ваши двоичные файлы содержат инструкции, версия ОС, под которой вы пытаетесь запустить их, не понимает. Я не могу дать вам точное значение 4 но я ожидаю, что это внутреннее для Apple.

иначе взглянуть на это. они немного стары, но, вероятно, расскажут вам то, что вам нужно знать

Я сознательно пишу этот ответ на старый вопрос С в виду того, что другие ответы мне не помогли.

Я получил Illegal Instruction: 4 при запуске двоичного файла в той же системе, в которой я его скомпилировал, так что -mmacosx-version-min не помогло.

я использовал gcc в кодовых блоках 16 на Mac OS X 10.11.

однако отключение флагов компилятора всех блоков кода для оптимизации работало. Поэтому посмотрите на все установленные блоки кода флагов (щелкните правой кнопкой мыши на Project — > «Build Properties») и отключите все флаги, которые вам точно не нужны, особенно -s и -O флаги для оптимизации. Это помогло мне.

я обнаружил, что моя проблема была неправильной
if (leaf = NULL) <. >
где он должен был быть!—3—> if (leaf == NULL)

проверьте эти предупреждения компилятора!

недавно я получил эту ошибку. Я скомпилировал двоичный файл с-O3. Google сказал мне, что это означает «незаконный код операции», который показался мне подозрительным. Затем я отключил все оптимизации и повторил. Теперь ошибка преобразована в segfault. Поэтому, установив-g и запустив valgrind, я отследил источник и исправил его. Повторное подключение всех оптимизаций не показало никаких новых признаков незаконной инструкции 4.

Читайте также:  Как собрать сборку linux самому

по-видимому, оптимизация неправильного кода может дать странные результаты.

Я получил эту ошибку при попытке построить с Xcode 10. Похоже, это ошибка в компиляторе Swift. Здание с Whole Module Optimization on, решает проблему: https://forums.swift.org/t/illegal-instruction-4-when-trying-to-compile-project/16118

Это не идеальное решение для отладочных сборок, так как время компиляции так долго. Я буду продолжать использовать Xcode 9.4.1, пока эта проблема не будет решена.

Источник

«Illegal instruction: 4» when launching on OS X #4

Comments

glimpsed commented May 27, 2016

When I tried running mkchromecast on OS X 10.11 or 10.6, the app crashes with an «Illegal instruction: 4» error.

It also generates this message in the Console:
5/27/16 5:38:39.333 PM com.apple.xpc.launchd[1]: (com.mkchromecast.osx.1974432[2842]) Service exited due to signal: Illegal instruction: 4

The text was updated successfully, but these errors were encountered:

muammar commented May 27, 2016 •

«The «illegal instruction» message is simply telling you that your binaries contain instructions the version of the OS that you are attempting to run them under does not understand.»[1]

I am aware of this problem. I saw it when creating the app in my macbook pro 2015, and launching it in older models. To tackle it, I used another Macbook pro from 2011 (model 8,2) to build the binary that is being currently shipped.

@glimpsed could you tell the model of your mac to discard this as the cause of the problem?. I have to accept that I am trying to build a universal application with py2app but your report is a prove that it is not working. I will investigate it in more details.

A way to solve this locally, would be to use the Makefile shipped in the git repo, and do a make deploy to build the binary. It will require you to install pyqt5 using brew as described in the README, and the packages inside requirements.txt (except of course pyqt5). Additionally, you would need to install using pip these packages:

After that, the make deploy would create a standalone app that should work in your machine. I will write something in the wiki regarding this.

Источник

«Illegal instruction: 4» after porting app to Swift

I can run my app on my MacBook Pro running macOS 10.14.6, but an App Store user reached out to report that it crashes immediately when launching it. When that user runs it from the Terminal, it prints out this:

Illegal instruction: 4

Accepted Answer

To make progress here you’ll need to get a crash report from that user. See Technote 2151 Understanding and Analyzing iOS Application Crash Reports.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

Answers

This stack overflow question might help.

Читайте также:  Как удалить загруженные обновления для windows 10

To make progress here you’ll need to get a crash report from that user. See Technote 2151 Understanding and Analyzing iOS Application Crash Reports.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

Thank you for your help.

Fortunately the user sent me his defaults file where my app reads the preferences from at startup, and replacing my own file with that one I can replicate the crash in Xcode: `Fatal error: Unexpectedly found nil while unwrapping an Optional value`.

I was expecting that such errors would be logged to the Terminal when running an app from there.

By the way, should I have got en email notifying me of your answers (since I’m following this topic)? I didn’t get anything.

I’m getting notifications.

You might want to check to see if you have any spam filters or other things blocking E-mails.

No, I haven’t anything in my spam folder.

Fortunately the user sent me his defaults file [and] with that one I can replicate the crash in Xcode

Cool. Now run your app from the Finder and let it crash. That’ll generate a crash report, which is what I’m looking for. Please symbolicate it, and then post it here (using the

button to format it as code).

should I have got en email notifying me of your answers (since I’m following this topic)?

I don’t rely on email notifications, so I don’t have direct experience with this stuff, but my recommendation is that you should check your email notification preferences, which you can access via the Welcome *** link at the top left.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

Источник

illegal instruction:4

Images

Same to me. The Version is macOS High Sierra 10.13.6.

Mail: Hallo@LOOM.jetzt
____________________________________
im Angebot grandMA3 light

•mit Operator zu vergünstigten Konditionen

•2er+3er Software Schulung

It works for me

Mac OS High Sierra

I’m no Mac-person, but I believe it would be easier for the forum community to narrow down possible reasons for the problems, if you all included details regarding actual hardware in your posts

You can find the recommended and minimum system requirements in the manual:

The main things you are looking for are:

  • Processor Cores and Speed
  • RAM (8G Min)
  • SSE 4.2 Support
  • VRAM (1G Min)
  • OpenGL 4.1 Support

If you are unsure you can take a look at the system Information to see how your Mac shapes up. Click on the Apple Menu while holding down Option (Alt) on the keyboard the first option should be System Information.

The first section on this window (Hardware) gives you a good rundown on the features of your mac. Here is mine, but be sure not to copy share your SN or Hardware UUID:

Model Name: MacBook Pro

Model Identifier: MacBookPro14,3

Processor Name: Quad-Core Intel Core i7

Processor Speed: 3.1 GHz

Number of Processors: 1

Читайте также:  Сопроцессор драйвер под windows

Total Number of Cores: 4

L2 Cache (per Core): 256 KB

Hyper-Threading Technology: Enabled

Memory: 16 GB

If you want to know if your CPU supports SSE 4.2 you can either look it up or download MacCPUID from Intel. in CPUID if you go to the features tab and scroll down until you see SSE4_2 is should be checked.

Under Graphics/Display of System Information take the better of the graphics cards if you have more then one, it contains your VRAM and card name

If you want to know if your graphics card supports OpenGL 4.1 you can take a look at this list and find your card.

My guess is most of the issues are because of Missing SSE 4.2 or OpenGL 4.1 support.

It would be nice if in future versions of the onPC software it would warn of any deficiencies in the log.

Источник

OS X Illegal Instruction: 4 in Travis-CI

I have a Mac Mini (running OS X Version 10.11.6 on it), and I have been trying to compile a binary that I want to run on the Travis-CI OS X servers.

I have succeeded at doing this before (with the same device). But this time around, I’m getting the Illegal Instruction 4 error you can see on this line. This error does not occur on my Mac Mini. The program runs fine. It only occurs on Travis-CI.

A quick stack overflow search of this error gives me this question, which shows that the error can be fixed by compiling the binaries with the -mmacosx-version-min=10.x flag. Well, I have tried that to no avail. To be more specific, I compiled by binary with the -mmacosx-version-min=10.9 flag, which I think should be fine considering that the Travis-CI OS X version is 10.11 (which makes me wonder why I was getting that error in the first place since I built the binary on OS X 10.11).

The binary I am trying to run can be found here, and if I run otool -l on it, I see this section:

which looks fine. I compiled it and linked it in compatibility mode for OS X 10.9, and I compiled it on an OS X 10.11 machine. The dynamic dependencies appear to be alright as well:

And here is the g++ version that I built the binary with:

So I’ve just been spending a lot of time trying to figure out: why will my binary not run on Travis-CI? And why do I keep getting an Illegal Instruction: 4 ? The binary seems to run fine on my Mac Mini. If anyone knows what the problem is or has any advice on fixing the problem, it would be greatly appreciated. Thank you!

Edit: by the way, the code for this binary can be found here, and I link it to the objcryst libraries.

Edit2: I tried turning off compiler optimization flags to see if something strange has been going on with the optimizations. I still get the same result, though, even with compiler optimization flags off.

Источник

Оцените статью