[0.15.11][Rseding] take_screenshot segfault on delted surface

This subforum contains all the issues which we already resolved.
Zulan
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Mon Jan 25, 2016 5:55 pm
Contact:

[0.15.11][Rseding] take_screenshot segfault on delted surface

Post by Zulan »

The following mod crashes

Code: Select all

script.on_event(defines.events, function(event)
    if event.name == defines.events.on_chunk_generated then
	    game.take_screenshot{resolution={x=1920,y=1080}, zoom=0.08, path='test.png'}
    end
end)
Log:

Code: Select all

   0.001 2017-05-02 21:13:05; Factorio 0.15.6 (build 29362, win64, alpha)
   0.001 Operating system: Windows 7 Service Pack 1
   0.001 Program arguments: "C:\Games\Factorio-Mapper\Factorio_0.15.6\bin\x64\factorio.exe" 
   0.001 Read data path: C:/Games/Factorio-Mapper/Factorio_0.15.6/data
   0.001 Write data path: C:/Games/Factorio-Mapper/Factorio_0.15.6
   0.001 Binaries path: C:/Games/Factorio-Mapper/Factorio_0.15.6/bin
   0.007 System info: [CPU: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz, 8 cores, RAM: 32701MB]
   0.007 Display options: [FullScreen: 0] [VSync: 0] [UIScale: 100%] [MultiSampling: OFF] [Screen: 255]
   0.008 Available display adapters: 2
   0.008  [0]: \\.\DISPLAY1 - NVIDIA GeForce GTX 1060 6GB {0x01, [1920,30], 1680x1050, 32bit, 59Hz}
   0.008  [1]: \\.\DISPLAY2 - NVIDIA GeForce GTX 1060 6GB {0x05, [0,0], 1920x1080, 32bit, 60Hz}
   0.008 Create display on adapter 1. Size 1280x720 at position [310, 162].
   0.029 Initialised Direct3D:[0] NVIDIA GeForce GTX 1060 6GB; driver: nvd3dumx.dll 21.21.13.7595
   0.031     Video memory size (dedicated video/dedicated system/shared system/available): 6045/0/16094/1657 MB
   0.047 DSound: Starting _dsound_update thread
   0.047 DSound: Enter _dsound_update; tid=5756
   0.048 Device reset internal.
   0.049 Desktop composition is active.
   0.049 Graphics settings preset: very-high
   0.049 Graphics options: [Graphics quality: high] [Video memory usage: all] [Light scale: 25%] [DXT: false]
   0.102 Loading mod core 0.0.0 (data.lua)
   0.108 Loading mod base 0.15.6 (data.lua)
   0.191 Loading mod base 0.15.6 (data-updates.lua)
   0.246 Checksum for core: 3409166051
   0.246 Checksum of base: 2213884006
   0.246 Checksum of seedmapper: 0
   0.338 Info PlayerData.cpp:55: Local player-data.json available, timestamp 1493752256
   0.338 Info PlayerData.cpp:62: Cloud player-data.json unavailable
   0.402 Loaded shader file C:/Games/Factorio-Mapper/Factorio_0.15.6/data/core/graphics/shaders/game.cso
   0.402 Loaded shader file C:/Games/Factorio-Mapper/Factorio_0.15.6/data/core/graphics/shaders/zoom-to-world.cso
   0.411 Initial atlas bitmap size is 16384
   0.433 Created atlas bitmap 16384x16370
   1.024 Created atlas bitmap 16384x8937
   1.243 Created atlas bitmap 4096x3980
   1.273 Created atlas bitmap 4096x3648
  11.698 Sprites loaded
  11.698 Convert atlas 4096x3980 to: trilinear-filtering 
  11.759 Convert atlas 4096x3648 to: mipmap 
  12.441 Loading sounds...
  14.275 Custom inputs active: 0
  14.313 Factorio initialised
  57.452 Loading Level.dat: 950555 bytes.
  57.452 Info Scenario.cpp:133: Map version 0.15.6-0
  57.489 Checksum for script C:/Games/Factorio-Mapper/Factorio_0.15.6/temp/currently-playing/control.lua: 76911248
  57.490 Checksum for script __seedmapper__/control.lua: 1731634969
  63.142 Error CrashHandler.cpp:141: Exception Code: c0000094, Address: 0x000000014009bff7
