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

GameMaker segfaults unless run as root #9620

Open
2 tasks
hergezod opened this issue Mar 3, 2025 · 16 comments
Open
2 tasks

GameMaker segfaults unless run as root #9620

hergezod opened this issue Mar 3, 2025 · 16 comments
Assignees
Labels
ide-bug Bugs with the GameMaker IDE

Comments

@hergezod
Copy link

hergezod commented Mar 3, 2025

Description

Hello, I get a segfault whenever I try running GameMaker Studio unless I run it as root.
This issue started happening after updating from version 2022 to any of the 2023/2024 versions.
My operating system is Devuan Daedalus.

Starting......
Critical: Doing Validate Folder check...  macOS=False
**************************************  03/03/2025  **************************************
Logger.Initialise
Skin: /opt/GameMaker-Beta/x86_64/GUI/Skins/Dark
GameMaker, Version=2024.1300.0.743, Culture=neutral, PublicKeyToken=null
Initialise()
Command line arguments:
ProcessId:5140
SteamAPI Init returned : False
Loading proxy settings
[createdump] Gathering state for process 5140 GameMakerStudio
[createdump] Crashing thread 1414 signal 11 (000b)
[createdump] Writing minidump to file /home/hergezod/.local/share/GameMakerDumps/gmdump.5140.dmp
[createdump] Written 28192768 bytes (6883 pages) to core file
[createdump] Target process is alive
[createdump] Dump successfully written in 612ms
Segmentation fault

Attaching strace output as well because I don't have a sample package to upload, I can't get to the stage where GameMaker runs.
strace.txt

Through conversations with one of the developers we were able to pinpoint the culprit of the segfault being the imagemagick library.
Would it be possible to dig deeper into this and issue a fix?

Expected Change

GameMaker Studio should run as intended.

Steps To Reproduce

  1. Install GameMaker and all required dependencies.
  2. Launch /opt/GameMaker-Beta/GameMaker as user
  3. See the issue

How reliably can you recreate this issue using your steps above?

Always

Which version of GameMaker are you reporting this issue for?

2024.1300 (Betas)

Which operating system(s) are you seeing the problem on?

Devuan 5 Daedalus

Are you running GameMaker from inside your Steam library?

No

Sample Package Attached?

  • I have attached my bug package

Sample Project Added?

  • I have included a small sample project
@hergezod hergezod added the ide-bug Bugs with the GameMaker IDE label Mar 3, 2025
@stuckie stuckie self-assigned this Mar 4, 2025
@stuckie stuckie moved this from Triage to Backlog in Team Workload Mar 4, 2025
@stuckie
Copy link

stuckie commented Mar 4, 2025

This very much sounds like a permission issue as you should not need to run GameMaker as root.
I've not come across this distribution before, but it does seem to suggest it is Debian based, so I assume that you have been able to install the .deb itself?

As a check, you could unpack the .deb to a temporary location and run it from in there to ensure that it's a problem with the installation.
This can be done by:

ar x GameMaker-Beta*.deb
tar -xvf data.tar.xz
cd opt/GameMaker-Beta
./GameMaker

Which should run it locally from that directory, having been extracted with the same permissions as your user.

You could also attach that crash dump so we can see in our code what is going wrong.
These are stored in ~/.local/share/GameMakerDumps

@hergezod
Copy link
Author

hergezod commented Mar 4, 2025

Hi stuckie, yes, Devuan is pretty much Debian.
I tried running it from a temporary directory and had the same problem:

Starting......
Critical: Doing Validate Folder check... macOS=False
************************************** 03/04/2025 **************************************
Logger.Initialise
Skin: /home/hergezod/Downloads/opt/GameMaker-Beta/x86_64/GUI/Skins/Dark
GameMaker, Version=2024.1300.0.743, Culture=neutral, PublicKeyToken=null
Initialise()
Command line arguments:
ProcessId:26768
SteamAPI Init returned : False
Loading proxy settings
[createdump] Gathering state for process 26768 GameMakerStudio
[createdump] Crashing thread 6890 signal 11 (000b)
[createdump] Writing minidump to file /home/hergezod/.local/share/GameMakerDumps/gmdump.26768.dmp
[createdump] Written 28106752 bytes (6862 pages) to core file
[createdump] Target process is alive
[createdump] Dump successfully written in 560ms
Segmentation fault

