Unexpected error occurred

This subforum contains all the issues which we already resolved.
lucius1
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Dec 18, 2016 10:50 am
Contact:

Unexpected error occurred

Post by lucius1 »

I bought Factorio on Steam. I downloaded it, and clicked play button. But an error massage popped(
error window
error window
factorio_error.JPG (27.04 KiB) Viewed 5895 times
).
So I turned off the Steam Cloud use, tried game cache integrity check(it says all files are alright), and reinstalled over and over. But nothing worked.

There's no log file in the Factorio folder. Also, there isn't any word in the 'factorio-current.log', 'factorio-previous.log' in the appdata/roaming folder.

I bought this game yesterday but I couldn't play at all.


I hope I could play this game as quickly as possible

OS:window7

Loewchen
Global Moderator
Global Moderator
Posts: 8317
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Unexpected error occurred

Post by Loewchen »

What version?
What are your hardware specs?
Have you tried restarting the computer?

lucius1
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Dec 18, 2016 10:50 am
Contact:

Re: Unexpected error occurred

Post by lucius1 »

I think it's latest version.

CPU : Intel i5-3470 3.20GHz
RAM : 8GB
Graphic Card : Radeon HD7850 (and I'm using two monitors)
OS : Window7 64bit

Of course I restarted computer.

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Unexpected error occurred

Post by daniel34 »

lucius1 wrote:There's no log file in the Factorio folder. Also, there isn't any word in the 'factorio-current.log', 'factorio-previous.log' in the appdata/roaming folder.
Factorio creates a log file before it shows the error message you got, so there should be a factorio-current.log file somewhere. Try a computer-wide search by pressing Windows+F, then enter factorio-current in the search bar.

If that doesn't help then try deleting the whole %appdata%\Factorio (C:\Users\username\AppData\Roaming\Factorio) directory, then verify the steam cache again and then try to start the game.
quick links: log file | graphical issues | wiki

lucius1
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Dec 18, 2016 10:50 am
Contact:

Re: Unexpected error occurred

Post by lucius1 »

i can't play game still...

I found log file, so I tried to attach it. But web says the uploaded file is empty.

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Unexpected error occurred

Post by daniel34 »

Can you open the log file (with notepad or any other text editor) and just copy-paste the contents into your reply? Surround them with [code]log file contents[/code] tags if possible.
quick links: log file | graphical issues | wiki

lucius1
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Dec 18, 2016 10:50 am
Contact:

Re: Unexpected error occurred

Post by lucius1 »

In the log file, there's nothing. literally nothing.
pic

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

Re: Unexpected error occurred

Post by posila »

Hi, could you please download Process Explorer https://technet.microsoft.com/en-us/sys ... lorer.aspx and use it to create memory dump of Factorio process when the crash message pops up?

Just find Factorio process in Process Explorer, right click it, select Create Dump and then Create full dump. Save the .dmp file, zip it and upload it here, please.

lucius1
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Dec 18, 2016 10:50 am
Contact:

Re: Unexpected error occurred

Post by lucius1 »

I did what you said.
Attachments
factorio.zip
(38.17 MiB) Downloaded 133 times

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

Re: Unexpected error occurred

Post by posila »

Thanks,
it seems Factorio crashes when system date is not between years 1970 and 3000. What date is set on your computer?

lucius1
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Dec 18, 2016 10:50 am
Contact:

Re: Unexpected error occurred

Post by lucius1 »

My computer time is set on current time.

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

Re: Unexpected error occurred

Post by posila »

Accoding to the dump, function time() returned value that represents date about 400 years ago. I wanted to suggest you try to set the date 400 years into the future, but it is not possible on Windows :(
I didn't find any explanation why this would happen. Working theory is it is caused by issue with your HW or OS installation, but in that case I would expect other applications to crash too.

Try to set compatibility mode on factorio.exe

I am going to put sanity checks around this code, but it is possible it will crash later anyway in some other code that works with time.

In case other devs are interested in this. It crashes in logger inside strftime(), because localtime() returned nullptr, because "t" was -11644473600 (0xfffffffd49ef6f00)

Code: Select all

  time_t t = time(nullptr);
  char buffer[64];
  strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", localtime(&t));
EDIT: time() internally calls GetSystemTimePreciseAsFileTime() if available (should be available on Windows 8+) otherwise calls GetSystemTimeAsFileTime(). Then it subtracts _EPOCH_BIAS and divides result by 10000000. _EPOCH_BIAS is 116444736000000000 so that means GetSystemTimeAsFileTime() returned 0.

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Unexpected error occurred

Post by daniel34 »

posila wrote:it seems Factorio crashes when system date is not between years 1970 and 3000. What date is set on your computer?
my-brain-is-full-of-fuck.jpg
my-brain-is-full-of-fuck.jpg (73.66 KiB) Viewed 5737 times
posila wrote:Then it substructs _EPOCH_BIAS
I didn't know you were making up your own arithmetic operators, no wonder that Factorio is running so smooth with a dev team as dedicated as you ;)
quick links: log file | graphical issues | wiki

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

Re: Unexpected error occurred

Post by posila »

After deeper analysis of the memory dump I found out the game used GetSystemTimePreciseAsFileTime() from C:\Windows\System32\api-ms-win-core-sysinfo-l1-2-1.dll
As far as I could tell this DLL is either from Windows 8.1 or Windows 10 and you shouldn't have it on Windows 7.

Have you updated to Windows 10 and later decided to downgrade to Windows 7?
Have you installed Windows 8.1 SDK (or any other SDK for version of Windows higher than 7)? (If you don't know what Windows SDK is, you didn't)
Have you tried to install some application that required Windows 8/10 and downloaded DLLs it was reporting as missing?
Any other idea how it might have gotten onto your system?

lucius1
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Dec 18, 2016 10:50 am
Contact:

Re: Unexpected error occurred

Post by lucius1 »

I have used Windows 7 since I bought my computer. I bought my computer 5 years ago.
I haven't upgraded OS. I haven't touched windows OS files.
I don't have any knowledge about programming or coding.
What I know is just surfing the Internet, playing games, and watching movies....

I'm so stressed that I want to bring my computer to you to examine why Factorio crashes on my computer.
But I live in South Korea.

Anyway, thank you for trying to find the reason why Factorio doesn't run.
Please let me know if you find the reason.

Boogieman14
Filter Inserter
Filter Inserter
Posts: 770
Joined: Sun Sep 07, 2014 12:59 pm
Contact:

Re: Unexpected error occurred

Post by Boogieman14 »

lucius1 wrote: Please let me know if you find the reason.
The reason is basically in Posila's last post. This is very likely a problem with your Windows installation, not with Factorio. Microsoft has been extremely aggressive trying to push Windows 10 to all computers running 7 or 8. What I would guess is, Windows attempted to upgrade to Windows 10 (possibly without you even noticing, it has been that aggressive and sneaky), ran into some problem and reverted the upgrade but leaving your Windows 7 installation in a broken state. You'd probably be best off trying to find someone near you to help clean up your Windows installation, chances are you're going to run into more problems in the future.
I don't have OCD, I have CDO. It's the same, but with the letters in the correct order.

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

Re: Unexpected error occurred

Post by posila »

I am fairly confident deleting C:\Windows\System32\api-ms-win-core-sysinfo-l1-2-1.dll won't break your system and Factorio will start to work. But the application that installed the file onto your computer will not work (if that is how the file got there).

EDIT: Well, if you are going to try it, rather than deleting the file, move it to somewhere else, so it can be returned in case it is needed for something important.

lucius1
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sun Dec 18, 2016 10:50 am
Contact:

Re: Unexpected error occurred

Post by lucius1 »

Factorio runs! Thanks!

There may be a problem later, but it works!

Thanks once again!

Xeanoa
Fast Inserter
Fast Inserter
Posts: 190
Joined: Tue Apr 26, 2016 4:32 pm
Contact:

Re: Unexpected error occurred

Post by Xeanoa »

I just wanted to say that this thread was the funniest thing I read today.
Sorry for the spam.

User avatar
Smarty
Global Moderator
Global Moderator
Posts: 816
Joined: Sat Oct 04, 2014 5:00 pm
Contact:

Re: Unexpected error occurred

Post by Smarty »

problem solved.

Moved to resolved problems and bugs

Post Reply

Return to “Resolved Problems and Bugs”