Page 1 of 1

[0.13.0] stol argument out of range (Crash)

Posted: Tue Jun 28, 2016 1:50 am
by Adefice
I'm getting a crash when trying to open the public server list. I get an error "stol argument out of range" (see enclosed screenshot). At this time multiplayer is impossible using the public list.

Steps before crash:
Installed v.13 and went to the multiplayer list to see if it worked. I made a Factorio account and the multiplayer list appeared correctly afterward. Exited the game to have dinner. Came back to try and play multiplayer and got this error. If I close the error, the game crashes to desktop.

Steps taken to fix:
Verify game cache, reinstalled, rolled back, rolled forward. Still crashing.

Screenshot:
Image

Code: Select all

Crash Log:
   0.001 2016-06-27 20:17:22; Factorio 0.13.0 (Build 22782, win64, steam)
   0.001 Operating system: Windows 7 Service Pack 1
   0.001 Program arguments: "C:\Program Files (x86)\Steam\steamapps\common\Factorio\bin\x64\Factorio.exe" 
   0.001 Read data path: C:/Program Files (x86)/Steam/steamapps/common/Factorio/data
   0.001 Write data path: C:/Users/Adefice/AppData/Roaming/Factorio
   0.001 Binaries path: C:/Program Files (x86)/Steam/steamapps/common/Factorio/bin
   0.015 Graphics options: [FullScreen: true] [VSync: false] [UIScale: 100%] [MultiSampling: OFF] [Graphics quality: normal] [Video memory usage: all] [Light scale: 100%] [Screen: 255] [DXT: false]
   0.016 Available display adapters: 1
   0.016  [0]: \\.\DISPLAY1 - NVIDIA GeForce GTX 970 {0x05, [0,0], 1920x1080, 32bit, 60Hz}
   0.016 Create display on adapter 0. Size 1280x720 at position [310, 162].
   0.064 Initialised Direct3D:[0] NVIDIA GeForce GTX 970; driver: nvd3dumx.dll 10.18.13.6839
   0.067     Video memory size (dedicated video/dedicated system/shared system/available): 4007/0/7907/3715 MB
   0.099 Desktop composition is active.
   0.161 Loading mod core 0.0.0 (data.lua)
   0.165 Loading mod base 0.13.0 (data.lua)
   0.255 Checksum for core: 1399339455
   0.255 Checksum for mod base: 2039900801
   0.687 Initial atlas bitmap size is 16384
   0.690 Created atlas bitmap 16384x9313
   1.043 Created atlas bitmap 4096x1104
   5.590 Sprites loaded
   5.590 Convert atlas 4096x1104 to: trilinear-filtering 
   5.867 Loading sounds...
   7.197 Custom inputs active: 0
   7.229 Factorio initialised
  12.057 Info WindowsUDPSocket.cpp:59: Opening socket at port (0)
  12.650 Error Util.cpp:57: stol argument out of range
  19.212 Info WindowsUDPSocket.cpp:159: Socket closed
  19.332 Steam API shutdown.
  19.333 Goodbye

[0.13.0] stol argument out of range (Error then CTD)

Posted: Tue Jun 28, 2016 3:05 pm
by Adefice
I'm getting a crash when trying to open the public server list. I get an error "stol argument out of range" (see enclosed screenshot). At this time multiplayer is impossible using the public list.

Steps before crash:
Installed v.13 and went to the multiplayer list to see if it worked. I made a Factorio account and the multiplayer list appeared correctly afterward. Exited the game to have dinner. Came back to try and play multiplayer and got this error. If I close the error, the game crashes to desktop.

Steps taken to fix:
Verify game cache, reinstalled, rolled back, rolled forward. Still crashing. However after a reinstall and the game prompting me to login to the Factorio servers again, I can sometimes browse an un-refreshed server listing...but any attempts to join are met with this crash. Not that it would do any good since the listing was old.

Screenshot:
Image

Log:

Code: Select all

