Fork us on GitHub Follow us on Facebook Follow us on Twitter

Opened 7 years ago

Closed 7 years ago

#452 closed defect (fixed)

amd64 cores do not contain valid register information

Reported by: Jakub Jermář Owned by:
Priority: major Milestone: 0.5.0
Component: helenos/app/taskdump Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description

While working on #396, taskdump generated a coredump for which gdb reports:

jermar@gorgo:~/lab$ gdb tester 51.core
GNU gdb (Ubuntu/Linaro 7.4-2012.02-0ubuntu2) 7.4-2012.02
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/jermar/lab/tester...(no debugging symbols found)...done.
Illegal process-id: 51.core.

warning: exec file is newer than core file.

warning: Couldn't find general-purpose registers in core file.

warning: Couldn't find general-purpose registers in core file.
#0  <unavailable> in ?? ()

The coredump and the binary are attached.

Attachments (2)

51.core.bz2 (149.6 KB) - added by Jakub Jermář 7 years ago.
coredump of the tester task
tester.bz2 (71.5 KB) - added by Jakub Jermář 7 years ago.
tester binary

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by Jakub Jermář

Attachment: 51.core.bz2 added

coredump of the tester task

Changed 7 years ago by Jakub Jermář

Attachment: tester.bz2 added

tester binary

comment:1 Changed 7 years ago by Jiri Svoboda

Note, you are using your system's native GDB x86_64-linux-gnu. Did you try using the proper cross GDB, which has target triplet amd64-linux-gnu?

comment:2 Changed 7 years ago by Jakub Jermář

I did, the result is pretty much the same with some slight difference in the warnings printed:

jermar@hexatonsil:~/Downloads$ /usr/local/cross/amd64/bin/amd64-linux-gnu-gdb tester 51.core 
GNU gdb (GDB) 7.4
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=amd64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/jermar/Downloads/tester...(no debugging symbols found)...done.
Don't know how to attach.  Try "help target".

warning: exec file is newer than core file.

warning: Couldn't find general-purpose registers in core file.

warning: Couldn't find general-purpose registers in core file.
#0  <unavailable> in ?? ()

comment:3 Changed 7 years ago by Jiri Svoboda

I was able to reproduce this with both current GDB and GDB 6.7a, so it was not broken by changing GDB version. We should try using old HelenOS revision. I am pretty sure I tested this and no idea so far what could have broken it.

comment:4 Changed 7 years ago by Jakub Jermář

Couldn't this be related to the move of the shared stuff under abi/?

comment:5 Changed 7 years ago by Jiri Svoboda

The ability to write amd64 register state was added in mainline,1131. I did some testing:

That's strange, looks like it never worked?

comment:6 Changed 7 years ago by Jakub Jermář

Resolution: fixed
Status: newclosed

The problem is that the resepctive elf_regs_t structure was missing the following:

	uint64_t unused_fs_base;
	uint64_t unused_gs_base;
	uint64_t unused_ds;
	uint64_t unused_es;
	uint64_t unused_fs;
	uint64_t unused_gs;

Without these, the prstatus structure seemed too short to GDB and was IMO simply ignored as invalid.

Fixed in mainline,1585.

Note: See TracTickets for help on using tickets.