On May 12, 6:53 pm, fadden <fad...@android.com> wrote:
> Are you including any of your own native code?  If not, this is likely
> a bug in the core libraries.

...and so it is.

OSNetworkSystem.java declares:

   static native InetAddress getHostByNameImpl(String addr,
           boolean preferIPv6Addresses) throws UnknownHostException;

That ends up here:

static jobject osNetworkSystem_getHostByNameImpl(JNIEnv* env, jclass
clazz,
       jstring nameStr, jboolean preferIPv6Addresses) {

which does this:

           jbyteArray addr = env->NewByteArray(4);
 ...
           return addr;

So, it's returning a byte array when an InetAddress object is
expected.

I'm not sure what a workaround would be.  For reference, here's the
stack trace (via a new extension to the "Check JNI" feature), using
the provided APK:

I/InetAddress( 2771): gethostbyaddr: getnameinfo: 192.168.1.4 =
192.168.1.4
W/dalvikvm( 2771): JNI WARNING: method declared to return 'Ljava/net/
InetAddress;' returned '[B'
W/dalvikvm( 2771):              failed in Lorg/apache/harmony/luni/
platform/OSNetworkSystem;.getHostByNameImpl
I/dalvikvm( 2771): "main" prio=5 tid=3 RUNNABLE
I/dalvikvm( 2771):   | group="main" sCount=0 dsCount=0 s=N
obj=0x40018e70
I/dalvikvm( 2771):   | sysTid=2771 nice=0 sched=0/0 handle=-1094144900
I/dalvikvm( 2771):   at
org.apache.harmony.luni.platform.OSNetworkSystem.getHostByNameImpl
(Native Method)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.platform.OSNetworkSystem.getHostByName
(OSNetworkSystem.java:389)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.net.PlainSocketImpl.socksGetServerAddress
(PlainSocketImpl.java:368)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.net.PlainSocketImpl.socksConnect
(PlainSocketImpl.java:380)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.net.PlainSocketImpl.connect
(PlainSocketImpl.java:224)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.net.PlainSocketImpl.connect
(PlainSocketImpl.java:521)
I/dalvikvm( 2771):   at java.net.Socket.connect(Socket.java:1019)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>
(HttpConnection.java:67)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager
$ConnectionPool.getHttpConnection(HttpConnectionManager.java:151)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager.getConnection
(HttpConnectionManager.java:79)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection
(HttpURLConnection.java:828)
I/dalvikvm( 2771):   at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect
(HttpURLConnection.java:800)
I/dalvikvm( 2771):   at com.test.socks.Socks5ProxyTest.onStart
(Socks5ProxyTest.java:103)
I/dalvikvm( 2771):   at android.app.Instrumentation.callActivityOnStart
(Instrumentation.java:1205)
I/dalvikvm( 2771):   at android.app.Activity.performStart
(Activity.java:3490)
I/dalvikvm( 2771):   at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2302)
I/dalvikvm( 2771):   at android.app.ActivityThread.handleLaunchActivity
(ActivityThread.java:2346)
I/dalvikvm( 2771):   at android.app.ActivityThread.access$1800
(ActivityThread.java:112)
I/dalvikvm( 2771):   at android.app.ActivityThread$H.handleMessage
(ActivityThread.java:1751)
I/dalvikvm( 2771):   at android.os.Handler.dispatchMessage
(Handler.java:99)
I/dalvikvm( 2771):   at android.os.Looper.loop(Looper.java:123)
I/dalvikvm( 2771):   at android.app.ActivityThread.main
(ActivityThread.java:4021)
I/dalvikvm( 2771):   at java.lang.reflect.Method.invokeNative(Native
Method)
I/dalvikvm( 2771):   at java.lang.reflect.Method.invoke(Method.java:
521)
I/dalvikvm( 2771):   at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:841)
I/dalvikvm( 2771):   at com.android.internal.os.ZygoteInit.main
(ZygoteInit.java:599)
I/dalvikvm( 2771):   at dalvik.system.NativeStart.main(Native Method)
I/dalvikvm( 2771):
E/dalvikvm( 2771): VM aborting

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to