0

私は Android5.1 に基づいてアートの作業を行っており、Array.h(art/runtime/mirror/Array.h) の Array クラスに変数を追加したいと考えています。

しかし、クラスに「uint32_t タグ」を追加すると、エミュレータ内のシステムが起動できなくなります。では、Android5.1 の Array.h に変数を追加するにはどうすればよいでしょうか?

クラッシュログは次のようになります。

I/art     (   68): Pruning dalvik-cache since we are relocating an image and will need to recompile
I/art     (   68): RelocateImage: /system/bin/patchoat --input-image-location=/system/framework/boot.art --output-image-file=/data/dalvik-cache/arm/system@framework@boot.art --input-oat-location=/system/framework/boot.oat --output-oat-file=/data/dalvik-cache/arm/system@framework@boot.oat --instruction-set=arm --base-offset-delta=4898816
F/art     (   68): art/runtime/well_known_classes.cc:136] Couldn't find method "nativeLoad" with signature "(Ljava/lang/String;Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/lang/String;"
F/art     (   68): art/runtime/runtime.cc:289] Runtime aborting...
F/art     (   68): art/runtime/runtime.cc:289] Aborting thread:
F/art     (   68): art/runtime/runtime.cc:289] "main" prio=5 tid=1 Native (still starting up)
F/art     (   68): art/runtime/runtime.cc:289]   | group="" sCount=0 dsCount=0 obj=0x0 self=0xb4827800
F/art     (   68): art/runtime/runtime.cc:289]   | sysTid=68 nice=0 cgrp=default sched=0/0 handle=0xb6f75bec
F/art     (   68): art/runtime/runtime.cc:289]   | state=R schedstat=( 4510000000 20420000000 715 ) utm=337 stm=114 core=0 HZ=100
F/art     (   68): art/runtime/runtime.cc:289]   | stack=0xbe500000-0xbe502000 stackSize=8MB
F/art     (   68): art/runtime/runtime.cc:289]   | held mutexes= "abort lock" "mutator lock"(shared held)
F/art     (   68): art/runtime/runtime.cc:289]   native: #00 pc 00004ef0  /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
F/art     (   68): art/runtime/runtime.cc:289]   native: #01 pc 000036d5  /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
F/art     (   68): art/runtime/runtime.cc:289]   native: #02 pc 002458fd  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+68)
F/art     (   68): art/runtime/runtime.cc:289]   native: #03 pc 0022a051  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+144)
F/art     (   68): art/runtime/runtime.cc:289]   native: #04 pc 0021a44f  /system/lib/libart.so (art::AbortState::DumpThread(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, art::Thread*)+22)
F/art     (   68): art/runtime/runtime.cc:289]   native: #05 pc 0021a6b5  /system/lib/libart.so (art::AbortState::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+364)
F/art     (   68): art/runtime/runtime.cc:289]   native: #06 pc 0021a881  /system/lib/libart.so (art::Runtime::Abort()+72)
F/art     (   68): art/runtime/runtime.cc:289]   native: #07 pc 000a7c57  /system/lib/libart.so (art::LogMessage::~LogMessage()+1066)
F/art     (   68): art/runtime/runtime.cc:289]   native: #08 pc 0025f515  /system/lib/libart.so (art::WellKnownClasses::LateInit(_JNIEnv*)+148)
F/art     (   68): art/runtime/runtime.cc:289]   native: #09 pc 0021a0ab  /system/lib/libart.so (art::Runtime::InitNativeMethods()+654)
F/art     (   68): art/runtime/runtime.cc:289]   native: #10 pc 0021af8b  /system/lib/libart.so (art::Runtime::Start()+670)
F/art     (   68): art/runtime/runtime.cc:289]   native: #11 pc 001d6577  /system/lib/libart.so (JNI_CreateJavaVM+526)
F/art     (   68): art/runtime/runtime.cc:289]   native: #12 pc 000604df  /system/lib/libandroid_runtime.so (android::AndroidRuntime::startVm(_JavaVM**, _JNIEnv**)+2286)
F/art     (   68): art/runtime/runtime.cc:289]   native: #13 pc 00060b27  /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&)+258)
F/art     (   68): art/runtime/runtime.cc:289]   native: #14 pc 00001675  /system/bin/app_process32 (???)
F/art     (   68): art/runtime/runtime.cc:289]   native: #15 pc 00012dc9  /system/lib/libc.so (__libc_init+44)
F/art     (   68): art/runtime/runtime.cc:289]   native: #16 pc 000017b0  /system/bin/app_process32 (???)
F/art     (   68): art/runtime/runtime.cc:289]   (no managed stack frames)
F/art     (   68): art/runtime/runtime.cc:289] Pending exception java.lang.ExceptionInInitializerError thrown by 'unknown throw location'
F/art     (   68): art/runtime/runtime.cc:289] java.lang.ExceptionInInitializerError: 
F/art     (   68): art/runtime/runtime.cc:289]   at java.lang.String[] java.lang.Runtime.initLibPaths() (Runtime.java:73)
F/art     (   68): art/runtime/runtime.cc:289]   at void java.lang.Runtime.<init>() (Runtime.java:70)
F/art     (   68): art/runtime/runtime.cc:289]   at void java.lang.Runtime.<clinit>() (Runtime.java:65)
F/art     (   68): art/runtime/runtime.cc:289] Caused by: java.lang.ArrayIndexOutOfBoundsException: length=0; index=1
F/art     (   68): art/runtime/runtime.cc:289]   at java.lang.Object java.util.Hashtable.put(java.lang.Object, java.lang.Object) (Hashtable.java:384)
F/art     (   68): art/runtime/runtime.cc:289]   at java.util.Properties java.lang.System.initUnchangeableSystemProperties() (System.java:714)
F/art     (   68): art/runtime/runtime.cc:289]   at void java.lang.System.<clinit>() (System.java:108)
F/art     (   68): art/runtime/runtime.cc:289]   at java.lang.String[] java.lang.Runtime.initLibPaths() (Runtime.java:73)
F/art     (   68): art/runtime/runtime.cc:289]   at void java.lang.Runtime.<init>() (Runtime.java:70)
F/art     (   68): art/runtime/runtime.cc:289]   at void java.lang.Runtime.<clinit>() (Runtime.java:65)
F/art     (   68): art/runtime/runtime.cc:289] Dumping all threads without appropriate locks held: thread list lock mutator lock
F/art     (   68): art/runtime/runtime.cc:289] All threads:
F/art     (   68): art/runtime/runtime.cc:289] DALVIK THREADS (1):
F/art     (   68): art/runtime/runtime.cc:289] "main" prio=5 tid=1 Native (still starting up)
F/art     (   68): art/runtime/runtime.cc:289]   | group="" sCount=0 dsCount=0 obj=0x0 self=0xb4827800
F/art     (   68): art/runtime/runtime.cc:289]   | sysTid=68 nice=0 cgrp=default sched=0/0 handle=0xb6f75bec
F/art     (   68): art/runtime/runtime.cc:289]   | state=R schedstat=( 4610000000 20610000000 739 ) utm=344 stm=117 core=0 HZ=100
F/art     (   68): art/runtime/runtime.cc:289]   | stack=0xbe500000-0xbe502000 stackSize=8MB
F/art     (   68): art/runtime/runtime.cc:289]   | held mutexes= "abort lock"
F/art     (   68): art/runtime/runtime.cc:289]   native: #00 pc 00004ef0  /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23)
F/art     (   68): art/runtime/runtime.cc:289]   native: #01 pc 000036d5  /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8)
F/art     (   68): art/runtime/runtime.cc:289]   native: #02 pc 002458fd  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::mirror::ArtMethod*)+68)
F/art     (   68): art/runtime/runtime.cc:289]   native: #03 pc 0022a051  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+144)
F/art     (   68): art/runtime/runtime.cc:289]   native: #04 pc 00232f85  /system/lib/libart.so (art::ThreadList::DumpLocked(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+104)
F/art     (   68): art/runtime/runtime.cc:289]   native: #05 pc 0021a635  /system/lib/libart.so (art::AbortState::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+236)
F/art     (   68): art/runtime/runtime.cc:289]   native: #06 pc 0021a881  /system/lib/libart.so (art::Runtime::Abort()+72)
F/art     (   68): art/runtime/runtime.cc:289]   native: #07 pc 000a7c57  /system/lib/libart.so (art::LogMessage::~LogMessage()+1066)
F/art     (   68): art/runtime/runtime.cc:289]   native: #08 pc 0025f515  /system/lib/libart.so (art::WellKnownClasses::LateInit(_JNIEnv*)+148)
F/art     (   68): art/runtime/runtime.cc:289]   native: #09 pc 0021a0ab  /system/lib/libart.so (art::Runtime::InitNativeMethods()+654)
F/art     (   68): art/runtime/runtime.cc:289]   native: #10 pc 0021af8b  /system/lib/libart.so (art::Runtime::Start()+670)
F/art     (   68): art/runtime/runtime.cc:289]   native: #11 pc 001d6577  /system/lib/libart.so (JNI_CreateJavaVM+526)
F/art     (   68): art/runtime/runtime.cc:289]   native: #12 pc 000604df  /system/lib/libandroid_runtime.so (android::AndroidRuntime::startVm(_JavaVM**, _JNIEnv**)+2286)
F/art     (   68): art/runtime/runtime.cc:289]   native: #13 pc 00060b27  /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&)+258)
F/art     (   68): art/runtime/runtime.cc:289]   native: #14 pc 00001675  /system/bin/app_process32 (???)
F/art     (   68): art/runtime/runtime.cc:289]   native: #15 pc 00012dc9  /system/lib/libc.so (__libc_init+44)
F/art     (   68): art/runtime/runtime.cc:289]   native: #16 pc 000017b0  /system/bin/app_process32 (???)
F/art     (   68): art/runtime/runtime.cc:289]   (no managed stack frames)
F/art     (   68): art/runtime/runtime.cc:289] 
F/art     (   68): art/runtime/runtime.cc:289] 
--------- beginning of crash
F/libc    (   68): Fatal signal 6 (SIGABRT), code -6 in tid 68 (main)
I/DEBUG   (   62): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (   62): Build fingerprint: '***'
I/DEBUG   (   62): Revision: '0'
I/DEBUG   (   62): ABI: 'arm'
I/DEBUG   (   62): pid: 68, tid: 68, name: main  >>> zygote <<<
I/DEBUG   (   62): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
I/DEBUG   (   62): Abort message: 'art/runtime/well_known_classes.cc:136] Couldn't find method "nativeLoad" with signature "(Ljava/lang/String;Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/lang/String;"'
I/DEBUG   (   62):     r0 00000000  r1 00000044  r2 00000006  r3 00000000
I/DEBUG   (   62):     r4 b6f75e38  r5 00000006  r6 00000002  r7 0000010c
I/DEBUG   (   62):     r8 00000082  r9 b486f550  sl b4827800  fp b486d480
I/DEBUG   (   62):     ip 00000044  sp becfd5f0  lr b6df3745  pc b6e176f0  cpsr 60000010
I/DEBUG   (   62): 
I/DEBUG   (   62): backtrace:
I/DEBUG   (   62):     #00 pc 0003a6f0  /system/lib/libc.so (tgkill+12)
I/DEBUG   (   62):     #01 pc 00016741  /system/lib/libc.so (pthread_kill+52)
I/DEBUG   (   62):     #02 pc 0001735f  /system/lib/libc.so (raise+10)
I/DEBUG   (   62):     #03 pc 00013b39  /system/lib/libc.so (__libc_android_abort+36)
I/DEBUG   (   62):     #04 pc 00012f18  /system/lib/libc.so (abort+4)
I/DEBUG   (   62):     #05 pc 0021a8d9  /system/lib/libart.so (art::Runtime::Abort()+160)
I/DEBUG   (   62):     #06 pc 000a7c57  /system/lib/libart.so (art::LogMessage::~LogMessage()+1066)
I/DEBUG   (   62):     #07 pc 0025f515  /system/lib/libart.so (art::WellKnownClasses::LateInit(_JNIEnv*)+148)
I/DEBUG   (   62):     #08 pc 0021a0ab  /system/lib/libart.so (art::Runtime::InitNativeMethods()+654)
I/DEBUG   (   62):     #09 pc 0021af8b  /system/lib/libart.so (art::Runtime::Start()+670)
I/DEBUG   (   62):     #10 pc 001d6577  /system/lib/libart.so (JNI_CreateJavaVM+526)
I/DEBUG   (   62):     #11 pc 000604df  /system/lib/libandroid_runtime.so (android::AndroidRuntime::startVm(_JavaVM**, _JNIEnv**)+2286)
I/DEBUG   (   62):     #12 pc 00060b27  /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&)+258)
I/DEBUG   (   62):     #13 pc 00001675  /system/bin/app_process32
I/DEBUG   (   62):     #14 pc 00012dc9  /system/lib/libc.so (__libc_init+44)
I/DEBUG   (   62):     #15 pc 000017b0  /system/bin/app_process32
I/DEBUG   (   62): 
I/DEBUG   (   62): Tombstone written to: /data/tombstones/tombstone_00
4

1 に答える 1

0

趙開元、

まず第一に、すべての配列にタグを付けたい理由がわかりませんが、問題は実際には理由ではなく、方法です。

方法は次のとおりです。.h ファイルで変更する必要があります。次に、Android ソース コード全体を調べ、配列要素のすべての呼び出しを変更して、変更を考慮に入れます。これは退屈で、私の考えでは価値のない作業です。とにかく、それがHOWです。最終的にこれを処理するスクリプトを作成する方が簡単かもしれません。

それでもこのようなことをしたい場合は、幸運と迅速な grep をお祈りします。また、何らかのスクリプトを思いついた場合は、非常に興味があります。他の状況でも役立つスクリプトです。

于 2016-05-13T19:32:35.290 に答える