Luca, le sam. 06 janv. 2024 00:42:35 +0100, a ecrit: > Il 05/01/24 19:12, Sergey Bugaev ha scritto: > > /servers/crash-dump-core crashes on the memset () call in > > hurd:exec/elfcore.c:fetch_thread_fpregset (); the (*fpregs) pointer is > > NULL. The caller passes fpregs = ¬e.data.pr_fpreg, where note.data > > is of type struct elf_lwpstatus, defined in hurd:include/sys/procfs.h, > > whose pr_fpreg field is of type prfpregset_t, which is a typedef to > > fpregset_t, which was an actual struct on i386, but is a pointer on > > x86_64. This would've been easier to debug if I had debuginfo :) > > I had this small patch applied that apparently is enough for me to have some > kind of core dump, I'm not sure if it's a good solution:
You probably rather want to fix fetch_thread_fpregset, so as to properly put the floating state into pr_fpreg. This probably needs to actually copy over explicit fields, but that's what we need anyway. > diff --git a/exec/elfcore.c b/exec/elfcore.c > index c6aa2bc8b..405fa8e0c 100644 > --- a/exec/elfcore.c > +++ b/exec/elfcore.c > @@ -544,6 +544,11 @@ dump_core (task_t task, file_t file, off_t corelimit, > note.data.pr_info.si_code = sigcode; > note.data.pr_info.si_errno = sigerror; > > +#ifdef __x86_64__ > + struct _libc_fpstate fpstate; > + memset(&fpstate, 0, sizeof(fpstate)); > + note.data.pr_fpreg = &fpstate; > +#endif > fetch_thread_regset (threads[i], ¬e.data.pr_reg); > fetch_thread_fpregset (threads[i], ¬e.data.pr_fpreg); > > > HTH > Luca