Hi fadden,

Nice to talk with you again.

I have tried to make the function threadExitCheck no-op as you
suggested and I found something

As we know that calling System.exit() is expected to make the entire
process exit and the current implement of Dalvik for System.exit is to
call exit function in native to exit the process and all threads.

However on Vxworks, every thread is a task so calling System.exit ->
call exit only terminate the thread (task) call. So other created
thread still running. It happens with my sample app in the previous
comment.

I tried to make threadExitCheck no-op and then running my sample app,
after call System.exit -> call exit, Dalvik still Running. I used
shell command to see the running thread and I found that some thread
belongs to Dalvik still running.

So maybe we need to adapt the current implement of System.exit on
Vxwork, I think we need to save all created threads and when
System.exit is called, we need to loop and exit every created thread
to exit Dalvik completely. But at the current I do not know how to do
it.

Did Dalvik save all created threads and where they are saved? and how
can we exit for every created thread?

Would you help to suggest me an implement that can exit every created
thread?

Thanks so much
BR

On Jul 18, 1:09 am, fadden <[email protected]> wrote:
> On Jul 17, 9:58 am, Mercury <[email protected]> wrote:
>
> > and I found that it called to dvmAbort and my board automatically
> > reboot. With my debug, thread status in above function is
> > THREAD_RUNNING so it goes to if block and call dvmAbort.
>
> Change dvmAbort() to just call abort().  That should cause the process
> to receive a SIGABRT and stop.  dvmAbort() stores a value in an
> invalid address in an attempt to convince debuggerd to show the right
> stack trace on ARM, but apparently it's causing your board to reboot.
>
> > I do not why it goes to if block and cause dvmAbort call. If it does
> > not call dvmAbort() does Dalvik terminates successfully? What is
> > condition for Dalvik VM terminates successfully when callSystem.exit
> > ().
>
> System.exit() is expected to make the entire process exit.  It sounds
> like exit() on your system is just causing the thread to exit.  On
> Linux, the exit() library call turns into the exit_group() system call
> ("man 2 exit_group" for details), which terminates all threads in the
> process.
>
> It's also possible that the vxworks exit() is "polite" and is running
> all of the pthread key destruction functions before killing the
> process.  In that case you should probably just make threadExitCheck()
> a no-op for now.  (It's only there to check for people who create a
> thread, attach it to the VM, and then let the thread exit without
> detaching it first, which leaks resources.)
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---

Reply via email to