我正试图将安卓棒棒糖移植到arndale板上,我面临以下关于ART crash(AndroidRunTime)的问题。

> I/art ( 2264): RelocateImage: /system/bin/patchoat
> --input-image-location=/system/framework/boot.art --output-image-file=/data/dalvik-cach6 F/libc ( 2443): No [stack] line found in "/proc/self/task/2443/maps"! F/libc ( 2443): Fatal signal 6
> (SIGABRT), code -6 in tid 2443 (patchoat) W/art ( 2702): Could not
> create image space with image file >/system/framework/boot.art.
> Attempting to fall back to imageless running

移植步骤
1.从下面的链接下载vexpress android L 32位代码。
http://releases.linaro.org/15.05/android
2.从http://releases.linaro.org/14.08/android/arndale
3.用从步骤2中下载的arndale KK 3.9内核源代码替换步骤1中从代码下载的Vexpress内核源代码。
4.将Vexpress HAL(设备/linaro/Vexpress)替换为Arndale HAL(设备/linaro/Arndale)。
5.解决与仿生和建筑环境相关的小问题。
在闪烁图像并接通电源后,我陷入了android徽标和内核崩溃的困境
> >37.790000] Internal error: Oops: 5 [#1] PREEMPT SMP ARM Modules linked in: CPU: 0    Tainted: G        W     (3.9.1 #8) [   37.790000]
> CPU: 0    Tainted: G        W     (3.9.1 #8) PC is at
> __copy_to_user_std+0x4c/0x3a8 [   37.790000] PC is at __copy_to_user_std+0x4c/0x3a8 LR is at 0x6c000000
> >[   37.790000] LR is at 0x6c000000

洛格特给
> >I/art ( 2264): RelocateImage: /system/bin/patchoat --input-image-location=/system/framework/boot.art --output-image-file=/data/dalvik-cach6 F/libc ( 2443): No [stack] line found in "/proc/self/task/2443/maps"! F/libc ( 2443): Fatal signal 6
> (SIGABRT), code -6 in tid 2443 (patchoat) W/art ( 2702): Could not
> create image space with image file >/system/framework/boot.art.
> Attempting to fall back to imageless running.

精确失效点
1.ART从ART/runtime/Thread.cc调用Thread::InitStackHwm。
2.以上调用触发bionic/libc/bionic/pthread_attr.cpp中的u pthread_getstack_main_thread(stack_base,stack_size)线程,该线程在enter code here/proc/self/task/2443/maps中未返回[stack]行!艺术崩溃导致SIG_中止,似乎没有为2443线程创建堆栈,但是如何解决这个问题呢?
如果有人能帮我解决这个问题,那就太好了。
谢谢,
德瓦什

最佳答案

这是将3.9内核与linaro vexpress android平台一起使用的副作用,该平台期望使用3.10内核(其对arndale的支持不可用)。
作为解决方法,请在art/runtime/thread.cc中注释InitStackHwm()函数。
我认为如果在3.10内核中需要arndale的支持,我们可能不需要这种解决方法,而ART可以立即工作。

    void Thread::Init(ThreadList* thread_list, JavaVMExt* java_vm) {
  // This function does all the initialization that must be run by the native thread it applies to.
  // (When we create a new thread from managed code, we allocate the Thread* in Thread::Create so
  // we can handshake with the corresponding native thread when it's ready.) Check this native
  // thread hasn't been through here already...
  CHECK(Thread::Current() == nullptr);
  SetUpAlternateSignalStack();
  InitCpu();
  InitTlsEntryPoints();
  RemoveSuspendTrigger();
  InitCardTable();
  InitTid();
  // Set pthread_self_ ahead of pthread_setspecific, that makes Thread::Current function, this
  // avoids pthread_self_ ever being invalid when discovered from Thread::Current().
  tlsPtr_.pthread_self = pthread_self();
  CHECK(is_started_);
  CHECK_PTHREAD_CALL(pthread_setspecific, (Thread::pthread_key_self_, this), "attach self");
  DCHECK_EQ(Thread::Current(), this);

  tls32_.thin_lock_thread_id = thread_list->AllocThreadId(this);
  //InitStackHwm(); This is the workaround

  tlsPtr_.jni_env = new JNIEnvExt(this, java_vm);
  thread_list->Register(this);
}

07-27 13:17