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

crash connecting to LAN game, "Unknown socket family when converting sockaddr to host" #145

Closed
michael-ts opened this issue Oct 22, 2020 · 10 comments
Labels
bug Something isn't working

Comments

@michael-ts
Copy link

Did older Launcher Versions work on this PC?

Yes. I'm trying to connect to my daughter's game running on our XBox One on the LAN via the "Friends" tab. This worked with launcher version 64.0.0.510 when used with Minecraft v 1.16.10.02, however this no longer works because the XBox One version updated to Minecraft v 1.16.40.02 and I'm not able to join if I don't have the same version running on my client.

I have tried 64.0.0.540, 580, 585, 590, and 592. Some of the earlier versions don't even support 1.16.40.02 while some of the in between ones seem to crash before I get to the point of trying to connect to a friend's game.

13:48:17 Trace [HybrisUtils] Loaded OS library libz.so.1
13:48:17 Trace [HybrisUtils] Loaded OS library libm.so.6
13:48:17 Trace [HybrisUtils] Loaded OS library /tmp/.mount_Minecr4ZoDaF/usr/share/mcpelauncher/lib/native/x86/libfmod.so.12.0
13:48:17 Info  [Launcher] Loading gamepad mappings
13:48:17 Trace [Launcher] Loading gamepad mappings: /tmp/.mount_Minecr4ZoDaF/usr/share/mcpelauncher/gamecontrollerdb.txt
13:48:17 Info  [Launcher] Creating window
13:48:17 Info  [Minecraft] android_main starting. internalDataPath is '../data/', externalDataPath is '../data/'
13:48:17 Info  [Minecraft] NO LOG FILE! - AppPlatform_android::setStorageDirectory - using External dir - CurrentFileStoragePath is now '/home/michael/.local/share/mcpelauncher/'
13:48:17 Warn  [Launcher] EGL stub eglMakeCurrent called
13:48:17 Warn  [Launcher] EGL stub eglMakeCurrent called
13:48:17 Warn  [Launcher] EGL stub eglMakeCurrent called
13:48:17 Warn  [Minecraft] NO LOG FILE! - [Device Lost] The graphics context was gained
13:48:17 Warn  [Minecraft] MinecraftGame::init && MinecraftGame::setSize!
13:48:17 Debug [HttpCallStaticGlue] Successfully registerered HttpCall methods
13:48:17 Debug [XboxLiveAppConfig] Successfully registerered XboxLiveAppConfig methods
13:48:17 Debug [XSAPI.Android] Successfully registerered HttpCall tcuiMethods
13:48:17 Debug [XSAPI.Android] Successfully registerered telemetryMethods
13:48:23 Info  [Minecraft] NO LOG FILE! - IPv4 supported, port: 57411
13:48:23 Info  [Minecraft] NO LOG FILE! - IPv6 supported, port: 44152
13:48:23 Info  [Minecraft] NO LOG FILE! - IPv4 supported, port: 46505
13:48:23 Info  [Minecraft] NO LOG FILE! - IPv6 supported, port: 59254
13:48:28 Info  [Minecraft] NO LOG FILE! - opening /home/michael/.local/share/mcpelauncher/minecraftpe/blob_cache
libc++abi: terminating with uncaught exception of type std::runtime_error: Unknown socket family when converting sockaddr to host
Signal 6 received
Backtrace elements: 14
#0 /tmp/.mount_Minecr4ZoDaF/usr/bin/./mcpelauncher-client32(_ZN12CrashHandler12handleSignalEiPv+0xf1) [0x87f47c1]
#1 linux-gate.so.1(__kernel_sigreturn+0) [0xf7f31090]
#2 linux-gate.so.1(__kernel_vsyscall+0x9) [0xf7f31079]
#3 /lib/i386-linux-gnu/libc.so.6(gsignal+0xc2) [0xf7462882]
#4 /lib/i386-linux-gnu/libc.so.6(abort+0x121) [0xf7463d11]
#5 /tmp/.mount_Minecr4ZoDaF/usr/bin/../lib32/libc++abi.so.1(+0x1f0c8) [0xf77500c8]
#6 /tmp/.mount_Minecr4ZoDaF/usr/bin/../lib32/libc++abi.so.1(+0x7e7e) [0xf7738e7e]
#7 /tmp/.mount_Minecr4ZoDaF/usr/bin/../lib32/libc++abi.so.1(+0x1e143) [0xf774f143]
#8 /tmp/.mount_Minecr4ZoDaF/usr/bin/../lib32/libc++abi.so.1(+0x215b7) [0xf77525b7]
#9 /tmp/.mount_Minecr4ZoDaF/usr/bin/../lib32/libc++abi.so.1(+0x21511) [0xf7752511]
#10 /tmp/.mount_Minecr4ZoDaF/usr/bin/./mcpelauncher-client32(_ZN4shim6bionic7to_hostEPKNS0_8sockaddrEP8sockaddr+0x110) [0x8872db0]
#11 /tmp/.mount_Minecr4ZoDaF/usr/bin/./mcpelauncher-client32(_ZN4shim6detail11sockaddr_inC2EPKNS_6bionic8sockaddrEj+0x86) [0x8874dd6]
#12 /tmp/.mount_Minecr4ZoDaF/usr/bin/./mcpelauncher-client32(_ZN4shim11getnameinfoEPKNS_6bionic8sockaddrEjPcjS4_jNS0_14nameinfo_flagsE+0x7f) [0x8873a8f]
#13 HYBRIS (null)+0xf2d3014c in /home/michael/.local/share/mcpelauncher/versions/1.16.40.02/lib/x86/libminecraftpe.so+0x0x3ef014c [0x0xf2d3014c]
Dumping stack...
#186 HYBRIS (null)+0xf002f4a8 in /home/michael/.local/share/mcpelauncher/versions/1.16.40.02/lib/x86/libminecraftpe.so+0x0x11ef4a8 [0x0xf002f4a8]
#213 HYBRIS (null)+0xf002f4a8 in /home/michael/.local/share/mcpelauncher/versions/1.16.40.02/lib/x86/libminecraftpe.so+0x0x11ef4a8 [0x0xf002f4a8]
#232 HYBRIS (null)+0xf0000000 in /home/michael/.local/share/mcpelauncher/versions/1.16.40.02/lib/x86/libminecraftpe.so+0x0x11c0000 [0x0xf0000000]
#753 HYBRIS (null)+0xf2d3014b in /home/michael/.local/share/mcpelauncher/versions/1.16.40.02/lib/x86/libminecraftpe.so+0x0x3ef014b [0x0xf2d3014b]
#765 HYBRIS (null)+0xf2d3014b in /home/michael/.local/share/mcpelauncher/versions/1.16.40.02/lib/x86/libminecraftpe.so+0x0x3ef014b [0x0xf2d3014b]
#779 HYBRIS (null)+0xf2d3014b in /home/michael/.local/share/mcpelauncher/versions/1.16.40.02/lib/x86/libminecraftpe.so+0x0x3ef014b [0x0xf2d3014b]

