-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Segmentation fault on MacOS 10.13.6 (macports) #533
Comments
@stephengtuggy you suggested I should run it through a debugger. Could you give me some pointers? I'm looking at the |
OK. Here's my first attempt with
|
That thread backtrace was what I was looking for. Thanks, @daviewales . |
I am getting a segmentation fault, but
as the error |
So glutInit is being called a second time? Very interesting. Thanks for the report, @hellosway |
I think this particular issue should be fixed, as of either #788 or a later PR. @daviewales , any chance you could retest this at some point? See if the game works now for you on macOS 10.13? I know the 0.9.x branch of the code works on macOS now. And I think 0.8.x does too. But I'll be sure to do some more testing before closing this ticket. |
I'll see what I can do. My build environment is a bit broken for some reason, so it might take some time. |
@daviewales Okay, no problem. Thanks. |
I might need some assistance helping cmake to find GLUT. I've installed
However, cmake is trying to use the MacOS built-in GLUT, which is missing a bunch of required symbols:
I've tried setting a bunch of environment variables to point cmake in the right direction, but it's quite insistent on finding the system GLUT...
|
OK. I realised that This convinces cmake to find the MacPorts version of OpenGL and freeglut: ./script/cibuild -DOPENGL_gl_LIBRARY:FILEPATH=/opt/local/lib/libGL.dylib -DOPENGL_glu_LIBRARY:FILEPATH=/opt/local/lib/libGLU.dylib -DGLUT_glut_LIBRARY=/opt/local/lib/libglut.dylib Just waiting to see if it compiles. |
Nice. Wasn't there also an argument that needed to be passed that was something like FRAMEWORK=LAST? Or maybe an environment variable? Maybe see if that helps. If you can determine or remember what the full setting name was, that is. |
|
Thanks. I feel like I must be getting close. With this build command: ./script/cibuild -DBoost_ROOT=/opt/local/libexec/boost/1.76 -DPython3_ROOT_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/3.12 -DOPENGL_gl_LIBRARY:FILEPATH=/opt/local/lib/libGL.dylib -DOPENGL_glu_LIBRARY:FILEPATH=/opt/local/lib/libGLU.dylib -DGLUT_glut_LIBRARY=/opt/local/lib/libglut.dylib -DGLUT_INCLUDE_DIR=/opt/local/include -DCMAKE_FIND_FRAMEWORK=LAST I'm getting these errors (and others similar):
The really interesting bit is that the error message notes that the unknown type is defined in Edit: Actually, I think I misread the error message. It's found a similarly named type, but not the exact one it's looking for? But if I grep for the type name of interest, it shows up in
Looking at Edit: But I can see that you explicitly undefine |
Sounds like good progress. Be careful, though: we're having issues with the backdoored version of xz/liblzma that has generated a lot of commotion online in the last few weeks. In some branches of the Vega Strike code, at least on Windows, the vcpkg dependency manager actually pulls in one of the compromised versions of liblzma! We're working on fixing that as quickly as we can. In the meantime, I would make sure you have an up-to-date antivirus program, and also double-check that liblzma version 5.6.0/5.6.1 is not getting pulled in anywhere. |
Regarding the GL_ARB... functions: I'm pretty sure those are from a very old version of OpenGL. The function names should have BASE in place of ARB, in many cases. |
So it sounds like more work is needed on this PR. Those function names probably need to be updated in our code. |
Grepping suggests vcpkg is only used for Windows, so I think I'm OK regarding Regarding the |
You are correct that vcpkg is primarily used on Windows. And that's the only OS where we use it. I have access to my macOS installation again (yay!). So I expect I will be able to work on the OpenGL errors again shortly. |
I have, indeed, been able to spend some time troubleshooting the OpenGL errors on macOS. I haven't gotten very far though. MacPorts is much faster at installing stuff on older versions of macOS, it seems. Like macOS 11, which is what I have. Unfortunately, I haven't figured out how to get Vega Strike to work with it. It would be great if I can, though. I will keep you updated. |
How far through the cmake build do you get? I can get to 62% with the following patches, and the flags above: diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt
index b35ba35ef..c2c12b501 100644
--- a/engine/CMakeLists.txt
+++ b/engine/CMakeLists.txt
@@ -36,6 +36,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.16 FATAL_ERROR)
SET(VEGASTRIKE_VERSION_MAJOR "0")
SET(VEGASTRIKE_VERSION_MINOR "10")
SET(VEGASTRIKE_VERSION_PATCH "0")
+# SET(CMAKE_LIBARY_PATH /opt/local/lib ${CMAKE_LIBRARY_PATH})
IF (DEFINED ENV{SHORT_SHA} AND NOT "$ENV{SHORT_SHA}" STREQUAL "")
SET(VEGASTRIKE_VERSION_TWEAK "$ENV{SHORT_SHA}")
diff --git a/engine/FindGTK3.cmake b/engine/FindGTK3.cmake
index 324861b65..a187003d8 100644
--- a/engine/FindGTK3.cmake
+++ b/engine/FindGTK3.cmake
@@ -180,6 +180,7 @@ FUNCTION(_GTK3_FIND_INCLUDE_DIR _var _hdr)
/sw
/opt/local
/opt/local/include
+ /opt/local/lib/glib-2.0/include
$ENV{GTKMM_BASEPATH}
[HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] I also needed to add the following includes to #include <GL/glut.h>
#include <GL/glext.h> Then build with: ./script/cibuild -DBoost_ROOT=/opt/local/libexec/boost/1.76 -DPython3_ROOT_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/3.12 -DOPENGL_gl_LIBRARY:FILEPATH=/opt/local/lib/libGL.dylib -DOPENGL_glu_LIBRARY:FILEPATH=/opt/local/lib/libGLU.dylib -DGLUT_glut_LIBRARY=/opt/local/lib/libglut.dylib -DGLUT_INCLUDE_DIR=/opt/local/include -DCMAKE_FIND_FRAMEWORK=LAST I also experimented with adding |
I installed the following MacPorts packages:
|
@daviewales you and I went down very similar paths. I am happy to report that I have gotten vegastrike-engine itself to build 100%. I haven’t figured out the GTK stuff yet, though (for vegasettings). Maybe your patches will help. Thanks for those.
I have to say, I am very impressed with your work. I know how hard it was for me to get as far as I have gotten.
One of the key pieces seems to have been installing XQuartz, available through MacPorts as “xorg-server”. And yes, I did need to set CMAKE_PREFIX_PATH to /opt/local as well. I did that in my CMake Presets.
See my linked Pull Request, #851 , for more details on the changes I have made to get Vega Strike to compile on macOS in conjunction with MacPorts. Note that the game also runs, and I can hear music; however, the game window doesn’t show anything except blank blackness. I’m curious to see whether you get any better results on your system.
Thanks,
Stephen G. Tuggy
On Sun, Apr 28, 2024, at 4:14 PM, David Wales wrote:
I installed the following MacPorts packages:
`cmake
libvorbis
boost
libsdl2 <-- different to docs (libsdl)
libjpeg-turbo <-- different to docs (jpeg) (got error Could NOT find JPEG (missing: JPEG_LIBRARY) (found version "62") with `jpeg`.)
expat
libpng
gtk3
glib2 <-- new (actually, might be automatic dependency of gtk3?) (for (missing: GTK3_GLIBCONFIG_INCLUDE_DIR))
gtkglext <-- Strangely, this depends on gtk2. Is this right?
mesa
libGLU
freeglut
`
…
—
Reply to this email directly, view it on GitHub <#533 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADFQPJT5TPLIN7PV4IX6LJ3Y7V7FDAVCNFSM5DBX7M4KU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBYGE3DSMRYGQ4Q>.
You are receiving this because you were assigned.Message ID: ***@***.***>
|
With my latest code, available in the linked Pull Request that's still open, the game runs equally as well on macOS as it does on Linux or Windows. The game itself doesn't even use XQuartz anymore. That is only used for vegasettings now, AFAIK. I am testing on macOS 11.7. @daviewales feel free to test the latest code on your machine, and see how it works for you. That would be valuable information to have. (Are you still on macOS X 10.13?) |
You might be able to avoid using XQuartz by using |
Oh, cool. Thanks. Sounds good. |
@daviewales #851 got merged, so I believe this crash is finally fixed! Am I good to close this ticket? Or do you want to test some more? Let me know if you need any help figuring out the presets thing or anything. |
And I closed it already without thinking about it. Oops! @daviewales you can always reopen this ticket if you need to. |
Thanks. I can build it again now. I have a strange issue where MacPorts creates a broken It does crash when I run it however. I'm not sure if this crash is a VegaStrike issue, or an issue with my system. I see an initial loading screen, then it crashes with the following log:
Then the following macOS crash report appears:
|
So. An exception was thrown on line 215 of OpenALRenderer.cpp. That's a bummer. Line 213 of that file (2 lines further up) has a comment that says the following:
This is not encouraging LOL. I guess the I would think we should treat this crash as a separate issue. I'll go ahead and file one. @daviewales can you try setting Sounds to No Sound, and audio volume to Off, in vegasettings? Then save your changes, and try running the game again? See if that makes any difference. |
Hmm... That's the other issue. When I run
If I point it to the data directory, it just hangs here indefinitely:
I'm open to the possibility that it's just another weird glitch in my setup... |
Sorry, |
|
And with both |
This issue follows on from #78 and #524. @stephengtuggy and @nabaco asked me to copy over the debug information for the runtime issues I'm getting now that it actually builds on MacOS.
For reference, I installed the dependencies as follows:
Segfault
Apple debug info
Output from --test-audio:
The text was updated successfully, but these errors were encountered: