public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug tdep/27789] New: backtraces through unknown functions on m68k are broken
@ 2021-04-29  2:19 jrmuizel at gmail dot com
  2021-04-29 14:11 ` [Bug tdep/27789] " simark at simark dot ca
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jrmuizel at gmail dot com @ 2021-04-29  2:19 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27789

            Bug ID: 27789
           Summary: backtraces through unknown functions on m68k are
                    broken
           Product: gdb
           Version: 10.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tdep
          Assignee: unassigned at sourceware dot org
          Reporter: jrmuizel at gmail dot com
  Target Milestone: ---

It looks like m68k needs something like:
http://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=7618e12bcb8f15e83c8c6abc5216f520f09bdbf9

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tdep/27789] backtraces through unknown functions on m68k are broken
  2021-04-29  2:19 [Bug tdep/27789] New: backtraces through unknown functions on m68k are broken jrmuizel at gmail dot com
@ 2021-04-29 14:11 ` simark at simark dot ca
  2021-04-29 17:51 ` jrmuizel at gmail dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: simark at simark dot ca @ 2021-04-29 14:11 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27789

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simark at simark dot ca

--- Comment #1 from Simon Marchi <simark at simark dot ca> ---
It would help greatly if you could provide a reproducer, ideally that anyone
can try (either a core file or with a simulator, something like that).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tdep/27789] backtraces through unknown functions on m68k are broken
  2021-04-29  2:19 [Bug tdep/27789] New: backtraces through unknown functions on m68k are broken jrmuizel at gmail dot com
  2021-04-29 14:11 ` [Bug tdep/27789] " simark at simark dot ca
@ 2021-04-29 17:51 ` jrmuizel at gmail dot com
  2021-04-29 17:53 ` jrmuizel at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jrmuizel at gmail dot com @ 2021-04-29 17:51 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27789

--- Comment #2 from Jeff Muizelaar <jrmuizel at gmail dot com> ---
Created attachment 13414
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13414&action=edit
A core file showing the issue

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tdep/27789] backtraces through unknown functions on m68k are broken
  2021-04-29  2:19 [Bug tdep/27789] New: backtraces through unknown functions on m68k are broken jrmuizel at gmail dot com
  2021-04-29 14:11 ` [Bug tdep/27789] " simark at simark dot ca
  2021-04-29 17:51 ` jrmuizel at gmail dot com
@ 2021-04-29 17:53 ` jrmuizel at gmail dot com
  2021-04-29 18:35 ` simark at simark dot ca
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jrmuizel at gmail dot com @ 2021-04-29 17:53 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27789

--- Comment #3 from Jeff Muizelaar <jrmuizel at gmail dot com> ---
The core file was created by running the following code on m68k.

int h(int x) {
                *((char*)0) = 7;
                        return 7+x;
}
int g() {
                return h(4);
}
int f() {
                return g() + g();
}

int main() {
                return f();
}

The code was compiled with gcc 10.2 and then stripped.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tdep/27789] backtraces through unknown functions on m68k are broken
  2021-04-29  2:19 [Bug tdep/27789] New: backtraces through unknown functions on m68k are broken jrmuizel at gmail dot com
                   ` (2 preceding siblings ...)
  2021-04-29 17:53 ` jrmuizel at gmail dot com
@ 2021-04-29 18:35 ` simark at simark dot ca
  2021-04-29 18:36 ` simark at simark dot ca
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: simark at simark dot ca @ 2021-04-29 18:35 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27789

--- Comment #4 from Simon Marchi <simark at simark dot ca> ---
Thanks.  For others to reproduce, you'll probably need to provide a bit more:

- the compiled executable
- a minimal sysroot, at least the libraries that were loaded by the program
- the set of commands that you use to trigger the bug
- the output you see, pointing out what you think is buggy (and what you would
expect instead)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tdep/27789] backtraces through unknown functions on m68k are broken
  2021-04-29  2:19 [Bug tdep/27789] New: backtraces through unknown functions on m68k are broken jrmuizel at gmail dot com
                   ` (3 preceding siblings ...)
  2021-04-29 18:35 ` simark at simark dot ca
@ 2021-04-29 18:36 ` simark at simark dot ca
  2021-04-29 23:19 ` jrmuizel at gmail dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: simark at simark dot ca @ 2021-04-29 18:36 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27789

--- Comment #5 from Simon Marchi <simark at simark dot ca> ---
Also, if a previous version of GDB worked better, then mention it, this way we
can bisect.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tdep/27789] backtraces through unknown functions on m68k are broken
  2021-04-29  2:19 [Bug tdep/27789] New: backtraces through unknown functions on m68k are broken jrmuizel at gmail dot com
                   ` (4 preceding siblings ...)
  2021-04-29 18:36 ` simark at simark dot ca
@ 2021-04-29 23:19 ` jrmuizel at gmail dot com
  2021-04-29 23:20 ` jrmuizel at gmail dot com
  2021-04-30  0:30 ` simark at simark dot ca
  7 siblings, 0 replies; 9+ messages in thread
From: jrmuizel at gmail dot com @ 2021-04-29 23:19 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27789

--- Comment #6 from Jeff Muizelaar <jrmuizel at gmail dot com> ---
It's possible to just load the attached core file with a gdb that targets
m68k-linux (like ubuntu's gdb-multiarch)

gdb -c core
GNU gdb (GDB) 10.2
Copyright (C) 2021 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-pc-linux-gnu
--target=m68k-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".

warning: Can't open file /root/a.out during file-backed mapping note processing

warning: Can't open file /usr/lib/m68k-linux-gnu/ld-2.31.so during file-backed
mapping note processing

warning: Can't open file /usr/lib/m68k-linux-gnu/libc-2.31.so during
file-backed mapping note processing
[New LWP 395]
Core was generated by `./a.out'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x800003be in ?? ()
(gdb) bt
#0  0x800003be in ?? ()
#1  0xeff50c44 in ?? ()
#2  0x800003da in ?? ()
#3  0x00000004 in ?? ()
#4  0xeff50c50 in ?? ()
#5  0x800003ec in ?? ()
#6  0x00000000 in ?? ()
(gdb) q

notice the garbage frames: 1, 3, 4 and 6

Applying the attached patch which does the same thing as
7618e12bcb8f15e83c8c6abc5216f520f09bdbf9 gives:

(gdb) bt
#0  0x800003be in ?? ()
#1  0x800003da in ?? ()
#2  0x800003ec in ?? ()
#3  0x80000408 in ?? ()
#4  0xc004a902 in ?? ()
#5  0x80000346 in ?? ()

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tdep/27789] backtraces through unknown functions on m68k are broken
  2021-04-29  2:19 [Bug tdep/27789] New: backtraces through unknown functions on m68k are broken jrmuizel at gmail dot com
                   ` (5 preceding siblings ...)
  2021-04-29 23:19 ` jrmuizel at gmail dot com
@ 2021-04-29 23:20 ` jrmuizel at gmail dot com
  2021-04-30  0:30 ` simark at simark dot ca
  7 siblings, 0 replies; 9+ messages in thread
From: jrmuizel at gmail dot com @ 2021-04-29 23:20 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27789

--- Comment #7 from Jeff Muizelaar <jrmuizel at gmail dot com> ---
Created attachment 13415
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13415&action=edit
Assume valid anonymous functions use a frame pointer.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tdep/27789] backtraces through unknown functions on m68k are broken
  2021-04-29  2:19 [Bug tdep/27789] New: backtraces through unknown functions on m68k are broken jrmuizel at gmail dot com
                   ` (6 preceding siblings ...)
  2021-04-29 23:20 ` jrmuizel at gmail dot com
@ 2021-04-30  0:30 ` simark at simark dot ca
  7 siblings, 0 replies; 9+ messages in thread
From: simark at simark dot ca @ 2021-04-30  0:30 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27789

--- Comment #8 from Simon Marchi <simark at simark dot ca> ---
Ok, thanks for the instructions.  If you'd like your patch to be reviewed /
considered for merging, please follow the process here:

https://sourceware.org/gdb/wiki/ContributionChecklist

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-04-30  0:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-29  2:19 [Bug tdep/27789] New: backtraces through unknown functions on m68k are broken jrmuizel at gmail dot com
2021-04-29 14:11 ` [Bug tdep/27789] " simark at simark dot ca
2021-04-29 17:51 ` jrmuizel at gmail dot com
2021-04-29 17:53 ` jrmuizel at gmail dot com
2021-04-29 18:35 ` simark at simark dot ca
2021-04-29 18:36 ` simark at simark dot ca
2021-04-29 23:19 ` jrmuizel at gmail dot com
2021-04-29 23:20 ` jrmuizel at gmail dot com
2021-04-30  0:30 ` simark at simark dot ca

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).