Page 1 of 1

Spring-dedicated crashes in windows 7

Posted: 29 Nov 2009, 23:48
by Jools
I have a problem with spring-decicated, which crashes when launched through spads in windows 7 64-bit, but works when launched the same way in windows xp.

Windows 7 displays a message (visual C++) that the runtime has requested to terminate the application in an unusual way.

Details:
[code]Problem signature:
Problem Event Name: APPCRASH
Application Name: spring-dedicated.exe
Application Version: 0.0.0.0
Application Timestamp: 4ae20e62
Fault Module Name: springserver.dll
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 4ae20e63
Exception Code: 40000015
Exception Offset: 000e0569
OS Version: 6.1.7100.2.0.0.256.1
Locale ID: 2057
Additional Information 1: b436
Additional Information 2: b436e38637e3c3bbe8bdc5f24e74756f
Additional Information 3: 004c
Additional Information 4: 004c67ed26dc3d94a9eceeddab9ba840
[/code]


Contents of infolog.txt:
[code]
LogOutput initialized.
Spring 0.80.5.1 (0.80.5.1-0-g57e49c6{@}-cmake-mingw32)
Available log subsystems: VFS-detail, VFS, ArchiveScanner,
Enabled log subsystems:
Enable or disable log subsystems using the LogSubsystems configuration key
or the SPRING_LOG_SUBSYSTEMS environment variable (both comma separated).
default config file: C:\Users\<user>\AppData\Local\springsettings.cfg
Using read-write data directory: E:\Program Files\Spring\
Using read-only data directory: C:\Users\<user>\Documents\My Games\Spring\
Scanning: C:\Users\<user>\Documents\My Games\Spring\maps
Scanning: C:\Users\<user>\Documents\My Games\Spring\base
Scanning: C:\Users\<user>\Documents\My Games\Spring\mods
Scanning: C:\Users\<user>\Documents\My Games\Spring\packages
Scanning: E:\Program Files\Spring\maps
Scanning: E:\Program Files\Spring\base
Scanning: E:\Program Files\Spring\mods
Scanning: E:\Program Files\Spring\packages
[/code]


Hmm, it says spring v. 0.80.5.1, and I know the latest one is 0.80.5.2. However, I can't find any copy of the dedicated for 0.80.5.2 right now.

Re: Spring-dedicated crashes in windows 7

Posted: 02 Dec 2009, 00:30
by Acreo Aeneas
Would you happen to be running SpringLobby version 0.39?

I had the exact same error message occur when I manually updated SpringLobby from 0.35 to 0.39. Reverting back to 0.35 solved that error. Alternatively, 0.40 doesn't cause that error either. However, 0.36 will cause SpringLobby.exe to lock up and fail to properly terminate when you close the window.

Additionally, make sure the SpringLobby.exe file in your Spring install is unblocked (right-click > Properties > Unblock > Apply > OK).

Re: Spring-dedicated crashes in windows 7

Posted: 02 Dec 2009, 11:43
by Jools
No, I run it with the spads autohost, but the error is in spring-dedicated.exe, because if I lauch it from the command line like this:

Code: Select all

spring-dedicated.exe F:\games\spads\var\startscript.txt
Then I get the same error. I even tried compatibility mode for windows xp sp2, still same error.

Here is the startscript: http://pastebin.com/m45a1e6e7

Re: Spring-dedicated crashes in windows 7

Posted: 15 Dec 2009, 15:34
by bibim
Jools wrote:if I lauch it from the command line like this:

Code: Select all

spring-dedicated.exe F:\games\spads\var\startscript.txt
Then I get the same error.
Where did you launch it from, SPADS installation directory or Spring installation directory ?

If you tried from SPADS installation directory only, can you try copying spring-dedicated.exe and springserver.dll files from your SPADS directory to your Spring directory, and launch spring-dedicated from your Spring directory ?

I guess there is some DLL dependency scanner such as this one on Windows 7 ? Can you check spring-dedicated.exe and springserver.dll dependencies with such a tool (from your Spring installation directory) ?

Re: Spring-dedicated crashes in windows 7

Posted: 15 Dec 2009, 15:44
by Auswaschbar
"terminated in an unusual way" is windows speak for uncaught exception.
The stdout from spring-dedicated would help to identify this error, as the exception message is printed there.

