我遇到了以下问题:我能够用make文件编译我的allegro应用程序而没有错误,但是当我运行./file时,我得到一条"zsh:非法硬件指令./ file“消息。我注释掉了代码的某些部分,问题似乎是由al_create_display()函数引起的(或者这只是其中一个原因)。
我用一个非常简单的allegro程序复制了这个问题(基本上只是打开一个显示)。
我的allegro是用自制软件安装的,我用g++-9编译程序。我用的是2016年的MacBook专业版,13英寸,没有触摸杆。系统是Mac OS Catalina。在Catalina更新之前,没有发生过这样的问题。
崩溃报告中的一些信息:
Crashed Thread: 3
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Illegal instruction: 4
Termination Reason: Namespace SIGNAL, Code 0x4
Terminating Process: exc handler [1579]
Application Specific Information:
-[NSOpenGLContext update] must be called from the main thread if the context has a view.
And the thread that crashed:
Thread 3 Crashed:
0 com.apple.AppKit 0x00007fff3a4878a1 -[NSOpenGLContext update] + 520
1 liballegro.5.2.dylib 0x0000000102876943 create_display_win + 1079
2 liballegro.5.2.dylib 0x000000010283b3d4 al_create_display + 40
3 file 0x0000000102724e72 Display::Display() + 130
4 file 0x0000000102724f22 Display::instance() + 62
5 file 0x00000001026e2f4f _al_mangled_main + 508
6 liballegro.5.2.dylib 0x0000000102878d47 call_user_main + 23
7 liballegro.5.2.dylib 0x0000000102878d30 +[AllegroAppDelegate app_main:] + 9
8 com.apple.Foundation 0x00007fff3f58cef2 NSThread__start + 1064
9 libsystem_pthread.dylib 0x00007fff74405d76 _pthread_start + 125
10 libsystem_pthread.dylib 0x00007fff744025d7 thread_start + 15发布于 2019-11-15 07:40:07
这个问题已经被这个库的开发人员解决了:https://github.com/liballeg/allegro5/issues/1091。主分支上的当前版本不会导致问题。我自己也试过了,一切似乎都很正常。唯一的问题是,您必须使用cmake或xcode手动构建allegro。我不知道brew版本何时会更新。
https://stackoverflow.com/questions/58466092
复制相似问题