Process exited with unexpected exit code: 6

@ChristopherHX
Copy link
Owner

Thanks for the report.
Actually I need more information, maybe need to create a more verbose debug build.
I tried to reproduce this error with an android device as friend join host in my local wlan.
Thought I get no error, this will get more complicated to fix.
Similar to this one for macOS minecraft-linux/libc-shim#3 fixed after a long time.

I could technically remove this debug throw message, and return a failure to android
Can you test replacing
https://github.com/minecraft-linux/libc-shim/blob/master/src/network.cpp#L326-L331
with

#include <iostream>
int shim::getnameinfo(const bionic::sockaddr *addr, socklen_t addrlen, char *host, socklen_t hostlen,
        char *serv, socklen_t servlen, bionic::nameinfo_flags flags) {
    try {
        detail::sockaddr_in haddr (addr, addrlen);
        return ::getnameinfo(haddr.ptr(), haddr.len, host, hostlen, serv, servlen,
                bionic::to_host_nameinfo_flags(flags));
    } catch (std::runtime_error& error) {
        std::cerr << "Failed getnameinfo: " << error.what() << ", addr->family=" << addr->family << "\n";
        return 5 /*EAI_FAMILY*/;
    }
}

and upload the log even if it doesn't crash?, I won't push changes, I cannot verify.
https://github.com/minecraft-linux/libc-shim/blob/master/src/network.cpp#L328-L330
Basic how to compile it found here
minecraft-linux/libc-shim#3 (comment)

