Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

meaning of dalvik VM VFY codes

Tags:

android

dalvik

Can someone please explain to me the meaning of the following warnings when running my Android Application (the warnings are outputted in sequence as given):

04-17 15:29:11.693: I/dalvikvm(4442): DexOpt: access denied from Lcom/kirona/iclient/db/core/services/impl/MiscDatabaseModuleDaoImpl; to field Lcom/kirona/iclient/database/common/impl/AbstractDatabaseModuleDao;.logger
04-17 15:29:11.653: W/dalvikvm(4442): VFY: unable to resolve static field 30 (logger) in Lcom/kirona/iclient/db/core/services/impl/MiscDatabaseModuleDaoImpl;
04-17 15:29:11.653: D/dalvikvm(4442): VFY: replacing opcode 0x62 at 0x0001    
04-17 15:29:11.693: D/dalvikvm(4442): VFY: dead code 0x0046-006e in Lcom/kirona/iclient/db/core/services/impl/MiscDatabaseModuleDaoImpl;.getSequenceNextVal (Ljava/lang/String;)J

The application seems to run fine but I need to understand the issue since we have more complicated applications with similar errors which crash the dalvikvm.

like image 968
paul Avatar asked Apr 17 '12 16:04

paul


1 Answers

The issue appears to be that the MiscDatabaseModuleDaoImpl class is attempting to access the AbstractDatabaseModuleDao.logger field, but can't, due to access restrictions (i.e. private, protected, etc.). In this case, the sget-object opcode (opcode 0x62) that is accessing this field is replaced with one that throws a verification exception, which would likely cause a runtime crash if executed.

Additionally, the last message refers to dead code in the MiscDatabaseModuleDaoImpl.getSequenceNextVal method. This is harmless - it won't cause any issues during runtime. However, it wouldn't be a bad idea to find out exactly what the dead code is, and remove it. You can disassemble your application using baksmali, with the --code-offsets option, and then look at the disassembly for that method. The --code-offsets option will put a comment before each instruction containing the offset. Per the error message, the offsets from 0x46 to 0x6e are dead code. There should also be .line directives in the vicinity, which will be the corresponding line numbers from the original java file.

like image 197
JesusFreke Avatar answered Oct 15 '22 07:10

JesusFreke