Re: Spring-dedicated crashes in windows 7

Posted: 15 Dec 2009, 16:04
by bibim
Auswaschbar wrote:"terminated in an unusual way" is windows speak for uncaught exception.
Yes, however I remember having the exact same behaviour when launching spring-dedicated.exe with a missing dependency, and nothing was printed in stdout.
Auswaschbar wrote:The stdout from spring-dedicated would help to identify this error, as the exception message is printed there.
Actually I had already asked Jools to check the spring-dedicated.log file in which SPADS redirects spring-dedicated.exe output, and IIRC it was empty. However, now you speak about it I don't think I had asked him to check the stdout.txt and stderr.txt files, which are now used by spring-dedicated.exe instead of STDOUT and STDERR streams.

Re: Spring-dedicated crashes in windows 7

Posted: 15 Dec 2009, 16:07
by Auswaschbar
bibim wrote:stdout.txt and stderr.txt files, which are now used by spring-dedicated.exe instead of STDOUT and STDERR streams.
Wait, what?

Re: Spring-dedicated crashes in windows 7

Posted: 15 Dec 2009, 16:12
by bibim
On Windows, it seems spring-dedicated no longer writes its outputs in STDOUT/STDERR streams (even if it is redirected with '>' and '2>'). Instead, it writes the stdout.txt and stderr.txt files in current directory. I think it is related to commit ec3e525a (possible explanation ?)

Re: Spring-dedicated crashes in windows 7

Posted: 15 Dec 2009, 21:32
by Peet
I have noticed that with my own SDL programs as well..it's pretty irritating. #undef main at the start of the file with main() in it fixed it for me; I also believe that the current unstable version of SDL no longer has that irritating iostream-redirecting behaviour.

Re: Spring-dedicated crashes in windows 7

Posted: 01 Jan 2010, 04:44
by Jools
bibim wrote:Actually I had already asked Jools to check the spring-dedicated.log file in which SPADS redirects spring-dedicated.exe output, and IIRC it was empty. However, now you speak about it I don't think I had asked him to check the stdout.txt and stderr.txt files, which are now used by spring-dedicated.exe instead of STDOUT and STDERR streams.
Bibim is correct, that file is empty. However, the stderr.txt in the spads directory contains the following:
[code]terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >'
what(): An existing connection was forcibly closed by the remote host[/code]


The stdout.txt doesnt contain anything useful to me, but here it is too:

Code: Select all

If you find any errors, report them to mantis or the forums.

default config file: C:\Users\<user>\AppData\Local\springsettings.cfg
LogOutput initialized.
Spring 0.80.5.1 (0.80.5.1-0-g57e49c6{@}-cmake-mingw32)
Available log subsystems: VFS-detail, VFS, ArchiveScanner, 
Enabled log subsystems: 
Enable or disable log subsystems using the LogSubsystems configuration key
  or the SPRING_LOG_SUBSYSTEMS environment variable (both comma separated).
Using read-write data directory: E:\Program Files\Spring\
Using read-only  data directory: F:\Games\spads\
Using read-only  data directory: C:\Users\<user>\Documents\My Games\Spring\
Scanning: C:\Users\<user>\Documents\My Games\Spring\maps
Scanning: C:\Users\<user>\Documents\My Games\Spring\base
Scanning: C:\Users\<user>\Documents\My Games\Spring\mods
Scanning: C:\Users\<user>\Documents\My Games\Spring\packages
Scanning: F:\Games\spads\maps
Scanning: F:\Games\spads\base
Scanning: F:\Games\spads\mods
Scanning: F:\Games\spads\packages
Scanning: E:\Program Files\Spring\maps
Scanning: E:\Program Files\Spring\base
Scanning: E:\Program Files\Spring\mods
Scanning: E:\Program Files\Spring\packages
Loading script from file: F:\Games\spads\var/startscript.txt
Starting server...
Connecting to autohost on port 8454
Server started on port 8452

I will try tomorrow with the dependency thing too...

Re: Spring-dedicated crashes in windows 7

Posted: 01 Jan 2010, 19:38
by bibim
Jools wrote:the stderr.txt in the spads directory contains the following:

