Page 1 of 2

Unexpected error occurred

Posted: Sun Dec 18, 2016 11:12 am
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 6003 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

Re: Unexpected error occurred

Posted: Sun Dec 18, 2016 11:59 am
by Loewchen
What version?
What are your hardware specs?
Have you tried restarting the computer?

Re: Unexpected error occurred

Posted: Sun Dec 18, 2016 12:39 pm
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.

Re: Unexpected error occurred

Posted: Sun Dec 18, 2016 2:41 pm
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.

Re: Unexpected error occurred

Posted: Sun Dec 18, 2016 3:12 pm
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.

Re: Unexpected error occurred

Posted: Sun Dec 18, 2016 3:17 pm
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.

Re: Unexpected error occurred

Posted: Sun Dec 18, 2016 3:46 pm
by lucius1
In the log file, there's nothing. literally nothing.
pic

Re: Unexpected error occurred

Posted: Sun Dec 18, 2016 5:50 pm
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.

Re: Unexpected error occurred

Posted: Mon Dec 19, 2016 5:36 am
by lucius1
I did what you said.

Re: Unexpected error occurred

Posted: Mon Dec 19, 2016 8:15 am
by posila
Thanks,
it seems Factorio crashes when system date is not between years 1970 and 3000. What date is set on your computer?

Re: Unexpected error occurred

Posted: Mon Dec 19, 2016 12:17 pm
by lucius1
My computer time is set on current time.

Re: Unexpected error occurred

Posted: Mon Dec 19, 2016 4:37 pm
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.

Re: Unexpected error occurred

Posted: Mon Dec 19, 2016 8:37 pm
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 5845 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 ;)

Re: Unexpected error occurred

Posted: Mon Dec 19, 2016 8:50 pm
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?

Re: Unexpected error occurred

Posted: Tue Dec 20, 2016 4:23 am
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.

Re: Unexpected error occurred

Posted: Tue Dec 20, 2016 11:09 am
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.

Re: Unexpected error occurred

Posted: Tue Dec 20, 2016 12:24 pm
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.

Re: Unexpected error occurred

Posted: Tue Dec 20, 2016 1:12 pm
by lucius1
Factorio runs! Thanks!

There may be a problem later, but it works!

Thanks once again!

Re: Unexpected error occurred

Posted: Tue Dec 20, 2016 3:48 pm
by Xeanoa
I just wanted to say that this thread was the funniest thing I read today.
Sorry for the spam.

Re: Unexpected error occurred

Posted: Tue Dec 20, 2016 4:13 pm
by Smarty
problem solved.

Moved to resolved problems and bugs