Bug 371439

Summary: Get coredump working on arm64
Product: [Developer tools] valgrind Reporter: Marcin Juszkiewicz <marcin>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED DUPLICATE    
Severity: normal CC: ivosh, mark, philippe.waroquiers
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: patch
newer (not fully tested yet) version

Description Marcin Juszkiewicz 2016-10-21 15:31:31 UTC
VEX lacks code to dump registers so coredumps do not work. Or sth like that.

Reproducible: Always
Comment 1 Marcin Juszkiewicz 2016-10-21 15:32:02 UTC
Created attachment 101686 [details]
patch

 regs->pstate should probably do something with guest_CC_{OP/DEP1/DEP2/NDEP} but no idea how
Comment 2 Mark Wielaard 2016-11-25 14:25:41 UTC
I played with it a bit, but it seems to be not fully complete.

First it doesn't actually compile, there are some missing ';' at the end of the last two lines.

Second to assign FPSR you'll need to use LibVEX_GuestARM64_get_fpsr.

I am not sure with that the vgcore generate is complete, but I didn't have time to fully test it.

To test it you could do something like ulimit -c unlimited; /bin/sleep 60 and hit Ctrl-\. That should generate a vgcore.xxxx file.
then gdb --core vgcore.xxxx /bin/sleep and see if you can get any information from it bt should give something for example
likewise eu-stack --core vgcore.xxxx --exec /bin/sleep should show at least a few recognizable frames
Comment 3 Philippe Waroquiers 2016-11-27 16:33:18 UTC
Note that do do an application core dump, you can use
  gdb+vgdb
to connect to the valgrind gdbserver,
and then use the gcore command.

This works (at least on amd64/debian8, with gdb 7.12)
Comment 4 Marcin Juszkiewicz 2017-02-07 17:26:36 UTC
Created attachment 103890 [details]
newer (not fully tested yet) version
Comment 5 Ivo Raisr 2017-05-05 15:37:53 UTC
Marcin, what is the status here? Is the patch complete?
Comment 6 Marcin Juszkiewicz 2017-05-05 16:06:26 UTC
Not completed that yet.
Comment 7 Mark Wielaard 2021-10-04 09:06:24 UTC
I believe this has been fixed by:

commit 965876e22b863bca1cbe7db9578e648397a705a7
Author: Alexandra Hajkova <ahajkova@redhat.com>
Date:   Wed Mar 20 10:10:44 2019 +0100

    Support arm64 core dump
    
    Fixes BZ #405722.
    Implements coredump-elf.c fill_prstatus()
    and fill_fpu () for VGP_arm64_linux.

*** This bug has been marked as a duplicate of bug 405722 ***