Error when opening the exported game on linux

Godot Version

4.6 spable

Question

Hi my first post and still a rookie so please take it easy.

I have exported my finished game for linux. I work on Windows and have exported for Windows aswell. I get an error only when opening the linux version (with a linux PC). I seames to have troubles with arrays but i only use one array and have no problems listed in Godot.


func random_dir(dir):
	dir = choose([Vector2.UP, Vector2.DOWN, Vector2.RIGHT, Vector2.LEFT])
	print(dir)
	return dir

func choose(array: Array):
	array.shuffle()
	if array:
		return array.front()
	else:
		pass

Error Massage:
Godot Engine v4.6.stable.official.89cea1439 - https://godotengine.org
Vulkan 1.4.318 - Forward+ - Using Device #0: Unknown - llvmpipe (LLVM 21.1.2, 128 bits)

ERROR: /root: The caller thread can’t call the function `propagate_notification()` on this node. Use `call_deferred()` or `call_deferred_thread_group()` instead.
at: propagate_notification (scene/main/node.cpp:2597)

================================================================
handle_crash: Program crashed with signal 4
Engine version: Godot Engine v4.6.stable.official (89cea143987d564363e15d207438530651d943ac)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
ERROR: FATAL: Index p_index = 1 is out of bounds (size() = 0).
at: get (./core/templates/cowdata.h:193)
Game/Holistication.sh: line 4: 6387 Illegal instruction (core dumped) “$base_path/Holistication.x86_64” “$@”
doug@tux ~/Downloads$

What’s in line 4 of your shell script?

I would imagine this is what is causing the problem.

No reason to have that code in a final build version.

I would assume this function is doing the print. So you are trying to print to the editor log, but that doesn’t exist.

Just a guess though.

The stderr shows the line itself

“$base_path/Holistication.x86_64” “$@”

I’m guessing this is the default bash script Godot generates for Linux exports

#!/bin/sh
echo -ne '\033c\033]0;GAME_NAME\a'
base_path="$(dirname "$(realpath "$0")")"
"$base_path/GAME_NAME.x86_64" "$@"
1 Like

I’ve got prints all over the place and never had a problem. Had someone play a Linux export two weeks ago (though it was 4.5.1).

The issue with Linux though is different distros with different windows manager (x11 or Wayland).
Just seems to me like thats where the issue is. The function that its crashing on literally is used for print commands:

Object — Godot Engine (stable) documentation in English

And whilst there is nothing wrong with prints, I wouldn’t have them in my code for a final release.

Create a separate version for the final release (which is best practice) and remove anything like that. Literally creating log entries to an editor that does not exist (although could be redirected to a in-game ‘console’ if that was required).

You could use feature tags to hide anything like that in a non release version I guess though. (or preprocessor tags in c#)

1 Like

Yeah I have been slowly implementing switches. I’ve considered using the new logging class. But I export debug versions a lot and want that output for now. Creating a separate version for game jam games is not necessary.

1 Like

What do you mean?

propagate_notification does call notification but it’s used by the signal system, there is no signal when printing


This is not how this works, as long as Engine.print_to_stdout has not been changed from the default of true, then any print call will output into the console that started the process on the stdout output stream. The reason you should use push_error and push_warning is to not pollute the stack trace.

Which is why this export option exists

On Linux it will be either the console you launched the executable from, or it will be piped to the compositor/graphical server, so it will always be “printed” in some capacity.

On Windows, even if you launch the .exe without the console wrapper it will be handled, but God knows where it gets piped to…

I think this is what you are experiencing:

The solution was to change the rendering compatibility for Linux

1 Like

“$base_path/Holistication.x86_64” “$@”

Thank you for the Help!