Code: Select all

terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >'
  what():  An existing connection was forcibly closed by the remote host
Can you try to remove the "AutohostPort=xxxx;" line from your start script and relaunch spring-dedicated to see if it works ?
Jools wrote:I will try tomorrow with the dependency thing too...
Actually I don't think you need to check the dependencies, since the problem is very likely due to this connection problem.

Re: Spring-dedicated crashes in windows 7

Posted: 04 Jan 2010, 20:01
by Jools
Just to write that this issue is fixed now, bibim has made a new version of the autohost that disables ipv6, if I understood it correctly, and this works on windows 7. There was also one more issue in widnows 7, it was set to resolve to localhost name by dns, whereas this should be set in a hosts file in windows to resolve manually.

Re: Spring-dedicated crashes in windows 7

Posted: 13 Feb 2010, 15:38
by bibim
Jools wrote:bibim has made a new version of the autohost that disables ipv6
Actually I patched spring-dedicated to disable ipv6, not SPADS.

Re: Spring-dedicated crashes in windows 7

Posted: 05 Jan 2011, 19:14
by marciolino
Hi all,

I am not sure to really understand the solution to this problem but I installed spads now and I am still having this problem when I launch the hosted game:
Starting server...
Binding UDP socket to IP (v6) :: Port 8452
[UDPListener] succesfully bound socket on port 8452
Connecting to autohost on port 8454
Server started on port 8452
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >'
what(): An existing connection was forcibly closed by the remote host
Someone can help me plz?

Re: Spring-dedicated crashes in windows 7

Posted: 05 Jan 2011, 19:23
by abma
try to set

hostIP=0.0.0.0

Re: Spring-dedicated crashes in windows 7

Posted: 05 Jan 2011, 19:31
by marciolino
abma wrote:try to set

hostIP=0.0.0.0
In my spads.conf? You mean localLanIp:?

Re: Spring-dedicated crashes in windows 7

Posted: 05 Jan 2011, 19:55
by abma
damn, found that:

http://springrts.com/phpbb/viewtopic.ph ... 4&p=450796

maybe disable ipv6?

Re: Spring-dedicated crashes in windows 7

Posted: 05 Jan 2011, 20:06
by hoijui
as it is now, IPv4 is used if you specify an IPv4 address, which includes 0.0.0.0 (IPv6 equivalent is ::) and 127.0.0.1.

Re: Spring-dedicated crashes in windows 7

Posted: 05 Jan 2011, 21:15
by bibim
hoijui wrote:as it is now, IPv4 is used if you specify an IPv4 address, which includes 0.0.0.0 (IPv6 equivalent is ::) and 127.0.0.1.
It doesn't seem to be so for the AutoHost interface (AutohostIP parameter in startscript).

Sample of rts/System/AutohostInterface.cpp:

Code: Select all

using namespace boost::asio;
AutohostInterface::AutohostInterface(const std::string& autohostip, int remoteport) : autohost(netcode::netservice)
{
	boost::system::error_code err;
	autohost.open(ip::udp::v6(), err); // test v6

	if (!err) {
		autohost.bind(ip::udp::endpoint(ip::address_v6::any(), 0));
	} else {
		LogObject() << "[AutohostInterface] IPv6 not supported, falling back to v4";
		autohost.open(ip::udp::v4());
		autohost.bind(ip::udp::endpoint(ip::address_v4::any(), 0));
	}

	boost::asio::socket_base::non_blocking_io command(true);
	autohost.io_control(command);

	std::string connectErrorMsg;

	try {
		boost::system::error_code connectError;
		autohost.connect(netcode::ResolveAddr(autohostip, remoteport), connectError);

		if (connectError) {
			connectErrorMsg = connectError.message();
			autohost.close();
		}
	} catch (boost::system::system_error& e) {
		connectErrorMsg = e.what();
		autohost.close();
	}

	if (!autohost.is_open()) {
		LogObject() << "could not open autohost socket: " << connectErrorMsg;
	}
}

Re: Spring-dedicated crashes in windows 7

Posted: 06 Jan 2011, 12:18
by hoijui
true that... thanks bibim, nice reference :-)
having a look at that code.