Bug 371439 - Get coredump working on arm64
Summary: Get coredump working on arm64
Status: RESOLVED DUPLICATE of bug 405722
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-21 15:31 UTC by Marcin Juszkiewicz
Modified: 2021-10-04 09:06 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
patch (1.70 KB, patch)
2016-10-21 15:32 UTC, Marcin Juszkiewicz
Details
newer (not fully tested yet) version (2.09 KB, patch)
2017-02-07 17:26 UTC, Marcin Juszkiewicz
Details

Note You need to log in before you can comment on or make changes to this bug.
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 ***