Crash Log:
   0.001 2016-06-27 20:17:22; Factorio 0.13.0 (Build 22782, win64, steam)
   0.001 Operating system: Windows 7 Service Pack 1
   0.001 Program arguments: "C:\Program Files (x86)\Steam\steamapps\common\Factorio\bin\x64\Factorio.exe"
   0.001 Read data path: C:/Program Files (x86)/Steam/steamapps/common/Factorio/data
   0.001 Write data path: C:/Users/Adefice/AppData/Roaming/Factorio
   0.001 Binaries path: C:/Program Files (x86)/Steam/steamapps/common/Factorio/bin
   0.015 Graphics options: [FullScreen: true] [VSync: false] [UIScale: 100%] [MultiSampling: OFF] [Graphics quality: normal] [Video memory usage: all] [Light scale: 100%] [Screen: 255] [DXT: false]
   0.016 Available display adapters: 1
   0.016  [0]: \\.\DISPLAY1 - NVIDIA GeForce GTX 970 {0x05, [0,0], 1920x1080, 32bit, 60Hz}
   0.016 Create display on adapter 0. Size 1280x720 at position [310, 162].
   0.064 Initialised Direct3D:[0] NVIDIA GeForce GTX 970; driver: nvd3dumx.dll 10.18.13.6839
   0.067     Video memory size (dedicated video/dedicated system/shared system/available): 4007/0/7907/3715 MB
   0.099 Desktop composition is active.
   0.161 Loading mod core 0.0.0 (data.lua)
   0.165 Loading mod base 0.13.0 (data.lua)
   0.255 Checksum for core: 1399339455
   0.255 Checksum for mod base: 2039900801
   0.687 Initial atlas bitmap size is 16384
   0.690 Created atlas bitmap 16384x9313
   1.043 Created atlas bitmap 4096x1104
   5.590 Sprites loaded
   5.590 Convert atlas 4096x1104 to: trilinear-filtering 
   5.867 Loading sounds...
   7.197 Custom inputs active: 0
   7.229 Factorio initialised
  12.057 Info WindowsUDPSocket.cpp:59: Opening socket at port (0)
  12.650 Error Util.cpp:57: stol argument out of range
  19.212 Info WindowsUDPSocket.cpp:159: Socket closed
  19.332 Steam API shutdown.
  19.333 Goodbye

Re: [0.13.0] stol argument out of range (Error then CTD)

Posted: Tue Jun 28, 2016 5:43 pm
by Koub
[Koub] : Topics merged, because Copy-Paste in two different subforums.

Re: [0.13.0] stol argument out of range (Error then CTD)

Posted: Tue Jun 28, 2016 5:46 pm
by TruePikachu
I'll see if I can reproduce to get a good backtrace, as well as hook into stol() (assuming its symbol is in the PDB) to get the parameters being passed.

Re: [0.13.0] stol argument out of range (Error then CTD)

Posted: Tue Jun 28, 2016 6:03 pm
by Adefice
Koub wrote:[Koub] : Topics merged, because Copy-Paste in two different subforums.
Sorry, wasn't sure which one to post in...so I did both. :oops:

Re: [0.13.0] stol argument out of range (Error then CTD)

Posted: Tue Jun 28, 2016 6:06 pm
by Adefice
TruePikachu wrote:I'll see if I can reproduce to get a good backtrace, as well as hook into stol() (assuming its symbol is in the PDB) to get the parameters being passed.
Thank you kindly. I was wondering if its an issue with my computer (which is decent) or something new with the patch doesn't like me. Really sucks not being able to try multiplayer!

Re: [0.13.0] stol argument out of range (Error then CTD)

Posted: Tue Jun 28, 2016 6:12 pm
by TruePikachu
There is only one call to `std::stol` that I can find in the Steam binary:

Code: Select all

0:018> bm factorio!std::stol
  1: 00000001`3fbd1d77 @!"Factorio!std::stol" (Factorio!std::_String_val<std::_Simple_types<char> >::_Myptr inlined in Factorio!SteamContext::getUsersPlaying+0x177)
Are you using the Steam version, and if so, do any of your Friends have Factorio as well?

Re: [0.13.0] stol argument out of range (Error then CTD)

Posted: Tue Jun 28, 2016 6:22 pm
by Adefice
TruePikachu wrote:There is only one call to `std::stol` that I can find in the Steam binary:

Code: Select all

0:018> bm factorio!std::stol
  1: 00000001`3fbd1d77 @!"Factorio!std::stol" (Factorio!std::_String_val<std::_Simple_types<char> >::_Myptr inlined in Factorio!SteamContext::getUsersPlaying+0x177)
Are you using the Steam version, and if so, do any of your Friends have Factorio as well?
Yep, bought through Steam. No friends have the game (sadly...they should).

Re: [0.13.0] stol argument out of range (Error then CTD)

Posted: Tue Jun 28, 2016 7:03 pm
by TruePikachu
From what I can tell right now, the `stol` "call" (which is actually inlined) is only made if the 4th VCALL of the result of steam_api64.dll!SteamFriends() returns a value >0. I'm trying to figure out _what_ function that is, but it's early into SteamContext::getUsersPlaying()