ModuleBase: 0x000000013fcd0000, ImageSize: 0119e000, RelativeAddress: 003cbff7
  63.142 Error CrashHandler.cpp:151: Exception Context:
rax=0000000000000001, rbx=000000000016a7a0, rcx=0000000000000000,
rdx=0000000000000000, rsi=000000000016a960, rdi=0000000051f6ad48,
rip=000000014009bff7, rsp=000000000016a6c0, rbp=000000000016a7c1,
 r8=0000000000000000,  r9=0000000000000051, r10=0000000000000010,
r11=0000000007eeffb0, r12=0000000000000000, r13=0000000051f6ac10,
r14=0000000007eeffb0, r15=000000000016a8a0
  63.142 Crashed in C:\Games\Factorio-Mapper\Factorio_0.15.6\bin\x64\factorio.exe (0x000000013fcd0000 - 0x0000000140e6e000)
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-cu6znz\libraries\stackwalker\stackwalker.cpp (923): StackWalker::ShowCallstack
c:\cygwin64\tmp\factorio-cu6znz\src\util\logger.cpp (354): Logger::writeStacktrace
c:\cygwin64\tmp\factorio-cu6znz\src\util\logger.cpp (408): Logger::logStacktrace
c:\cygwin64\tmp\factorio-cu6znz\src\util\crashhandler.cpp (105): CrashHandler::writeStackTrace
c:\cygwin64\tmp\factorio-cu6znz\src\util\crashhandler.cpp (177): CrashHandler::SehHandler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 000000007731BC10)
000000007731BC10 (kernel32): (filename not available): UnhandledExceptionFilter
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000077420108)
0000000077420108 (ntdll): (filename not available): EtwEventSetInformation
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00000000773B7958)
00000000773B7958 (ntdll): (filename not available): _C_specific_handler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00000000773C812D)
00000000773C812D (ntdll): (filename not available): RtlDecodePointer
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00000000773B855F)
00000000773B855F (ntdll): (filename not available): RtlUnwindEx
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00000000773EBCB8)
00000000773EBCB8 (ntdll): (filename not available): KiUserExceptionDispatcher
c:\cygwin64\tmp\factorio-cu6znz\src\map\tile.cpp (221): Tile::draw
c:\cygwin64\tmp\factorio-cu6znz\src\graphics\tilerenderer.cpp (376): TileRenderer::renderTile
c:\cygwin64\tmp\factorio-cu6znz\src\graphics\tilerenderer.cpp (476): TileRenderer::renderTilesInternal
c:\cygwin64\tmp\factorio-cu6znz\src\graphics\tilerenderer.cpp (58): TileRenderer::prepare
c:\cygwin64\tmp\factorio-cu6znz\src\graphics\gamerenderer.cpp (151): GameRenderer::prepareJob
c:\cygwin64\tmp\factorio-cu6znz\src\graphics\gamerenderer.cpp (133): GameRenderer::prepare
c:\cygwin64\tmp\factorio-cu6znz\src\graphics\renderutil.cpp (523): RenderUtil::takeScreenshot
c:\cygwin64\tmp\factorio-cu6znz\src\game.cpp (185): Game::postUpdate
c:\cygwin64\tmp\factorio-cu6znz\src\mainloop.cpp (607): MainLoop::prepare
c:\cygwin64\tmp\factorio-cu6znz\src\mainloop.cpp (397): MainLoop::mainLoopStep
c:\cygwin64\tmp\factorio-cu6znz\src\mainloop.cpp (227): MainLoop::run
c:\cygwin64\tmp\factorio-cu6znz\src\main.cpp (902): wmain
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (253): __scrt_common_main_seh
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00000000772959CD)
00000000772959CD (kernel32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 00000000773CA561)
00000000773CA561 (ntdll): (filename not available): RtlUserThreadStart
  64.792 Error CrashHandler.cpp:106: Map tick at moment of crash: 240
  64.792 Error Util.cpp:76: Unexpected error occurred. If you're running the latest version of the game you can help us solve the problem by posting the contents of the log file on the Factorio forums.
Please also include the save file(s), any mods you may be using, and any steps you know of to reproduce the crash.
Last edited by Zulan on Tue May 16, 2017 9:04 pm, edited 1 time in total.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14341
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.15.6][posila] take_screenshot crashes for script.on_event

