[Ltrace-devel] ARM support

Petr Machata pmachata at redhat.com
Wed Apr 25 12:58:42 UTC 2012


Florian Echtler <floe at butterbrot.org> writes:

> On 25.04.2012 11:39, Petr Machata wrote:
>> If you forked off 0.6.0, the threading fixes aren't in yet.  Might that
>> be the cause?  I don't see any evidence of threads in your snippet, but
>> if the process that you are tracing shares the address space with
>> someone else, that someone else will see breakpoints that ltrace puts
>> in, and will be SIGTRAP'd if it hits one of those.  That would then kill
>> the original traced process as well, which is what you are seeing.
> That sounds very plausible; this issue only appears when tracing
> full-blown Dalvik VM processes and not with regular shell tools. I'm not
> quite sure about the details, but Dalvik definitely uses some shared
> memory magic for faster startup, so this might be the cause.
>
> Which branch is the one with threading fixes, I'm assuming
> pmachata/libs?

The master branch has them.

But in fact clone support was in for a long time now, maybe try to pass
-f on the command line.  The tracing might still fail, calls and returns
might get missed across threads, but chances are it will work a bit
better.

>> There's a bunch of patches that implement support for processes with
>> shared address space.  Unfortunately those same patches might break ARM
>> support.  They also rely on procfs, is that available on Android?
> Yes, procfs is available. Are these patches also in one of your
> branches?

That's on master as well.  There's about 60 commits on top of what's
tagged 0.6.0, and most of that is for fixes relating to tracing
processes with shared address space.  We should really do 0.7, but I
can't seem to be able to reach Juan.

>> Other than that I don't know what might cause that ltrace interprets
>> SIGTRAP as a real signal as opposed to a tracing event.  Maybe if
>> Android kernel doesn't support PTRACE_O_TRACESYSGOOD we might be hitting
>> some weird corner case (that's not really tested, recent kernels all
>> know about that option).
> The Android version I'm using (2.3.3) has kernel 2.6.29, so AFAICT that
> shouldn't be a problem.

Yeah.  I just looked that PTRACE_O_TRACESYSGOOD has been in since 2.4.6.
In fact all of the interesting options were introduced before 2.6, so it
should really work on anything reasonable and recent.

PM



More information about the Ltrace-devel mailing list