how to solve W/art : Could not create image space

2019-09-19 16:56发布

Iam trying to port Android Lollipop on arndale board and I am facing following issue regarding 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

STEPS FOLLOWED FOR PORTING

1.Download vexpress android L 32 bit code from below link. http://releases.linaro.org/15.05/android

2.Download arndale android KK 32 bit source with 3.9 kernel from http://releases.linaro.org/14.08/android/arndale

3.Replace the Vexpress kernel source from code download in step 1 with arndale KK 3.9 Kernel source downloaded from step2.

4.Replace Vexpress HAL (device/linaro/vexpress) with Arndale HAL (device/linaro/arndale).

5.Solve minor complilation issues related to bionic and build environment.

After flashing the images and powering on the board I am stuck at android logo and kernel crashes

> >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

and logcat gives

> >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.

POINT OF EXACT FAILURE

1.ART calls Thread::InitStackHwm from art/runtime/thread.cc.

2.The above call triggers __pthread_attr_getstack_main_thread(stack_base, stack_size) in bionic/libc/bionic/pthread_attr.cpp which returns No [stack] line found in enter code here/proc/self/task/2443/maps! and ART crashes giving SIG_ABORT and it seems as if no stack is getting created for 2443 thread, but how to solve this?

It would be great if anyone can help me to solve this issue.

Thanks, Devarsh

1条回答
姐就是有狂的资本
2楼-- · 2019-09-19 17:42

This is a side effect of using 3.9 kernel with linaro vexpress android platform which is expecting 3.10 kernel(whose support for arndale is not available).

As a workaround comment out the InitStackHwm() function in art/runtime/thread.cc.

I think if in 3.10 kernel support of arndale is needed we may not need this workaround and ART would work straightaway.

    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);
}
查看更多
登录 后发表回答