Post by Rseding91 »

How can I reproduce the crash? When I run the code you've pasted it works fine for me.
If you want to get ahold of me I'm almost always on Discord.
credomane
Filter Inserter
Filter Inserter
Posts: 307
Joined: Tue Apr 12, 2016 6:21 pm
Contact:

Re: [0.15.6][posila] take_screenshot crashes for script.on_event

Post by credomane »

Based on the name of the mod "seedmapper" I'm wondering if the game.take_screenshot that is actually in the mod includes the option position parameter that points to the chunk being generated. That would certainly crash the game.

At that zoom level taking a screenshot using the position of the newly generated chunk would include a lot of ungenerated chunks. Sending the Factorio into an endless cycle.
Zulan
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Mon Jan 25, 2016 5:55 pm
Contact:

Re: [0.15.6][posila] take_screenshot crashes for script.on_event

Post by Zulan »

That code was just control.lua, however I can no longer reproduce the issue with this minimal mod in 0.15.11.

Unfortunately my actual code still crashes in a very similar way. This is the log for 0.15.11:

Code: Select all

   0.001 2017-05-16 22:08:31; Factorio 0.15.11 (build 29782, win64, alpha)
   0.001 Operating system: Windows 7 Service Pack 1
   0.001 Program arguments: "C:\Games\Factorio-Mapper\Factorio_0.15.11\bin\x64\factorio.exe" 
   0.001 Read data path: C:/Games/Factorio-Mapper/Factorio_0.15.11/data
   0.001 Write data path: C:/Games/Factorio-Mapper/Factorio_0.15.11
   0.001 Binaries path: C:/Games/Factorio-Mapper/Factorio_0.15.11/bin
   0.011 System info: [CPU: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz, 8 cores, RAM: 32701MB]
   0.011 Display options: [FullScreen: 0] [VSync: 0] [UIScale: 100%] [MultiSampling: OFF] [Screen: 255]
   0.012 Available display adapters: 2
   0.012  [0]: \\.\DISPLAY1 - NVIDIA GeForce GTX 1060 6GB {0x01, [1920,30], 1680x1050, 32bit, 59Hz}
   0.012  [1]: \\.\DISPLAY2 - NVIDIA GeForce GTX 1060 6GB {0x05, [0,0], 1920x1080, 32bit, 60Hz}
   0.012 Create display on adapter 1. Size 1280x720 at position [310, 162].
   0.041 Initialised Direct3D:[0] NVIDIA GeForce GTX 1060 6GB; driver: nvd3dumx.dll 21.21.13.7595
   0.043     Video memory size (dedicated video/dedicated system/shared system/available): 6045/0/16094/1657 MB
   0.059 DSound: Starting _dsound_update thread
   0.059 DSound: Enter _dsound_update; tid=7320
   0.059 Device reset internal.
   0.060 Desktop composition is active.
   0.060 Graphics settings preset: very-high
   0.060 Graphics options: [Graphics quality: high] [Video memory usage: all] [Light scale: 25%] [DXT: false]
   0.106 Loading mod core 0.0.0 (data.lua)
   0.112 Loading mod base 0.15.11 (data.lua)
   0.191 Loading mod base 0.15.11 (data-updates.lua)
   0.241 Checksum for core: 909938796
   0.241 Checksum of base: 4015846642
   0.241 Checksum of seedmapper: 0
   0.334 Info PlayerData.cpp:56: Local player-data.json available, timestamp 1494964976
   0.334 Info PlayerData.cpp:63: Cloud player-data.json unavailable
   0.396 Loaded shader file C:/Games/Factorio-Mapper/Factorio_0.15.11/data/core/graphics/shaders/game.cso
   0.397 Loaded shader file C:/Games/Factorio-Mapper/Factorio_0.15.11/data/core/graphics/shaders/zoom-to-world.cso
   0.406 Initial atlas bitmap size is 16384
   0.429 Created atlas bitmap 16384x16362
   1.019 Created atlas bitmap 16384x1262
   1.050 Created atlas bitmap 16384x3212
   1.126 Created atlas bitmap 16384x4755
   1.260 Created atlas bitmap 8192x1920
   1.301 Created atlas bitmap 8192x800
   1.312 Created atlas bitmap 8192x2028
  10.999 Sprites loaded
  10.999 Convert atlas 8192x1920 to: mipmap 
  11.064 Convert atlas 8192x800 to: mipmap 
  11.163 Convert atlas 8192x2028 to: trilinear-filtering 
  11.698 Loading sounds...
  13.388 Custom inputs active: 0
  13.422 Factorio initialised
  25.081 Info BlueprintLibrary.cpp:47: Loaded external blueprint storage: playerIndex = 65535, nextRecordID = 0; timestamp = 1494965336; records:
  25.139 Loading Level.dat: 965031 bytes.
  25.139 Info Scenario.cpp:133: Map version 0.15.11-2
  25.173 Info BlueprintLibrary.cpp:190: Loaded library shelves:
  25.173 Info BlueprintLibrary.cpp:679: Game shelf: playerIndex = 65535, nextRecordID = 0; timestamp = 1494965334; records:
  25.174 Info BlueprintLibrary.cpp:47: Loaded external blueprint storage: playerIndex = 65535, nextRecordID = 0; timestamp = 1494965336; records:
  25.179 Checksum for script C:/Games/Factorio-Mapper/Factorio_0.15.11/temp/currently-playing/control.lua: 76911248
  25.180 Checksum for script __seedmapper__/control.lua: 1731634969
  32.057 Error CrashHandler.cpp:232: Received SIGSEGV