EDIT: Appears to be related to Friends that are in Factorio. Please confirm if you have friends who own the game _for certain_ by clicking [url=steam://nav/games/details/427520]here[/url] to open Steam. EDIT: Appears to be GetFriendCount()

EDIT: Absolute worst case scenario (if a dev can't reproduce), if one changes six bytes at 0x612DF in the binary from `8D 0D 13 AE BA 00` to `89 D9 90 90 90 90`, the error message should theoretically change to instead be the string being passed into `stol`, the one which is causing the error to come up.

Re: [0.13.0] stol argument out of range (Error then CTD)

Posted: Tue Jun 28, 2016 7:45 pm
by Adefice
TruePikachu wrote:From what I can tell right now, the `stol` "call" (which is actually inlined) is only made if the 4th VCALL of the result of steam_api64.dll!SteamFriends() returns a value >0. I'm trying to figure out _what_ function that is, but it's early into SteamContext::getUsersPlaying()

EDIT: Appears to be related to Friends that are in Factorio. Please confirm if you have friends who own the game _for certain_ by clicking [url=steam://nav/games/details/427520]here[/url] to open Steam. EDIT: Appears to be GetFriendCount()

EDIT: Absolute worst case scenario (if a dev can't reproduce), if one changes six bytes at 0x612DF in the binary from `8D 0D 13 AE BA 00` to `89 D9 90 90 90 90`, the error message should theoretically change to instead be the string being passed into `stol`, the one which is causing the error to come up.
Ooook, sorry to puzzle you because my silly mind decided to ignore randos I've friended in the past as having the game. Yes 3 people in my friends list own Factorio apparently. Typically I set myself as "offline" in the friends list so there is no telling if they were playing at the time.

Based on your research, I guess the thing to figure out is how are they affecting my ability to open the server browser. Is it by them playing...or not playing? Or is it just that I have friends with Factorio? :shock:

Thank you for all your investigation...I'm really impressed.

Re: [0.13.0] stol argument out of range (Error then CTD)

Posted: Tue Jun 28, 2016 8:03 pm
by TruePikachu
Right now I'm still trying to figure things out, my current theory is that `SteamFriends()->some_unknown_function(...,"game_id")` (I have no idea what the function is, but I think it returns a game ID number (such as "427520" for Factorio) as a string corresponding to what game some friend is playing) is returning a string which is outside the range of what stol is supposed to be able to handle. This is odd, since no apps currently exist (to my knowledge) outside the LONG INT range enforced...

EDIT: I've reached the limits of what I'm able to investigate, since I can neither reproduce nor find an obvious cause with the information I have (lacking stuff like a full technical description of the Steam API). A developer will have to investigate further, and potentially authorize the use of the binary patch I described for debugging reasons.

Stol Argument Out of Range when i click browse multiplayer

Posted: Tue Jun 28, 2016 10:44 pm
by Zerowed
Anyone else getting this

Re: [0.13.0] stol argument out of range (Error then CTD)

Posted: Wed Jun 29, 2016 6:18 am
by Koub
[Koub] Yes. Topics merged.

Re: [0.13.0] stol argument out of range (Error then CTD)

Posted: Thu Jun 30, 2016 12:33 am
by Adefice
Just updated to 0.13.1 and opened the multiplayer browser. As before, it worked the first time. When I hit "Refresh" I get the "stol argument out of range" error which closes the game.

If I re-open Factorio, click the server browser, it immediately gives a "stol" error like before.

TL;DR: 0.13.1 the stol error is still present. Cannot use the server browser.

Re: [0.13.0] stol argument out of range (Error then CTD)

Posted: Thu Jun 30, 2016 1:34 am
by TruePikachu
To people confirming this, can you please list what games your Steam Friends, if any, were playing at the time? The error should be coming up in response to data received from Steam about games Friends are playing.

Re: [0.13.0] stol argument out of range (Error then CTD)

Posted: Thu Jun 30, 2016 1:50 am
by Adefice
TruePikachu wrote:To people confirming this, can you please list what games your Steam Friends, if any, were playing at the time? The error should be coming up in response to data received from Steam about games Friends are playing.
Ok, just tried and got another error. I have 3 friends online. They are each playing: Epic Battle Fantasy 4, Factorio :idea: , and Arma 3.

Re: [0.13.0] stol argument out of range (Error then CTD)

Posted: Thu Jun 30, 2016 12:37 pm
by Colossus
I got this last night, v13.1 - 8 friends were online, 2 were playing Factorio and 6 were Away. I wasn't able to browse (stol error), or even join a friend directly via steam. When attempting to click join friend, it produced another error, though I apologize that I can't recall it (I was just trying to play last night, not troubleshoot). It was something along the lines of a network error.

After installing the standalone version from Factorio.com I was able to Browse and Join fine.

Re: [0.13.0] stol argument out of range (Error then CTD)

Posted: Thu Jun 30, 2016 3:00 pm
by TruePikachu
This would only be a problem with the Steam version, and it currently appears to only surface when a Friend is playing Factorio. This probably means my suspicion about what that function does is incorrect.

If someone gets the error without a Friend playing Factorio, please indicate that. Friends with Factorio appears to be the common factor.

I'll write up a quick binary patch for 0.13.1 that changes the error message to the string causing the error message, since the 0.13.0 patch I wrote probably won't work now.

EDIT: At +0x617FF: 8D 0D F3 B9 BA 00 -> 89 D9 90 90 90 90

Re: [0.13.0] stol argument out of range (Error then CTD)

Posted: Thu Jun 30, 2016 6:45 pm
by miturion
I got the same problem (stol error) in 0.13.1

One friend was playing Factorio, other was playing Scrap mechanic.

Re: [0.13.0] stol argument out of range (Error then CTD)

Posted: Thu Jun 30, 2016 6:48 pm
by kovarex
I made possible fix of the problem, and it if happens next time (in 0.13.2) I will at least know more.