OpenAWE-Project / OpenAWE

A reimplementation of Remedy Entertainments Alan Wake Engine, in later iterations known as the Northlight Engine
GNU General Public License v3.0
163 stars 13 forks source link

Segmentation fault when running on Fedora 34 #4

Closed Newbytee closed 3 years ago

Newbytee commented 3 years ago

I built OpenAWE like this on Fedora 34:

$ git clone git@github.com:OpenAWE-Project/OpenAWE.git
$ git submodule init
$ git submodule update
$ mkdir build
$ cmake ..
$ make

I got the various dependencies from the Fedora repositories. When I launch OpenAWE, it segfaults. It does print some messages, but nothing that helped me diagnose the issue:

[neboula@shock build]$ ./awe -p /mnt/storage/SteamLibrary/steamapps/common/alan\ wakes\ american\ nightmare/
[2021-07-06 15:26:34.612] [info] Initializing AWE...
[2021-07-06 15:26:34.613] [info] Indexing streamed resource file cid_streamedcloth.bin
Segmentation fault (core dumped)

It also happens if I don't specify a path:

[neboula@shock build]$ ./awe
[2021-07-06 15:27:07.933] [info] Initializing AWE...
[2021-07-06 15:27:07.933] [warning] No data path given, using current working directory
[2021-07-06 15:27:07.934] [info] Indexing streamed resource file cid_streamedcloth.bin
Segmentation fault (core dumped)

Or if I try to launch the original Alan Wake instead of Alan Wake's American Nightmare:

[neboula@shock build]$ ./awe -p /mnt/storage/SteamLibrary/steamapps/common/Alan\ Wake/
[2021-07-06 15:23:09.424] [info] Initializing AWE...
[2021-07-06 15:23:09.424] [info] Indexing streamed resource file cid_streamedcloth.bin
Segmentation fault (core dumped)

It does not segfault if I issue the --help command. I might try to debug this later. Suggestions what to try are welcome.

Nostritius commented 3 years ago

Hi, Your issue is, provided that the steam version doesn't use a vastly different directory structure (I am using the gog version), that the path shouldn't point to the root directory, but rather to the data directory, the directory where the rmdp files reside. I realize now that this is not clearly explained somewhere. I can add a section in the readme for that, when I have some time. In the case of Alan Wake, it shouldn't work at the moment without some modifications of the source code.

Newbytee commented 3 years ago

Your issue is, provided that the steam version doesn't use a vastly different directory structure (I am using the gog version), that the path shouldn't point to the root directory, but rather to the data directory, the directory where the rmdp files reside. I realize now that this is not clearly explained somewhere. I can add a section in the readme for that, when I have some time.

Correct, that was my issue. I think making the engine tell the user that this isn't the data directory would be an okay solution as well, but documenting how this is used would definitely be good too.

However, it's now complaining that it does not find some file (presumably the configuration?): log.txt

Nostritius commented 3 years ago

I have fixed this issue in the last commit, it should work now. About the data directory, yes this is definitely something I had also in mind. If you want to add code for this, feel free.

Newbytee commented 3 years ago

A pull fixed that :+1:

Next issue - GLFW tries to use Wayland!

[2021-07-06 16:20:53.818] [info] Reading Alan Wakes American Nightmare configuration
[2021-07-06 16:20:53.818] [info] GLFW Info: 3.3.4 Wayland EGL OSMesa clock_gettime evdev shared
[2021-07-06 16:20:53.818] [error] GLFW Error 65544: Wayland: Failed to connect to display
[2021-07-06 16:20:53.819] [critical] Failed to initialize glfw

I like Wayland but unfortunately I have an NVIDIA card so I'm using X11 :(. I don't think I've something unusual set so I'm not sure what this is about. Do you think this is a distribution issue or a OpenAWE bug?

Newbytee commented 3 years ago

Actually, is this something I should be specifying in that configuration file I don't have?

Nostritius commented 3 years ago

I like Wayland but unfortunately I have an NVIDIA card so I'm using X11 :(. I don't think I've something unusual set so I'm not sure what this is about. Do you think this is a distribution issue or a OpenAWE bug?

Me too :smile: . I have also fedora 34 and an nvidia card and ran into the exact same problem. This is definitely a problem of fedora, since they ported everything to use wayland by default. You have to compile glfw against x11 and use this version. From what I know, the glfw devs have it on their roadmap to switch between wayland and x11 here. The config file contains only alan wake engine related information, for example, which manuscript pages you already collected.

Newbytee commented 3 years ago

Maybe we should close this issue? It's not clear to me what would be necessary to consider this fixed. The crash issue was fixed, and the Wayland issue is a GLFW issue, not OpenAWE issue.

Nostritius commented 3 years ago

Ok, I will close here, just wanted to see, if other errors emerge when you fixed glfw.

Newbytee commented 3 years ago

Oh, I can give you a followup: I ended up switching to Wayland following the release of the 470.xx.xx NVIDIA driver and it just works now. :+1: