Addrinfo not working on alpine linux #4408

Open
Paxa opened this Issue Dec 23, 2016 · 1 comment

Projects

None yet

2 participants

@Paxa
Paxa commented Dec 23, 2016

Error caused by https://github.com/jruby/jruby/blob/a5bf7de68f81015f5149c806f68f944309e9c290/core/src/main/java/org/jruby/ext/socket/Addrinfo.java#L786

private Protocol protocol = Protocol.getProtocolByNumber(0);

Because getprotobyname_r not exists in musl lib.

Stack trace:

Dec 23, 2016 5:56:19 AM jnr.netdb.NativeProtocolsDB load
WARNING: Failed to load native protocols db
java.lang.UnsatisfiedLinkError: unknown
	at jnr.ffi.provider.jffi.AsmRuntime.newUnsatisifiedLinkError(AsmRuntime.java:40)
	at jnr.netdb.NativeProtocolsDB$LinuxLibProto$jnr$ffi$2.getprotobyname_r(Unknown Source)
	at jnr.netdb.NativeProtocolsDB$LinuxNativeProtocolsDB.getProtocolByName(NativeProtocolsDB.java:176)
	at jnr.netdb.NativeProtocolsDB.load(NativeProtocolsDB.java:80)
	at jnr.netdb.NativeProtocolsDB.access$000(NativeProtocolsDB.java:40)
	at jnr.netdb.NativeProtocolsDB$SingletonHolder.<clinit>(NativeProtocolsDB.java:47)
	at jnr.netdb.NativeProtocolsDB.getInstance(NativeProtocolsDB.java:43)
	at jnr.netdb.Protocol$ProtocolDBSingletonHolder.load(Protocol.java:107)
	at jnr.netdb.Protocol$ProtocolDBSingletonHolder.<clinit>(Protocol.java:103)
	at jnr.netdb.Protocol.getProtocolDB(Protocol.java:96)
	at jnr.netdb.Protocol.getProtocolByNumber(Protocol.java:59)
	at org.jruby.ext.socket.Addrinfo.<init>(Addrinfo.java:549)
	at org.jruby.ext.socket.SocketUtils$2.addrinfo(SocketUtils.java:273)
	at org.jruby.ext.socket.SocketUtils.buildAddrinfoList(SocketUtils.java:367)
	at org.jruby.ext.socket.SocketUtils.getaddrinfoList(SocketUtils.java:249)
	at org.jruby.ext.socket.Addrinfo.getaddrinfo(Addrinfo.java:217)
	at org.jruby.ext.socket.Addrinfo$INVOKER$s$0$0$getaddrinfo.call(Addrinfo$INVOKER$s$0$0$getaddrinfo.gen)
	at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:742)
@Paxa Paxa referenced this issue in jnr/jnr-netdb Dec 23, 2016
Open

Fails on alpine linux #4

@headius
Member
headius commented Jan 5, 2017

This is a jnr-netdb fix. We'll leave this open until we upgrade to a fixed version.

@headius headius added core ffi labels Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment