Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6 failure #793

Closed
khonkhortisan opened this issue Jun 27, 2013 · 5 comments
Closed

IPv6 failure #793

khonkhortisan opened this issue Jun 27, 2013 · 5 comments
Labels
Bug Issues that were confirmed to be a bug @ Network
Milestone

Comments

@khonkhortisan
Copy link
Contributor

On any commit not earlier than f960c3b, I get this error

> minetest
terminate called after throwing an instance of 'SendFailedException'
  what():  Failed to send packet
Aborted
kyle@kylesbox:~/src/minetest> minetest --verbose
20:12:43: INFO[main]: Using system-wide paths (NOT RUN_IN_PLACE)
20:12:43: INFO[main]: path_share = /usr/local/share/minetest
20:12:43: INFO[main]: path_user  = /home/kyle/.minetest
20:12:43: INFO[main]: minetest with SER_FMT_VER_HIGHEST=25, VER=0.4.7 BUILD_TYPE=Debug RUN_IN_PLACE=0 USE_GETTEXT=1 USE_SOUND=1 STATIC_SHAREDIR=/usr/local/share/minetest
20:12:43: INFO[main]: logfile    = /home/kyle/.minetest/debug.txt
20:12:43: VERBOSE[main]: ItemDefManager: registering "default:stone"
20:12:43: VERBOSE[main]: registerNode: registering content id "0": name="default:stone"
20:12:43: VERBOSE[main]: ItemDefManager: registering "default:dirt_with_grass"
20:12:43: VERBOSE[main]: registerNode: registering content id "2048": name="default:dirt_with_grass"
20:12:43: VERBOSE[main]: ItemDefManager: registering "default:torch"
20:12:43: VERBOSE[main]: registerNode: registering content id "100": name="default:torch"
20:12:43: INFO[main]: run_tests() started
20:12:43: INFO[main]: Running TestUtilities
20:12:43: INFO[main]: Running TestSettings
20:12:43: INFO[main]: Running TestCompress
20:12:43: INFO[main]: str_out.size()=10
20:12:43: INFO[main]: TestCompress: 1,5,5,1 -> 0,0,0,4,0,1,1,5,0,1,
20:12:43: INFO[main]: decompress: 1,5,5,1,
20:12:43: INFO[main]: str_out.size()=12
20:12:43: INFO[main]: TestCompress: 1,5,5,1 -> 120,4294967196,99,100,101,101,4,0,0,34,0,13,
20:12:43: INFO[main]: decompress: 1,5,5,1,
20:12:43: INFO[main]: Test: Testing zlib wrappers with a large amount of pseudorandom data
20:12:43: INFO[main]: Test: Input size of large compressZlib is 50000
20:12:43: INFO[main]: Test: Output size of large compressZlib is 50026
20:12:43: INFO[main]: Test: Output size of large decompressZlib is 50000
20:12:43: INFO[main]: Running TestSerialization
20:12:43: INFO[main]: Running TestNodedefSerialization
20:12:43: VERBOSE[main]: Test ContentFeatures size: 310
20:12:43: INFO[main]: Running TestMapNode
20:12:43: INFO[main]: Running TestVoxelManipulator
20:12:43: INFO[main]: Result of diff:
20:12:43: INFO[main]: (-2,-2,-3)(3,2,-3)=6x5x1=30
20:12:43: INFO[main]: (3,-2,-2)(3,2,2)=1x5x5=25
20:12:43: INFO[main]: size: 0x0x0 offset: (1,1,1)
20:12:43: INFO[main]: *** Setting (-1,0,-1)=2 ***
20:12:43: INFO[main]: size: 1x1x1 offset: (-1,0,-1)
20:12:43: INFO[main]: X 
20:12:43: INFO[main]: *** Reading from inexistent (0,0,-1) ***
20:12:43: INFO[main]: size: 2x1x1 offset: (-1,0,-1)
20:12:43: INFO[main]: XI 
20:12:43: INFO[main]: *** Adding area ***
20:12:43: INFO[main]: size: 3x3x3 offset: (-1,-1,-1)
20:12:43: INFO[main]: ^     NNN NNN NNN 
20:12:43: INFO[main]: |     XIN NNN NNN 
20:12:43: INFO[main]: y x-> NNN NNN NNN 
20:12:43: INFO[main]: Running TestVoxelAlgorithms
20:12:43: INFO[main]: Running TestInventory
20:12:43: INFO[main]: Running TestCollision
20:12:43: INFO[main]: Running TestSocket
terminate called after throwing an instance of 'SendFailedException'
  what():  Failed to send packet
Aborted

Specifically, these last three lines - even if I add enable_ipv6/ipv6_server = false in minetest.conf.
So I can supposedly disable ipv6, but not the other effects of the commit.

@matttpt
Copy link
Contributor

matttpt commented Jun 27, 2013

What operating system are you running, and do you know if it supports IPv6? If you're running Linux, what is the output of running cat /proc/net/if_inet6? (The file may not exist: that's OK.)

The IPv6 patch doesn't check enable_ipv6 when running unit tests, so if your system doesn't support IPv6, the IPv6 socket test will fail, whether you've enabled IPv6 or not. Try this patch:

diff --git a/src/test.cpp b/src/test.cpp
index b66f65d..4825cc6 100644
--- a/src/test.cpp
+++ b/src/test.cpp
@@ -42,6 +42,7 @@
 #include "util/serialize.h"
 #include "noise.h" // PseudoRandom used for random data for compression
 #include "clientserver.h" // LATEST_PROTOCOL_VERSION
+#include "main.h" // for g_settings
 #include <algorithm>

 /*
@@ -1295,6 +1296,7 @@ struct TestSocket: public TestBase
                const int port = 30003;

                // IPv6 socket test
+               if(g_settings->getBool("enable_ipv6"))
                {
                        UDPSocket socket6(true);
                        socket6.Bind(port);

You can also try running Minetest with --disable-unittests.

@khonkhortisan
Copy link
Contributor Author

I'm using openSUSE 12.2 (x86_64). /proc/net/if_inet6 exists and is empty. I had to manually apply that patch. Both the patch and the argument allow minetest to continue running. But I shouldn't have to manually disable ipv6, it should fall back to ipv4 (or the test should be "non-blocking").

@matttpt
Copy link
Contributor

matttpt commented Jun 27, 2013

When IPv6 is enabled, Minetest uses the AF_UNSPEC flag to resolve addresses, roughly equating to "IPv4 or IPv6, whatever works." If IPv6 is not supported, it will never resolve an IPv6 address.

However, when connecting to the local server during singleplayer games, if enable_ipv6 and ipv6_server are true, Minetest will always try to connect to itself using IPv6, regardless of whether it's supported. That's a problem as well, along with the failing unit test.

I'll write a patch to detect IPv6 on startup and submit a pull request.

@ShadowNinja
Copy link
Member

Is this still an issue? There have been many changes to the networking and the patch is very outdated. You should be able to work around this by using --disable-unittests.

@ShadowNinja ShadowNinja changed the title ipv6 failure IPv6 failure Jun 20, 2014
@sapier
Copy link
Contributor

sapier commented Jun 20, 2014

ipv6 errors will not count as fatal any longer but only provide a error message in log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues that were confirmed to be a bug @ Network
Projects
None yet
Development

No branches or pull requests

4 participants