[posila] [0.17.74] Crash: "fonsDrawText"

This subforum contains all the issues which we already resolved.
Post Reply
AntiElitz
Filter Inserter
Filter Inserter
Posts: 446
Joined: Sat Aug 29, 2015 11:37 pm
Contact:

[posila] [0.17.74] Crash: "fonsDrawText"

Post by AntiElitz »

Game crashed while running just 15 minutes into a map (no action was done): maybe related since there was no reinstall viewtopic.php?f=35&t=77257
Attachments
factorio-current.log
(9.24 KiB) Downloaded 56 times
factorio-dump-current.dmp
(1.09 MiB) Downloaded 33 times

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2250
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [0.17.74] Crash: "fonsDrawText"

Post by boskid »

It should not be even possible to crash here: array with 400 elements is indexed with value of character (byte, cannot exceed 255) that in this case was equal to 48 (character '0'). Only explanation is some earlier instruction that loads address of this (static) table somehow got corrupted in memory.

Please check your memory with memtest86

posila
Factorio Staff
Factorio Staff
Posts: 5202
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.17.74] Crash: "fonsDrawText"

Post by posila »

So this one is stranger than the previous one, definitiely worth some deeper investigation.

1) We have somewhat large number of crashes attributed to this line (not in 0.17.74 yet, but in 0.17.69 there was 140 crashes attributed to the same line - which is still less than number of cheat-engine induced crashes, but still a lot)

2) When you crashed, the instruction pointer was set to middle of an instruction, which essentially corrupted the instruction stream and CPU started executing nonsense (in this case it changed which registers were used to calculate source address of memory read, resulting in invalid memory access).

3) Not all the crashes look the same, some of them have bad instruction pointer like yours, others index in the array boskid mentioned with large value (i.e. 0xFFFFFFFF)

The only reason I can think of this happening is a buffer underflow happening somewhere in functions that fonsDrawText() calls, modifing return address pointer, so when a function is returning to fonsDrawText() it returns to wrong instruction address, which sometimes happens to be aligned to instruction correctly, but has wrong register content.

AntiElitz
Filter Inserter
Filter Inserter
Posts: 446
Joined: Sat Aug 29, 2015 11:37 pm
Contact:

Re: [0.17.74] Crash: "fonsDrawText"

Post by AntiElitz »

I have downloaded a clean install of Factorio after this crash and didn't get another one ever since. Since I updated this very instance from 17.0 to 17.74 with every single update out there, there may also be the possibility of file corruption or an failed patch that caused the crashes.
Ofc i cannot say for sure it is fixed yet, since this didn't happen regularly. However just in case, i may send you my complete game folder if this helps you guys out.

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

Re: [0.17.74] Crash: "fonsDrawText"

Post by Bilka »

AntilElite wrote:@Bilka never in my live I have been able to login on mobile on the Factorio Website. Since I'm not at home right now, may you add to my latest bug report that I ran memteat86 twice for 2,5 h each and did not get any errors? Would be appreciated!
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

posila
Factorio Staff
Factorio Staff
Posts: 5202
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.17.74] Crash: "fonsDrawText"

Post by posila »

I've updated one of the underlying font libraries; the library had fixed a bug in its internal memory pool, and we were still using the buggy version. I am not sure if "fonsDrawText" were caused by the bug (I hope they were), so I'd like to still investigate deeper, but before I do, we just might end up releasing next version and then we'll see if number of these crashes dropped off or not.

As for redownloading the game - in-game updater would have failed if checksum of any of the files would be wrong, so corruption would have to happen during or after update from 0.17.73 to 0.17.74. Also I don't think your executable was corrupted as the code it crashed in is being executed several times per frame.
(When you reported the previous crash and it turned out to be memory corruption, I expected you might have another crash caused by memory corruption soon after, because randomness is funny this way often times; but I don't think this one was memory corruption)

posila
Factorio Staff
Factorio Staff
Posts: 5202
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [posila] [0.17.74] Crash: "fonsDrawText"

Post by posila »

Since 0.17.76 there have not been single case of this crash, so it seems updating the font library fixed this.
Thanks for the report.

Post Reply

Return to “Resolved Problems and Bugs”