-
Notifications
You must be signed in to change notification settings - Fork 11
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
macOS crash unknown sockaddr #3
Comments
probably should only crash on shim errors in debug mode, and for release only log them |
there's a good chance the second one got fixed though |
second one still crash with current libc-shim, unknown macOS version |
Moving over from the referenced issue. I'm on 10.15.5. I've checked NG version 0.0.168 from https://github.com/ChristopherHX/osx-packaging-scripts/releases/tag/ng.dmg and confirmed that it does work, where the newer 0.0.175 does not. The last parts of the log probably don't help, but just in case it's useful:
... and then successfully shows the main menu. Logs from 0.0.175 at minecraft-linux/mcpelauncher-manifest#341 (comment) . Let me know if there's anything else I can do to help test / narrow down the issue. I have XCode and am an experienced Windows developer but I'm fairly new to MacOS and its tools and libraries. |
It would help if you could debug this line with gdb Line 106 in f07b952
Then provide us the value of in->sa_family .
src https://github.com/minecraft-linux/mcpelauncher-manifest/tree/ng
You could run it from a terminal
Debugging are more steps |
It seems to be diff --git a/src/network.cpp b/src/network.cpp
index e00207f..0ea906c 100644
--- a/src/network.cpp
+++ b/src/network.cpp
@@ -103,7 +103,11 @@ void bionic::from_host(const ::sockaddr *in, bionic::sockaddr *out) {
memcpy(((bionic::sockaddr_in6 *) out)->addr, ((::sockaddr_in6*) in)->sin6_addr.s6_addr, 16);
((bionic::sockaddr_in6 *) out)->scope = ((::sockaddr_in6*) in)->sin6_scope_id;
break;
- default: throw std::runtime_error("Unknown socket family when converting sockaddr from host");
+ case AF_LINK:
+ throw std::runtime_error("AF_LINK socket family when converting sockaddr from host");
+ default:
+ //std::cerr << "af_family " << (int)in->sa_family << std::endl;
+ throw std::runtime_error("Unknown socket family when converting sockaddr from host");
}
}
|
This crash appears to be triggered by 01d8ebb . If I go back to ab54671, it goes away. Looking at the commit and doing a little googling, it looks like this is indeed fixing things compared to the original implementation, so presumably this is one of those problem-hides-another-problem cases and reverting this commit probably isn't the fix! I will see if I can find any more, but I'm a bit in the dark as to what this code is all about ... any clues welcome |
Proper fix is to add AF_LINK to the translation layer, no? |
Yes, I think so. I will try it when I get a chance. I'm still learning my way around, so the little time I have for this doesn't progress me very fast! |
It wasn't that easy! PR #4 updated to ignore them, let me know what you think. |
I think found a problem, the loop is wrong for macOS |
Seems the correct way to do it is using
That's unexpected to be honest thanks for investigating it @ChristopherHX . |
Fix only filling the first ifreq entry of bionic's array Addresses parts of #3
Calling this method manually make it reproduceable for me, will add tests to this launcher soon. My dump of inet families of the ioctl
|
We might need to increase the storage for the host ifconf on macOS, because the list is so much longer than on Linux |
SOCKET_CGIFNETMASK oh got this part wrong only accept ipv4 for compatibility. SIOCGIFCONF also have to return only AF_INET and skip ipv6 etc.for binary compatibility to linux apps I will close this as fixed with the next release, no errors should happen after latest commits from today. |
Can't keep up. |
Has nothing to do with this issue, it is |
I would suggest skip copying unknown socket types to bionic and avoid a crash,
or better log them in debug mode.
cannot test myself, reported issues.
libc-shim/src/network.cpp
Line 310 in cdeba56
libc-shim/src/file_misc.cpp
Line 59 in cdeba56
The text was updated successfully, but these errors were encountered: