Dalvik VM init failed (check log file)

by an...@android » Tue, 24 Mar 2009 15:09:04 GMT


Sponsored Links
 Hi All,

I'm trying to port dalvik VM onto PPC.
I could able to build 'dalvikvm' binary and the respective 'jar' files
that are needed for the execution of 'dalvikvm'('core.jar' ,
'ext.jar','framework.jar',android.policy.jar' and 'services.jar')

To test dalvikvm i followed the following steps:-

1:
 export LD_LIBRARY_PATH=/home/cupcake/out/debug/target/product/eee_701/
system/lib
2:
 export ANDROID_ROOT=/home/cupcake/out/debug/target/product/eee_701/
system
3:
 export BOOTCLASSPATH=/home/cupcake/out/debug/target/product/eee_701/
systemframework/core.jar:/home/cupcake/out/debug/target/product/
eee_701/system/framework/ext.jar:/home/cupcake/out/debug/target/
product/eee_701/system/framework/framework.jar
4:
 export ANDROID_DATA=/tmp/dalvik_$USER
 mkdir -p $ANDROID_DATA/dalvik-cache
5:
  $cat Foo.java
 public class Foo {
 public static void main(String[] args) {
 System.out.println("Hello, world");
 }
 }

 $javac Foo.java
 $dx --dex --output=foo.jar Foo.class
6:
 $./dalvikvm -cp foo.jar Foo


For the first execution of 'dalvikvm' I got segmentation fault.
On debugging in gdb I found where it was crashing.
To fix it I made modification in the following file
'dalvik/vm/mterp/common/asm-constants.h'
Line No :186

ORIGINAL->  MTERP_OFFSET(offArrayObject_contents,   ArrayObject,
contents, 12)
MODIFIED->  MTERP_OFFSET(offArrayObject_contents,   ArrayObject,
contents, 16)

Reason:-
'contents' member in ArrayObject structure is a 64-bit entity and
there are three 32-bit entities above it.
For satisfying 64-bit alignment 'contents' member should start at 16
byte offset rather than 12 byte.

After making the above change, I followed the same steps to execute
dalvikvm,
but this time i didnt get the seg fault but one message came up saying
"Dalvik VM init failed (check log file)".

On debugging in gdb I found the error line to be at
system/core/libcutils/ashmem-dev.c:60    ret = ioctl(fd,
ASHMEM_SET_SIZE, size)
; -- with errno set to -ENOTTY.

I really need help on this to go ahead

Thanks in advance
Anand






--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Dalvik VM init failed (check log file)

by fadden » Tue, 24 Mar 2009 23:05:33 GMT


 


See MTERP_NO_UNALIGN_64 in the current version:

 http://android.git.kernel.org/?p=platform/dalvik.git ;a=blob;f=vm/mterp/common/asm-constants.h;h=73292a9f2a5863fe55b3d524695f245388ad1780;hb=HEAD


The log file will usually provide some useful info.  Do you have /dev/
log working?


Do you have the ashmem driver working?

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---


Sponsored Links


Dalvik VM init failed (check log file)

by Anand Android » Thu, 26 Mar 2009 16:31:33 GMT


 Hi fadden , thanks for the reply.

i have fixed 'ashmem' issue and am able to proceed till 'dexopt' tries to
optimize the jar file,which is failing with following error.
-------------
DexOpt:  locked cache file
DexOpt: successfully initialized new cache file
DexOpt: --- BEGIN 'core.jar' (bootstrap=1) ---
DexOpt: waiting for verify+opt, pid=2460
Continuing optimization
(/home/cupcake/out/debug/target/product/eee_701/system/framework/core.jar,
isb=1, vfy=1, opt=1)
+++ swapping bytes
DexOpt: --- END 'core.jar' --- status=0xff00, process failed
Unable to extract+optimize DEX from
'/home/cupcake/out/debug/target/product/eee_701/system/framework/core.jar'
--------------

On debugging i found it is failing at
'~/cupcake/dalvik/libdex/DexSwapVerify.c:2084' where 'swapMap()' function is
failing.


Thanks in advance
Ananda









--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Dalvik VM init failed (check log file)

by fadden » Thu, 26 Mar 2009 23:26:06 GMT


 

[...]

It should log a specific failure message when something goes wrong.
Line 2084 looks like it's scrounging around in annotations; I think
maybe it should have a LOGE:

    while (size--) {
        data = verifyEncodedValue(state, data, crossVerify);
        if (data == NULL) {
            LOGE("Bogus encoded_array value\n");
            return NULL;
        }
    }

If you've got the latest cupcake you should have the checksum
verification enabled (around line 2767), which should ensure that
you're not reading a corrupt file.

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Dalvik VM init failed (check log file)

by Anand Android » Mon, 30 Mar 2009 15:58:00 GMT


 hi Fadden,
thanks for the reply
I am able to proceed swapMap() function by fixing an endian issue in that
function.
Fix: pMap->size has to be converted to big-endian before assigning it to
count variable.

Now I have another issue in crossVerifyEverything() with
"kDexTypeClassDefItem" switch-case. It is becoming increasingly difficult to
debug this as this is tightly coupled to dex file-format. I hope I can get
some pointers into fixing this issue.

Thanks
Anand






--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Dalvik VM init failed (check log file)

by fadden » Mon, 30 Mar 2009 19:26:50 GMT


 


Aha, something like:

365c365
<     u4 count = pMap->size;
---
370a371,373



Once upon a time the code ran on a big-endian PPC system, but the swap
& verify code got rewritten after we moved away from PPC hardware.

If it helps any, the DEX format is described in dalvik/docs/dex-
format.html.

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Dalvik VM init failed (check log file)

by Anand Android » Tue, 31 Mar 2009 06:52:01 GMT


 hi fadden,
yes that is exactly what i have done to fix problem in 'swapMap()' function.

is the version source tree that ran on ppc still available ?
if so,is it advisable to use it now and can you point me to that source tree ?

thanks
Anand






--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Dalvik VM init failed (check log file)

by fadden » Wed, 01 Apr 2009 17:18:37 GMT


 


Looking at the perforce history, the axe was dropped on PPC support in
June 2007.

So, no. :-|

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Dalvik VM init failed (check log file)

by dj » Thu, 09 Apr 2009 15:11:12 GMT


 




hi fadden
        i am also working on same environmnt and stuck in running
dalvikvm on my ppc64 linux m/c
        Following is the issue that am currently facing

        while debugging in gdb i found that
        from the file dalvik/vm/oo/Object.h line 797
        in the below function clazz->status contains  CLASS_VERIFYING
instead of CLASS_VERIFIED

INLINE bool dvmIsClassVerified(const ClassObject* clazz) {
     return clazz->status >= CLASS_VERIFIED;
 }
thats why returnig false from this function in casuses dvmabort() to
fail at following location

0x0feacd38 in dvmAbort () at dalvik/vm/Init.c:1433
1433        *((char*)0xdeadd00d) = 38;
 and here i am getting seg fault .
are you having any idea about this ,how to get rid of this problem?
please reply............
thanks in advance.

regards
DJ

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Dalvik VM init failed (check log file)

by fadden » Fri, 10 Apr 2009 01:17:05 GMT


 


The VM calls dvmAbort() if it encounters a problem that it can't deal
with.  The store to 0xdeadd00d is expected to crash the process.

The log file will have an indication of what went wrong.

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Dalvik VM init failed (check log file)

by Dhananjay Joshi » Fri, 10 Apr 2009 14:27:11 GMT


 



Hi fadden
               Actually i dont know how to check messages in /dev/log
directory?
               For that we need to write socket program ?
               can you please throw a light on this?


regards,
DJ

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Dalvik VM init failed (check log file)

by fadden » Sat, 11 Apr 2009 01:03:08 GMT


 On Apr 9, 11:26pm, Dhananjay Joshi <dhananjayingr...@gmail.com>




The "logcat" command will read and display messages from the log
devices.

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Dalvik VM init failed (check log file)

by Dhananjay Joshi » Mon, 13 Apr 2009 12:37:56 GMT


 



               The "logcat" command will read and display messages from the
log
devices.

as i have android kernel running on my ppc64 m/c , on top of that am trying
to run dalvikvm executable , how can i run logcat command from shell?
as it is not recognising dalvikvm's internal command.

regards,
DJ

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Dalvik VM init failed (check log file)

by Dhananjay Joshi » Mon, 13 Apr 2009 13:48:50 GMT


 On Mon, Apr 13, 2009 at 10:07 AM, Dhananjay Joshi <






also when i tried running logcat binary from command line i am getting this
error

Unable to open log device '/dev/log/main'

do you know what is this talking about ?

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Dalvik VM init failed (check log file)

by Avtar Singh » Mon, 13 Apr 2009 14:02:52 GMT


 > as i have android kernel running on my ppc64 m/c , on top of that am trying

Do you see the shell prompt? Type in "logcat" at the shell prompt.




Did you rebuild kernel by switching off the log driver in kernel
configuration file? You need to have that driver enabled.

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Other Threads

1. Regarding coding standards for GPL license device drivers code

Hi,

I have question regarding coding standards for drivers. I know that
kernel code follows the coding standard
defined by Kernelsrc/Documentation/CodingStyle.

But if we have to release the code (drivers) under GPL license, Does
GPL License forces the coding styles as per
Kernelsrc/Documentation/CodingStyle?

Regards
Raj

-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: 

2. java.net.UnknownHostException: Host is unresolved

Greetings all,
I'm writing a remote control app for a touchscreen jukebox pc. My jukebox
has an http control mechanism where you pass commands to it like so:
http://192.168.1.2:6969?playlist (returns JSON encoded playlist)

In my android app, I'm using httpGet to connect to the jukebox server,
however when I try to connect, it throws an IOException and the log shows:
06-29 18:03:52.579: WARN/System.err(5348): java.net.UnknownHostException:
Host is unresolved: http://192.168.1.2:6969

I'm running the app on my actual phone, not on the emulator, and I am
connected to my wifi, so I decided to test with http://www.google.com, and I
get the same "Host is unresolved" result.
I CAN, however, connect to both url's using the browser on the phone with no
problem.

What am I doing wrong?

Thanks,
Keith

Source code below:
-----------------------------------------------------------------------------------
package com.kgreene.stylusremote;

import java.io.IOException;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicHeader;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;
import org.json.JSONObject;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

@SuppressWarnings("unused")
public class stylusremote extends Activity {
    private static final String TAG = "Stylusremote";
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        final Button button = (Button) findViewById(R.id.button);
        button.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                // Perform action on clicks
             try {
// String junk = doGet( "http://192.168.1.2", 6969 );
String junk = doGet( "http://www.google.com", 80 );
} catch (ClientProtocolException e) {
Toast.makeText(stylusremote.this, "ClientProtocolException",
Toast.LENGTH_SHORT).show();
e.printStackTrace();
} catch (IOException e) {
Toast.makeText(stylusremote.this, "IOException", Toast.LENGTH_LONG).show();
e.printStackTrace();
}
// Toast.makeText(stylusremote.this, junk, Toast.LENGTH_SHORT).show();
            }
        });
    }
    public static String doGet(String url, int port) throws
ClientProtocolException, IOException
    {
     HttpHost target = new HttpHost(url, port);
     HttpGet get = new HttpGet("?playlist");
     String result = null;
     HttpEntity entity = null;
     HttpClient client = new DefaultHttpClient();
        HttpResponse response=client.execute(target, get);
        entity = response.getEntity();
        result = EntityUtils.toString(entity);
       return result;
    }
}

-- 

3. Penampakan HP Cina Dual Booting Android/WM 6.5 T535

4. South Koreans Buy 100,000 Galaxy S Phones in Six Days

5. Comparing two strings get false

6. UnknownHostException in Android Emulator

7. wrap_content vs fill_parent