This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Android : Getting untracked pid error at the time of boot up

Hi

I am adding support for CAN driver in android framework for Jacinto board.My java framework service is running fine.But when I am adding a jni service and register it in /framework/base/services/jni/onload.cpp and build and flash the image I am getting untracked pid error.I need support.Thanks in advance.

  • Hello Archan,

    At first:

    What is your java version?

    Did you apply this commands before you have started with Android build?

    Ubuntu 12.04

    sudo apt-get install git-core flex bison gperf libesd0-dev zip libwxgtk2.8-dev zlib1g-dev build-essential tofrodos

    sudo apt-get install lib32readline6-dev libstdc++6 lib32z1 lib32z1-dev ia32-libs g++-multilib libx11-dev libncurses5-dev

    sudo apt-get install uboot-mkimage libxml2-utils

       Install Java SE 6 JDK

    sudo add-apt-repository ppa:webupd8team/java

    sudo apt-get update

    sudo apt-get install oracle-java6-installer

    See the link http://www.oracle.com/technetwork/java/javase/crashes-137240.html

    Best regards,

    Yanko

  • First of all thanks you Yanko for answering.I have done all the steps you mentioned.But still same error.The same jni service is running fine in my eclipse environment.But when I added this with AOSP after flashing I am getting untracked pid.And It is similar implementation as alarmmanager_service in AOSP.Is it not possible to register user defined service in onload.cpp so that android system can load it up at the time of booting.
  • Hello Archan,

    It seems that your build environment is not set properly.

    Could you follow the steps described in this link - http://www.omappedia.com/wiki/Android_Panda_Build_Source#Building_from_AOSP_master_branch

    What is your cross compile? Do you use gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux?

    Best regards,

    Yanko

  • hi Yanko,
    I am using the build steps mentioned in
    http://omappedia.org/wiki/6AK.1.1_Release_Notes

    and the cross compiler is export CROSS_COMPILE=${MYDROID}/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin/arm-eabi-

    Can you please let me know how to add a jni service with android system bypassing registering it in /framework/base/services/jni/onload.cpp

    Thanks in advance.
  • Hello Archan,

    You must export following:

    export ARCH=arm

    export CROSS_COMPILE=/home/users/<username>/<folder>/6AJ.1.2/mydroid/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin/arm-eabi-

    export CROSS_COMPILE=/home/users/<username>/<folder>/6AJ.1.2/mydroid/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin:$PATH

    Could you provide information about the pid error - text?

    Have you changed Android.mk file in your project?

    Have you checked if DCAN driver is available in this Android release? - Please add this patch in your kernel - http://review.omapzoom.org/#/c/34108/

    JNI_OnLoad is called when the native library is loaded, so we can guarantee that the native methods are registered before they're invoked:

    PID Process ID number of the process.

    Please describe how you added your application in this Android release.

    Best regards,

    Yanko

  • I am writing user defined native methods from where we will make call to the can driver.Ya I added this native method to Android.mk file in [Aosp]/framework/base/services/jni/Android.mk . onload.cpp contains 16 native services.
    If we just copy one service say com_android_server_AlarmManagerService.cpp to com_android_server_TestService.cpp and then changethe register method in it register_android_server_TestService(JNIEnv * env) and add it onload.cpp .Then Build it.It will build properly.But after flashing only boot animation logo will come and log it will show untracked pid error continuously.
  • And thank you very much for you post
  • Hello Archan,

    Your problem is that a service or an application are not starting properly so some process are dying, then Android start them again but die one more time, and so on.

    Try to separate the services started from init.rc first, and once you find the errornous service, then try to fix the specific service start up errors, which may be the kernel driver error, or android hal driver error, library fault, or sometimes android framework error.

    See the function which gernerates this message in file android / platform/system/core / master / . / init / signal_handler.c:
    static int wait_for_one_process(int block)
    {
    pid_t pid;
    int status;
    struct service *svc;
    struct socketinfo *si;
    time_t now;
    struct listnode *node;
    struct command *cmd;
    while ( (pid = waitpid(-1, &status, block ? 0 : WNOHANG)) == -1 && errno == EINTR );
    if (pid <= 0) return -1;
    INFO("waitpid returned pid %d, status = %08x\n", pid, status);
    svc = service_find_by_pid(pid);
    if (!svc) {
    if (WIFEXITED(status)) {
    ERROR("untracked pid %d exited with status %d\n", pid, WEXITSTATUS(status));
    } else if (WIFSIGNALED(status)) {
    ERROR("untracked pid %d killed by signal %d\n", pid, WTERMSIG(status));
    } else if (WIFSTOPPED(status)) {
    ERROR("untracked pid %d stopped by signal %d\n", pid, WSTOPSIG(status));
    } else {
    ERROR("untracked pid %d state changed\n", pid);
    }
    return 0;
    }

    Please use a logcat to see what process generate this pid error.

    Best regards,
    Yanko