[Rseding91] [0.17.38] Not Helpful Crash Message

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
Cooldude2606
Long Handed Inserter
Long Handed Inserter
Posts: 98
Joined: Sat Sep 16, 2017 9:04 pm
Contact:

[Rseding91] [0.17.38] Not Helpful Crash Message

Post by Cooldude2606 »

Was busy making a scenario when an update must have broken something; I check log for details for where I was casuing an error but nothing of use was included:

Code: Select all

1002.674 Error MainLoop.cpp:1173: Exception at tick 0: Unable to parse LocalisedString: given table is empty.
1002.674 Error ServerMultiplayerManager.cpp:92: MultiplayerManager failed: "Unable to parse LocalisedString: given table is empty."
1002.674 Info ServerMultiplayerManager.cpp:776: updateTick(0) changing state from(InGame) to(Failed)
And in game it is no help either:
Image

Could you please make this more detailed by maybe including a stacktrace so that I dont have to go through every scenario file enabling and disabling things to find what does and doesnt cause the error.

After much searching I found what was casuing the error: I was calling error with a table by mistake when the varible should have been a string, however this still took some time to find due to the lack of a stack trace it was also strange how I was calling error from within a pcall enviroment and it still caused the game to error and crash, this may also be a second bug as a result of this.
--- Developer for Explosive Gaming and Clusterio. Please contact me via our Discord. ---

User avatar
Cooldude2606
Long Handed Inserter
Long Handed Inserter
Posts: 98
Joined: Sat Sep 16, 2017 9:04 pm
Contact:

Re: [0.17.38] Not Helpful Crash Message

Post by Cooldude2606 »

Update: after reading through more code I found that the point I made about escaping the pcall was not true and that the error was caused by pcall returning the table which I raised with error. The reason it crashed was because log was called with a empty table (outside the pcall) however a stack trace would still have helped here.
--- Developer for Explosive Gaming and Clusterio. Please contact me via our Discord. ---

Rseding91
Factorio Staff
Factorio Staff
Posts: 13931
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.38] Not Helpful Crash Message

Post by Rseding91 »

Can you give me a save file that reproduces this error?
If you want to get ahold of me I'm almost always on Discord.

User avatar
Cooldude2606
Long Handed Inserter
Long Handed Inserter
Posts: 98
Joined: Sat Sep 16, 2017 9:04 pm
Contact:

Re: [0.17.38] Not Helpful Crash Message

Post by Cooldude2606 »

Add this code to the control.lua and it will cause the error with no stack trace, you can change the error({}) to error('foo') and see that a stack trace is produced and that is only when log is given an empty table that no stack trace is produced.

Code: Select all

local function log_errors(callback)
	local success, err = pcall(callback)
	if not success then
		-- err = {} -- empty table causes the locale error but with no stack trace
		-- err = 'foo' -- logs error 'foo' with stack trace which includes ln6 and ln12
		log(err) --ln6
	end
end

local function stack_two()
	-- return error with {} as the error message, this was the mistake i made
	return error({}) --ln12
end

local function stack_one()
	return stack_two()
end

script.on_event(defines.events.on_tick,function()
	log_errors(stack_one)
end)
--- Developer for Explosive Gaming and Clusterio. Please contact me via our Discord. ---

Rseding91
Factorio Staff
Factorio Staff
Posts: 13931
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.38] Not Helpful Crash Message

Post by Rseding91 »

Thanks for the code. It's now fixed for the next version of 0.17.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”