Attaching the dump below
gmdump.26768.dmp.zip

@stuckie
Copy link

stuckie commented Mar 4, 2025

Ok, so this is definitely failing with ImageMagick as we try to call Environment_Initialize.
I cannot tell whether it's failing inside ImageMagick itself, or whether it's at the library load level... so let's see which it is.

You should have three libraries in your GameMaker-Beta/x86_64 folder:

  • Magick-Native-Q8-x64.dll.so
  • Magick.NET-Q8-AnyCPU.dll
  • Magick.NET.Core.dll

I'd first check the permissions on those to make sure your user can access them, especially if running as root seems to work.

Then perhaps try:

  • ldd Magick.Native-Q8-x64.dll.so

to make sure it has all it's dependencies on your system.. though again, the running as root trips me up here as surely it would fail if these weren't met.

To pinpoint whether it's a LD path issue ( as .NET is a bit odd with library paths ) try renaming them to ensure they cannot be found and see if you get the exact same crash.
If you do, you can try overriding the search paths by adding something like:
<dllmap dll="Magick-Native-Q8-x64.dll" target="Magick-Native-Q8-x64.dll.so" os="linux" />
to GameMaker.dll.config ( or it might be IDE.dll.config ... I'm not sure which one it'll specifically be looking for as I cannot reproduce this and you are, technically, running on an unsupported distribution )

Finally, the only other thing I can think of is, again, back to permissions.
ImageMagick writes to the temp directory as it converts things, so you may want to make sure your /tmp - or wherever it is - is writable by your user.
Apparently, it can be set to point elsewhere with setting the MAGICK_TEMPORARY_PATH environment variable, but I'm not sure if Magick.NET honours that, since it has it's own call to set the temp directory.

All else fails, you could run it within an Ubuntu distrobox - which is a Docker-like container system and if nothing else, keeps it in it's own little world.

@hergezod
Copy link
Author

hergezod commented Mar 4, 2025

Thank you for trying to help me!
This is the output of ls -l for the 3 files:

-rwxr--r-- 1 hergezod hergezod 37878704 May 26 2024 Magick.Native-Q8-x64.dll.so
-rwxr--r-- 1 hergezod hergezod 848888 Jun 7 2024 Magick.NET-Q8-AnyCPU.dll
-rwxr--r-- 1 hergezod hergezod 1531384 Jun 7 2024 Magick.NET.Core.dll

And this is the output of ldd Magick.Native-Q8-x64.dll.so

linux-vdso.so.1 (0x00007ffce1ff4000)
libgtk3-nocsd.so.0 => /usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0 (0x00007f8382147000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f8382136000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8382131000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f837fb21000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f837f940000)
/lib64/ld-linux-x86-64.so.2 (0x00007f838216e000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f838212a000)

To pinpoint whether it's a LD path issue ( as .NET is a bit odd with library paths ) try renaming them to ensure they cannot be found and see if you get the exact same crash.

Just to be on the same page, do I need to rename the libraries that are in the output for ldd Magick.Native-Q8-x64.dll.so? In GameMaker.dll.config I see only dllmap commands for yoga while IDE.dll.config has openAL, onig and yoga. If I add this dllmap line into both files, would that cause any issues?

Checking the /tmp folder's permissions with ls -al gave this result:

drwxrwxrwt 5 root root 4096 Mar 4 18:17 .

Could this be the reason why it won't work? If so, what would be your recommendation in terms of permissions the user should have for this folder? Would it cause any security issues if the user can write to the /tmp folder?

@stuckie
Copy link

stuckie commented Mar 4, 2025

Interesting that the arm64 version doesn't link to gtk3 but that's nothing to do with what's here. ( Verifying commands on an arm64 distribution just now, if you're wondering )

For the ldd, no, that's just seeing what library link dependencies it has.
And your tmp permissions are the same as mine as well, so it's likely not that.

It shouldn't hurt adding it to both files, so feel free to do so.
I take it it still had issues after you renamed the libraries so it definitely couldn't find them?

@hergezod
Copy link
Author

hergezod commented Mar 4, 2025

After moving the file and adding to both dll.config files I saw the GameMaker Studio window but it's blank and non-functioning.
Image
I've attached the log below as well.
log.txt

