exported godot game crashes out of nowhere

Godot Version

Godot_v4.7.2-Stable_Win64.exe

Question

so when i launch my server.exe which is a dedicated server export. this happens. but when i use the dedicated server tag on actual godot. this doesnt happen. heres the error. before when i exported my game. it worked. even the server.exe. then i went to eat. i came back and this happened. i tried to fix it and even reexported it a few times.

================================================================
CrashHandlerException: Program crashed with signal 11
Engine version: Godot Engine v4.7.2.stable.official (ed1daf0bf001b61586d9930840f2f1394092c079)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
Load address: 7ff4ded40000

[1] 7ff621b4e761 (main+2e0e761) - no debug info in PE/COFF executable
[2] 7ffdfb344b92 (ntdll.dll+124b92) - no debug info in PE/COFF executable
[3] 7ffdfb3864ae (ntdll.dll+1664ae) - no debug info in PE/COFF executable
[4] 7ffdfb2e4064 (ntdll.dll+c4064) - no debug info in PE/COFF executable
[5] 7ffdfb385ded (ntdll.dll+165ded) - no debug info in PE/COFF executable
[6] 7ffd23fdd503 (libterrabrush.windows.debug.x86_64.dll+2dd503) - no debug info in PE/COFF executable
[7] 7ffd23daca02 (libterrabrush.windows.debug.x86_64.dll+aca02) - no debug info in PE/COFF executable
[8] 7ffd23dacf92 (libterrabrush.windows.debug.x86_64.dll+acf92) - no debug info in PE/COFF executable
[9] 7ffd23dae904 (libterrabrush.windows.debug.x86_64.dll+ae904) - no debug info in PE/COFF executable
[10] 7ffd2407bbbb (libterrabrush.windows.debug.x86_64.dll+37bbbb) - no debug info in PE/COFF executable
[11] 7ffd23dd34fa (libterrabrush.windows.debug.x86_64.dll+d34fa) - no debug info in PE/COFF executable
[12] 7ff6232abdb2 (main+456bdb2) - no debug info in PE/COFF executable
[13] 7ff621833707 (main+2af3707) - no debug info in PE/COFF executable
[14] 7ff62156be5d (main+282be5d) - no debug info in PE/COFF executable
[15] 7ff62182a2b1 (main+2aea2b1) - no debug info in PE/COFF executable
[16] 7ff62182a4b8 (main+2aea4b8) - no debug info in PE/COFF executable
[17] 7ff62000845e (main+12c845e) - no debug info in PE/COFF executable
[18] 7ff61ed9cf6f (main+5cf6f) - no debug info in PE/COFF executable
[19] 7ff61ed42ed0 (main+2ed0) - no debug info in PE/COFF executable
[20] 7ff61ed92701 (main+52701) - no debug info in PE/COFF executable
[21] 7ff61ed9273d (main+5273d) - no debug info in PE/COFF executable
[22] 7ff61ed410c8 (main+10c8) - no debug info in PE/COFF executable
[23] 7ff61ed413f5 (main+13f5) - no debug info in PE/COFF executable
[24] 7ffdfa2cdda6 (kernel32.dll+2dda6) - no debug info in PE/COFF executable
[25] 7ffdfb29ee4b (ntdll.dll+7ee4b) - no debug info in PE/COFF executable
[26] -1 (main±7ff61ed40001) - no debug info in PE/COFF executable
– END OF C++ BACKTRACE –

heres my code
extends Node3D

@onready var ip_adress: LineEdit = $CanvasLayer/Control/PanelContainer/MarginContainer/VBoxContainer/LineEdit

const PLAYER = preload(“res://scenes/player.tscn”)
const PORT = 9999
var peer: ENetMultiplayerPeer
var maxclients = 4

func _ready():
multiplayer.peer_connected.connect(_on_peer_connected)
multiplayer.peer_disconnected.connect(_on_peer_disconnected)
multiplayer.connection_failed.connect(remove_multiplayer_peer)
if OS.has_feature(“dedicated_server”):
host()

func host():
peer = ENetMultiplayerPeer.new()
var error = peer.create_server(PORT, maxclients)
print("Result: ", error)
print("Status: ", peer.get_connection_status())
if error != OK:
print("Error: ", error_string(error))
return
multiplayer.multiplayer_peer = peer

func join():
peer = ENetMultiplayerPeer.new()
if ip_adress.text.is_empty():
peer.create_client(“this was for ip but im not showing my ip in this post”, PORT)
else:
peer.create_client(ip_adress.text, PORT)
multiplayer.multiplayer_peer = peer

@rpc(“authority”, “call_local”, “reliable”)
func add_player(peer_id):
if peer_id != 1:
var player = PLAYER.instantiate()
player.name = str(peer_id)
add_child(player)

@rpc(“authority”, “call_local”, “reliable”)
func remove_player(peer_id):
var player = get_node_or_null(str(peer_id))
if player:
player.queue_free()

func remove_multiplayer_peer():
multiplayer.multiplayer_peer = OfflineMultiplayerPeer.new()

func _on_join_pressed() → void:
$CanvasLayer.hide()
join()

func _on_host_pressed() → void:
host()

func _on_peer_connected(peer_id):
if !multiplayer.is_server():
return

print("peer connected", peer_id)
add_player.rpc(peer_id)
for player in get_children():
	if player is CharacterBody3D:
		var existing_id = str(player.name).to_int()
		if existing_id != peer_id:
			add_player.rpc_id(peer_id, existing_id)

func _on_peer_disconnected(peer_id):
if !multiplayer.is_server():
return

print("peer disconnected", peer_id)
remove_player.rpc(peer_id)

Based on the stack trace, it looks like the problem is either in TerraBrush or in your use of TerraBrush. Since the code you posted doesn’t use TerraBrush, the problem is probably not in the code you posted.