Factorio crashed. Generating symbolized stacktrace, please wait ...
c:\cygwin64\tmp\factorio-0yfcvh\libraries\stackwalker\stackwalker.cpp (923): StackWalker::ShowCallstack
c:\cygwin64\tmp\factorio-0yfcvh\src\util\logger.cpp (354): Logger::writeStacktrace
c:\cygwin64\tmp\factorio-0yfcvh\src\util\logger.cpp (408): Logger::logStacktrace
c:\cygwin64\tmp\factorio-0yfcvh\src\util\crashhandler.cpp (105): CrashHandler::writeStackTrace
c:\cygwin64\tmp\factorio-0yfcvh\src\util\crashhandler.cpp (235): CrashHandler::SignalHandler
d:\th\minkernel\crts\ucrt\src\appcrt\misc\exception_filter.cpp (219): _seh_filter_exe
d:\th\minkernel\crts\ucrt\src\appcrt\startup\thread.cpp (117): `thread_start<unsigned int (__cdecl*)(void * __ptr64)>'::`1'::filt$0
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 000000013FE86548)
000000013FE86548 (factorio): (filename not available): __C_specific_handler
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000076D5812D)
0000000076D5812D (ntdll): (filename not available): RtlDecodePointer
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000076D4855F)
0000000076D4855F (ntdll): (filename not available): RtlUnwindEx
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000076D7BCB8)
0000000076D7BCB8 (ntdll): (filename not available): KiUserExceptionDispatcher
c:\cygwin64\tmp\factorio-0yfcvh\src\map\tile.cpp (221): Tile::draw
c:\cygwin64\tmp\factorio-0yfcvh\src\graphics\tilerenderer.cpp (376): TileRenderer::renderTile
c:\cygwin64\tmp\factorio-0yfcvh\src\graphics\tilerenderer.cpp (476): TileRenderer::renderTilesInternal
c:\cygwin64\tmp\factorio-0yfcvh\src\graphics\tilerenderer.cpp (58): TileRenderer::prepare
c:\cygwin64\tmp\factorio-0yfcvh\src\graphics\gamerenderer.cpp (151): GameRenderer::prepareJob
c:\cygwin64\tmp\factorio-0yfcvh\src\graphics\gamerenderer.cpp (133): GameRenderer::prepare
c:\cygwin64\tmp\factorio-0yfcvh\src\graphics\renderutil.cpp (525): RenderUtil::takeScreenshot
c:\cygwin64\tmp\factorio-0yfcvh\src\game.cpp (189): Game::postUpdate
c:\cygwin64\tmp\factorio-0yfcvh\src\mainloop.cpp (605): MainLoop::prepare
c:\cygwin64\tmp\factorio-0yfcvh\src\mainloop.cpp (397): MainLoop::mainLoopStep
c:\cygwin64\tmp\factorio-0yfcvh\src\mainloop.cpp (227): MainLoop::run
c:\cygwin64\tmp\factorio-0yfcvh\src\main.cpp (909): wmain
f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl (253): __scrt_common_main_seh
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000076C259CD)
0000000076C259CD (kernel32): (filename not available): BaseThreadInitThunk
ERROR: SymGetLineFromAddr64, GetLastError: 487 (Address: 0000000076D5A561)
0000000076D5A561 (ntdll): (filename not available): RtlUserThreadStart
  33.564 Error CrashHandler.cpp:106: Map tick at moment of crash: 240
  33.564 Error Util.cpp:80: Unexpected error occurred. If you're running the latest version of the game you can help us solve the problem by posting the contents of the log file on the Factorio forums.