@stuckie
Copy link

stuckie commented Mar 4, 2025

Ah, ok, you did two different things at once!

The step of moving the libraries was to see if it was not able to find them initially, or if the actual initialise function was being called but doing something your distribution did not like.

From that ui.log, it's definitely not picking up the libraries now so it's unable to load any images - hence the black screen. Though that's slightly worrying in that it's working now, rather than crashing out.

Separately, the config lines were to remap what it's looking for. If you have moved/renamed the libraries, you'll need to put them back or modify the target lines to where they are now.

@hergezod
Copy link
Author

hergezod commented Mar 4, 2025

Should I return the Magick.Native-Q8-x64.dll.so to the x86_64 folder and set it in the dll.configs and try running it again or is there something else I should try?

@stuckie
Copy link

stuckie commented Mar 4, 2025

Yep, may as well try it as I'm running out of ideas now.
It seems to be something between your distribution and what ImageMagick is doing.
We don't build it, we pull it from the upstream Magick.NET project, so we have no changes of our own.

If this doesn't work, again, I can only suggest running it through distrobox in an Ubuntu container.
You are using an unsupported distribution... this is pretty much why we focus on one as each distribution has it's own quirks to deal with.

@hergezod
Copy link
Author

hergezod commented Mar 4, 2025

After setting it back to the folder with the extracted engine
<dllmap dll="Magick-Native-Q8-x64.dll" target="/home/hergezod/Downloads/opt/GameMaker-Beta/x86_64/Magick-Native-Q8-x64.dll.so" os="linux" />
I get the segfault again.
I'm in no way blaming you for anything. Debian is known not to update many of its libraries and applications unless it's necessary from a security perspective so it could be that this will be fixed once Trixie is released but yeah, in the worst case scenario, I can try to set up Ubuntu on another computer and run with that. In most cases, since Ubuntu is based on Debian you sort of expect things to just work but you can't have everything working so I was hoping that if I submit a bug report, we could try to figure out a solution. It is strange that I can run the IDE as root though, I also thought it could have been permission related but it's hard to pinpoint what exactly could be the reason and how to work around it. 🙂

@stuckie
Copy link

stuckie commented Mar 4, 2025

I still recommend using distrobox - I've used it to test on Arch, for instance - and it keeps things contained out the way.

The fact it actually runs as root is particularly confusing, and certainly seems to point towards a permissions issue somewhere that's tripping things up. I definitely cannot recommend running anything as root, as you're likely well aware of!

I have noticed we are running an older version of ImageMagick so I'll put in a ticket to update this for the next major release, and hopefully that may help as we do have a couple of other image issues at the moment that may also benefit from the update.

Unfortunately, I'm a bit at a loss now.

@hergezod
Copy link
Author

hergezod commented Mar 5, 2025

Yeah. I understand and I'm hopeful the ImageMagick update will fix this and many other issues as well. I'll also look into distrobox as well although I'm not a fan of running containers and flatpaks on my aging laptop. 🙁
Would trying to run the IDE as root and sending you the log in any way help pinpoint which libraries it's loading to help us narrow down which one could use a permissions change? At this point I'm simply curious to find the reason for this problem. 😁

@stuckie
Copy link

stuckie commented Mar 5, 2025

Yep, we can look at the log and see if there's anything in there that points to what is going on.

@hergezod
Copy link
Author

hergezod commented Mar 5, 2025

Launching it from the extracted folder as root also leads to it running and installing its runtime.
Sharing the log and the dump after I closed the IDE through the exit button.
log.txt
gmdump.20348.dmp.zip

@stuckie
Copy link

stuckie commented Mar 6, 2025

There's definitely nothing in the logs that seem to point to anything in particular going wrong ( or right, in this case. )

We've marked ImageMagick to be updated for the next major release ( it's too late for this one ) so hopefully that'll work out. I'll keep this ticket open to refer back to when we have a beta that's available for testing, so we can try and pin it down.

@hergezod
Copy link
Author

hergezod commented Mar 6, 2025

In any case, thank you for looking into it. Here's hoping the next beta will work on this system as well. I set up GameMaker on my other PC so if worst comes to worst, I can just use that in the meantime. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ide-bug Bugs with the GameMaker IDE
Projects
Status: Backlog
Development

No branches or pull requests

2 participants