[Crash-utility] Problem in bt for ARM64

Reinoud Koornstra reinoudkoornstra at gmail.com
Thu Sep 21 20:46:32 UTC 2017


On Thu, Sep 21, 2017 at 12:33 PM, Dave Anderson <anderson at redhat.com> wrote:
>
>
> ----- Original Message -----
> > Ok. I have seen this change in the pt_regs struct before but did not connect
> > it to this problem. I see these new field in pt_regs in earlier kernel
> > versions than 4.7, but it is probably backports. It really does not matter
> > for the solution of the problem. The following change works for me:
> > Change:
> > #define USER_EFRAME_OFFSET (304)
> > to:
> > #define USER_EFRAME_OFFSET (STRUCT_SIZE("pt_regs") + 16)
> >
> > Then you might want to avoid the recalculation of the struct size. I think
> > your patch does the same thing.
>
> Yeah, but doing it your way makes better sense.  In fact, I see that there's
> another commit coming down the pike in 4.14-rc1 that changes the size yet again:
>
> diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h
> index 11403fd..ee72aa9 100644
> --- a/arch/arm64/include/asm/ptrace.h
> +++ b/arch/arm64/include/asm/ptrace.h
> @@ -119,6 +119,7 @@ struct pt_regs {
>         u64 syscallno;
>         u64 orig_addr_limit;
>         u64 unused;     // maintain 16 byte alignment
> +       u64 stackframe[2];
>  };
>

What am I missing here? Why not use the sizeof(u64) which is in some cases 8?
#define USER_EFRAME_OFFSET (STRUCT_SIZE("pt_regs") + sizeof(u64))
Would not give 16 bytes, but 8.
Thanks,

Reinoud.



>
> Thanks,
>   Dave
>
>
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility




More information about the Crash-utility mailing list