Please also include the save file(s), any mods you may be using, and any steps you know of to reproduce the crash.
The complete mod to reproduce the segfault can be found at https://github.com/Zulan/factorio-seedf ... pper_0.0.2
Zulan
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Mon Jan 25, 2016 5:55 pm
Contact:

Re: [0.15.6][posila] take_screenshot crashes for script.on_event

Post by Zulan »

credomane wrote:Based on the name of the mod "seedmapper" I'm wondering if the game.take_screenshot that is actually in the mod includes the option position parameter that points to the chunk being generated. That would certainly crash the game.

At that zoom level taking a screenshot using the position of the newly generated chunk would include a lot of ungenerated chunks. Sending the Factorio into an endless cycle.
No, there is no position parameter parameter - it uses a central one and the chunk I trigger on is a sentry. I have never observed that take_screenshot would force generating chunks - it simply renders the ungenerated chunks, so there can't be a recursion. Also I know from logging that this is the first attempt to call take_screenshot.
Zulan
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Mon Jan 25, 2016 5:55 pm
Contact:

Re: [0.15.6][posila] take_screenshot crashes for script.on_event

Post by Zulan »

I guess I figured out the issue in the current version: I do delete the surface immediately after taking the screenshot. Apparently the screenshot is now taken asynchronously so the referred surface no longer exists. I guess I can somehow work around the issue, and I suppose it's reasonable for Factorio to complain to me. However, this should not be causing a segfault!

Here is a reproducing control.lua:

Code: Select all

local function deepcopy(orig)
    local orig_type = type(orig)
    local copy
    if orig_type == 'table' then
        copy = {}
        for orig_key, orig_value in next, orig, nil do
            copy[deepcopy(orig_key)] = deepcopy(orig_value)
        end
        setmetatable(copy, deepcopy(getmetatable(orig)))
    else -- number, string, boolean, etc
        copy = orig
    end
    return copy
end

surface = nil
script.on_event(defines.events.on_tick, function(event)
    if game.tick == 100 then
        local settings = deepcopy(game.surfaces['nauvis'].map_gen_settings)
        surface = game.create_surface('test', settings)
        game.players[1].teleport({0,0}, surface)
        surface.always_day = true
    end
    if game.tick == 200 then
        game.take_screenshot{resolution={x=1920,y=1080}, zoom=0.08, path=string.format("test%07d.png", game.tick)}
        game.delete_surface(surface)
    end
end)
Rseding91
Factorio Staff
Factorio Staff
Posts: 14341
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.15.11][posila] take_screenshot segfault on delted surface

Post by Rseding91 »

Can you wrap it in a mod that I can drop in to reproduce the crash? :)
If you want to get ahold of me I'm almost always on Discord.
credomane
Filter Inserter
Filter Inserter
Posts: 307
Joined: Tue Apr 12, 2016 6:21 pm
Contact:

Re: [0.15.6][posila] take_screenshot crashes for script.on_event

Post by credomane »

Zulan wrote:I guess I figured out the issue in the current version: I do delete the surface immediately after taking the screenshot. Apparently the screenshot is now taken asynchronously so the referred surface no longer exists. I guess I can somehow work around the issue, and I suppose it's reasonable for Factorio to complain to me. However, this should not be causing a segfault!
Oh! Yeah, that would do it. Screenshots are not taken when the screenshot function is called. They are actually queued and then taken before the game engine starts the next game tick.
It has been like that since at least 0.12.x in my experience. You are also deleting the surface while your player character is still on that surface. That is another potential issue? In any case the game should not crash like that. :D Nice Find!

