bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 64bit startup


From: Luca
Subject: Re: 64bit startup
Date: Sat, 6 Jan 2024 00:42:35 +0100

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 = &note.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:

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], &note.data.pr_reg);
       fetch_thread_fpregset (threads[i], &note.data.pr_fpreg);


HTH
Luca




reply via email to

[Prev in Thread] Current Thread [Next in Thread]