[0.17.66] Crash on Lua error in on_chunk_generated

Bugs that we were not able to reproduce, and/or are waiting for more detailed info.
Post Reply
mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

[0.17.66] Crash on Lua error in on_chunk_generated

Post by mrvn »

I'm starting a new mod that needs a custom map on it's own surface. I did something wrong so when you press the "PB Editor" button and it starts to generate the map it gets a Lua error. But then the game crashes.
5514.184 Script @__PersistantBlueprints__/control.lua:169: map_chunk_generated([-96, -96]-[-64, -64])
terminate called after throwing an instance of 'ScriptEventException'
what(): The mod Persistant Blueprints caused a non-recoverable error.
Please report this error to the mod author.
Looks like the async map generation fails to catch Lua exceptions.
Attachments
PersistantBlueprints_0.0.0.zip
(18.82 KiB) Downloaded 55 times
factorio-current.log
(136.71 KiB) Downloaded 68 times

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.17.66] Crash on Lua error in on_chunk_generated

Post by Klonan »

Looks like its a mod problem:

Code: Select all

Error while running event PersistantBlueprints::on_chunk_generated (ID 12)
__PersistantBlueprints__/control.lua:188: attempt to index local 'entity' (a number value)
stack traceback:
	__PersistantBlueprints__/control.lua:188: in function <__PersistantBlueprints__/control.lua:156>
	[C]: in function 'force_generate_chunk_requests'
	__PersistantBlueprints__/control.lua:59: in function 'editor_init'
	__PersistantBlueprints__/control.lua:118: in function 'editor_button_clicked'
	__PersistantBlueprints__/control.lua:129: in function <__PersistantBlueprints__/control.lua:125
Moving to not a bug

Bilka
Factorio Staff
Factorio Staff
Posts: 3129
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [0.17.66] Crash on Lua error in on_chunk_generated

Post by Bilka »

Klonan wrote:
Sun Sep 01, 2019 8:58 am
Looks like its a mod problem:
If you read the log, you will see that is showed "unexpected error", not the normal mod error dialog. However, I cannot reproduce this.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [0.17.66] Crash on Lua error in on_chunk_generated

Post by mrvn »

I can reproduce it every time here.

Start factorio:

Code: Select all

   0.000 2019-09-01 11:11:45; Factorio 0.17.66 (build 46866, linux64, alpha)
   0.000 Operating system: Linux
   1.036 Checksum of PersistantBlueprints: 4126365630
Select Play -> Scenarios -> Sandbox -> Create -> Play

The sandbox starts. Press <tab> and click the "PB Editor" button.

The game crashes due to:

Code: Select all

surface.force_generate_chunk_requests()
Without that the normal mod error dialog is shown and the game survives the error in the mod.

Bilka
Factorio Staff
Factorio Staff
Posts: 3129
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [0.17.66] Crash on Lua error in on_chunk_generated

Post by Bilka »

Even following those steps, I cannot reproduce the unexpected error.
Image
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [0.17.66] Crash on Lua error in on_chunk_generated

Post by mrvn »

Do you have multiple CPU cores? force_generate_chunk_requests() says it uses all threads so maybe it's a race condition which thread gets the LuaException first.

User avatar
Jon8RFC
Filter Inserter
Filter Inserter
Posts: 553
Joined: Tue May 10, 2016 3:39 pm
Contact:

Re: [0.17.66] Crash on Lua error in on_chunk_generated

Post by Jon8RFC »

Windows 10 here. Couldn't get it to crash, but it had the same error as Bilka and booted me back to the main menu. I set all config thread options to 1 and set cpu affinity via cmd at launch to 1 core. It was noticeably slower to load the scenario map, but no crash. I forced the integrated gpu to do the rendering (still eventually passed through my dedicated gpu though) and still no crash. I don't have a linux machine to test on.
Attachments
factorio-previous.log
(15.13 KiB) Downloaded 62 times
factorio-current.log
(9.55 KiB) Downloaded 58 times
Image

Post Reply

Return to “Pending”