Looks like you are another person that could use this Modding interface request: 27196. Yeah Shameless plug. :P
Rseding91
Factorio Staff
Factorio Staff
Posts: 14341
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.15.6][posila] take_screenshot crashes for script.on_event

Post by Rseding91 »

credomane wrote:
Zulan wrote:I guess I figured out the issue in the current version: I do delete the surface immediately after taking the screenshot. Apparently the screenshot is now taken asynchronously so the referred surface no longer exists. I guess I can somehow work around the issue, and I suppose it's reasonable for Factorio to complain to me. However, this should not be causing a segfault!
Oh! Yeah, that would do it. Screenshots are not taken when the screenshot function is called. They are actually queued and then taken before the game engine starts the next game tick.
It has been like that since at least 0.12.x in my experience. You are also deleting the surface while your player character is still on that surface. That is another potential issue? In any case the game should not crash like that. :D Nice Find!

Looks like you are another person that could use this Modding interface request: 27196. Yeah Shameless plug. :P
Deleting chunks/surfaces the player is on shouldn't be any problem. Even for the screenshots. If I can get a mod that reproduces it every time then I can get it fixed - I think I already know what's wrong but I need a reliable way to reproduce it first.
If you want to get ahold of me I'm almost always on Discord.
credomane
Filter Inserter
Filter Inserter
Posts: 307
Joined: Tue Apr 12, 2016 6:21 pm
Contact:

Re: [0.15.11][posila] take_screenshot segfault on delted surface

Post by credomane »

Well I just copied the code OP gave in his/her most recent post into an addon and I managed to get the crash...exactly once. I could not get it to happen a second time. I changed literally nothing. *scratches head*
crashlog
Seems almost like a race condition to me. Which is faster rendering the screenshot or deleting the surface the screenshot needs? lol
Attachments
ScreenshotCrash_1.0.0.zip
(1.07 KiB) Downloaded 121 times
Zulan
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Mon Jan 25, 2016 5:55 pm
Contact:

Re: [0.15.11][posila] take_screenshot segfault on delted surface

Post by Zulan »

Attached is the simple mod to reproduce. However, oddly I also cannot reproduce it on my Linux installation. But there is something wrong with that anyway, but that is a topic for another thread. On Windows I was able to reproduce the crash very reliably.
Attachments
bug_0.0.1.zip
(1.09 KiB) Downloaded 126 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 14341
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.15.11][Rseding] take_screenshot segfault on delted surface

Post by Rseding91 »

Thanks for the log files. This should be fixed in the next version of 0.15. Note, calling take_screenshot and then deleting the surface in the same tick means the screenshot won't be done for that surface.
If you want to get ahold of me I'm almost always on Discord.
Zulan
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Mon Jan 25, 2016 5:55 pm
Contact:

Re: [0.15.11][Rseding] take_screenshot segfault on delted surface

Post by Zulan »

Rseding91 wrote:Thanks for the log files. This should be fixed in the next version of 0.15. Note, calling take_screenshot and then deleting the surface in the same tick means the screenshot won't be done for that surface.
Great! I understand that screenshots are taken asynchronously. Is there a recommendation how long I should wait before deleting the surface to make sure the screenshot matches?

Also what is the impact of these config settings:

Code: Select all

; screenshots-queue-size=10
; screenshots-threads-count=1
Looks like quite some sophistication to take screenshots ;)
posila
Factorio Staff
Factorio Staff
Posts: 5360
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.15.11][Rseding] take_screenshot segfault on delted surface

Post by posila »

Zulan wrote:Great! I understand that screenshots are taken asynchronously. Is there a recommendation how long I should wait before deleting the surface to make sure the screenshot matches?
Screenshots are taken on main thread (before game view preparation) after update is done. Problem is, the game may decide to do multiple updates before it does rendering, but in the single player rendering will be done after 5 updates at the latest. So waiting 5 ticks before deleting surface should give you pretty reliable results.
Zulan wrote:Also what is the impact of these config settings:
Only things that is done in parallel is png compression and saving to disk. Until the screenshot is saved, it is kept in the memory. Having lot of memory allocated for screenshots might cause issues, so you can limit how many screenshots are kept in memory before the game can't queue more, in which case it will stop updates until there is a room in the queue.
Post Reply

Return to “Resolved Problems and Bugs”