Also there is more missing for abi compatibility

/* Android ABI error: POSIX getnameinfo(3) uses socklen_t rather than size_t. */
int getnameinfo(const struct sockaddr* __sa, socklen_t __sa_length, char* __host, size_t __host_length, char* __service, size_t __service_length, int __flags);

Bionic has different error values of getnameinfo.

@michael-ts
Copy link
Author

@ChristopherHX

I'm having some issues with the commands at the link you provided.

git clone https://github.com/minecraft-linux/mcpelauncher-manifest --recursive -b ng
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug

I have to run cd mcpelauncher-manifest before I make the build directory, otherwise cmake complains about a missing CMakeLists.txt file.

make -j8 mcpelauncher-client

At this point I get the error make: *** No rule to make target 'mcpelauncher-client'. Stop.. I noticed that the build directory is empty so I ran cd .. and tried again. Now I get this message:

make: Nothing to be done for 'mcpelauncher-client'.

@ChristopherHX
Copy link
Owner

ChristopherHX commented Oct 22, 2020

If cmake .. -DCMAKE_BUILD_TYPE=Debug fails,
then make won't work.
You need the launcher dependencies of your distro to compile it.
e.g. Install the prerequirements of
https://mcpelauncher.readthedocs.io/en/latest/source_build/ui.html#prerequirements
https://mcpelauncher.readthedocs.io/en/latest/source_build/launcher.html#prerequirements (remove the :i386 of all packages, ng is x86_64 on x86_64 systems)
Download the x86_64 version of the game from the versionslist, or you need to add a lot of flags to cmake (-m32) and :i386 to all prerequirements, I have no idea if your pc supports the 64 bit version at all

@ChristopherHX
Copy link
Owner

ChristopherHX commented Oct 24, 2020

Do you have an amd cpu?
like the other reporter.
It just doesn't crash with my network setup on intel, even if I connect to a windows 10 edition. (I don't own the xbox edition)

Is something special with your network?
ipv6 network?
output of ip addr?
It just doesn't crash with my network setup on intel, even if I connect to a windows 10 edition.

My testing environment is limited, it even can be a memory corruption.

@michael-ts
Copy link
Author

Intel CPU, NVIDIA graphics. I will try disabling IPv6 when I get a chance today.

@michael-ts
Copy link
Author

Well I disabled IPv6. Before that, I noticed that sometimes the XBox could connect to a game running on my machine, but sometimes it would crash. After disabling IPv6 I haven't seen any crashes in that direction, but I also haven't been able to see the XBox game show up (no friends show up so I can't join anything).

@ChristopherHX
Copy link
Owner

Well
I get this error if I try to connect to a ipv6 ip, so I will fix it soon.

@ChristopherHX
Copy link
Owner

Is it fixed with 1.16.100 and latest flatpak now?

@michael-ts
Copy link
Author

@ChristopherHX I downloaded the 0.617 release and updated Minecraft to 1.16.101.01 and now I'm able to connect.

@ChristopherHX ChristopherHX removed the help wanted Extra attention is needed label Mar 10, 2021
@ChristopherHX
Copy link
Owner

I think we can close this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants