public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/22671] New: MIPSEL error Unknown register: a4
@ 2018-01-04  6:42 mysecondaccountabc at gmail dot com
  2018-01-05 14:25 ` [Bug runtime/22671] " dsmith at redhat dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: mysecondaccountabc at gmail dot com @ 2018-01-04  6:42 UTC (permalink / raw)
  To: systemtap

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

            Bug ID: 22671
           Summary: MIPSEL error Unknown register: a4
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: runtime
          Assignee: systemtap at sourceware dot org
          Reporter: mysecondaccountabc at gmail dot com
  Target Milestone: ---

Created attachment 10711
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10711&action=edit
kernel config

Having this error on mipsel emulation: 
...
stapio:stp_main_loop:861 systemtap_module_init() returned 0
ERROR: Unknown register: a4
stapio:stp_main_loop:852 got STP_REQUEST_EXIT
WARNING: Number of errors: 1, skipped probes: 0
stapio:stp_main_loop:841 got STP_EXIT
stapio:cleanup_and_exit:526 detach=0
...


# stap --version
Systemtap translator/driver (version 3.2/0.168, non-git sources)
Copyright (C) 2005-2017 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
tested kernel versions: 2.6.18 ... 4.11
enabled features: AVAHI LIBSQLITE3 NLS NSS

# uname -a
Linux arex-11f9b261f2 4.9.0-4-4kc-malta #1 Debian 4.9.65-3 (2017-12-03) mips
GNU/Linux

The Rootfs is a Debian Stretch.

It seems to be an ABI (O32/N32) issue, but not sure why it's happening. I've
locally compiled SystemTap from Systemtap 3.2 release
(https://sourceware.org/systemtap/ftp/releases/systemtap-3.2.tar.gz)

Any clue?

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug runtime/22671] MIPSEL error Unknown register: a4
  2018-01-04  6:42 [Bug runtime/22671] New: MIPSEL error Unknown register: a4 mysecondaccountabc at gmail dot com
@ 2018-01-05 14:25 ` dsmith at redhat dot com
  2018-01-08  0:43 ` mysecondaccountabc at gmail dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dsmith at redhat dot com @ 2018-01-05 14:25 UTC (permalink / raw)
  To: systemtap

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

David Smith <dsmith at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dsmith at redhat dot com

--- Comment #1 from David Smith <dsmith at redhat dot com> ---
(In reply to Gustavo Moreira from comment #0)
> Created attachment 10711 [details]
> kernel config
> 
> Having this error on mipsel emulation: 
> ...
> stapio:stp_main_loop:861 systemtap_module_init() returned 0
> ERROR: Unknown register: a4

It looks like this is coming from tapset/mips/registers.stp. It appears that
that file has only been tested against 64-bit kernels. It doesn't think the
a4-a7 registers exist in a 32-bit kernel. That prevents it from grabbing the
5th through 8th argument to a function (in _stp_arg()).

If you know the calling convention for a 32-bit mips kernel, we can fix that
file.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug runtime/22671] MIPSEL error Unknown register: a4
  2018-01-04  6:42 [Bug runtime/22671] New: MIPSEL error Unknown register: a4 mysecondaccountabc at gmail dot com
  2018-01-05 14:25 ` [Bug runtime/22671] " dsmith at redhat dot com
@ 2018-01-08  0:43 ` mysecondaccountabc at gmail dot com
  2018-01-15 18:31 ` dsmith at redhat dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mysecondaccountabc at gmail dot com @ 2018-01-08  0:43 UTC (permalink / raw)
  To: systemtap

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

--- Comment #2 from Gustavo Moreira <mysecondaccountabc at gmail dot com> ---
It seems a4-a7 registers exist in n32 but not in o32.
Debian uses o32, so it seems SystemTap struggles to detect the ABI or it just
uses n32 by default.
The kernel is a prebuilt one. I got it from
(http://ftp.debian.org/debian/dists/stretch/main/installer-mipsel/current/images/malta/netboot/vmlinux-4.9.0-4-4kc-malta)

I've extracted the .config file from kernel and I've attached it to this
ticket.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug runtime/22671] MIPSEL error Unknown register: a4
  2018-01-04  6:42 [Bug runtime/22671] New: MIPSEL error Unknown register: a4 mysecondaccountabc at gmail dot com
  2018-01-05 14:25 ` [Bug runtime/22671] " dsmith at redhat dot com
  2018-01-08  0:43 ` mysecondaccountabc at gmail dot com
@ 2018-01-15 18:31 ` dsmith at redhat dot com
  2018-01-26 21:26 ` dsmith at redhat dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dsmith at redhat dot com @ 2018-01-15 18:31 UTC (permalink / raw)
  To: systemtap

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

--- Comment #3 from David Smith <dsmith at redhat dot com> ---
Created attachment 10751
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10751&action=edit
Simple mips patch

Here's a simple (untested) patch that will get you past your initial error
message and allow you to access the first 4 arguments of a function. To access
the rest, someone with knowledge of the 32-bit MIPS ABI (and access to MIPS
hardware) will need to write some code that decodes the MIPS o32 user and
kernel stacks.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug runtime/22671] MIPSEL error Unknown register: a4
  2018-01-04  6:42 [Bug runtime/22671] New: MIPSEL error Unknown register: a4 mysecondaccountabc at gmail dot com
                   ` (2 preceding siblings ...)
  2018-01-15 18:31 ` dsmith at redhat dot com
@ 2018-01-26 21:26 ` dsmith at redhat dot com
  2018-02-26  3:48 ` gmoreira at gmail dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dsmith at redhat dot com @ 2018-01-26 21:26 UTC (permalink / raw)
  To: systemtap

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

--- Comment #4 from David Smith <dsmith at redhat dot com> ---
I went ahead and checked in this patch as commit 1d0a3dc015c.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug runtime/22671] MIPSEL error Unknown register: a4
  2018-01-04  6:42 [Bug runtime/22671] New: MIPSEL error Unknown register: a4 mysecondaccountabc at gmail dot com
                   ` (3 preceding siblings ...)
  2018-01-26 21:26 ` dsmith at redhat dot com
@ 2018-02-26  3:48 ` gmoreira at gmail dot com
  2018-02-26 22:08 ` dsmith at redhat dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: gmoreira at gmail dot com @ 2018-02-26  3:48 UTC (permalink / raw)
  To: systemtap

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

--- Comment #5 from Gustavo Moreira <gmoreira at gmail dot com> ---
(In reply to David Smith from comment #3)
> Created attachment 10751 [details]
> Simple mips patch
> 
> Here's a simple (untested) patch that will get you past your initial error
> message and allow you to access the first 4 arguments of a function. To
> access the rest, someone with knowledge of the 32-bit MIPS ABI (and access
> to MIPS hardware) will need to write some code that decodes the MIPS o32
> user and kernel stacks.

Actually, I've replaced the final FIXME assert() with error() instead,
otherwise it raises another compilation error. Anyway, the assert() function
executes error() so it should be equivalent:
  error(sprintf("Cannot access arg(%d)", argnum))

But yeah it would be needed to write some code to fix it completely.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug runtime/22671] MIPSEL error Unknown register: a4
  2018-01-04  6:42 [Bug runtime/22671] New: MIPSEL error Unknown register: a4 mysecondaccountabc at gmail dot com
                   ` (4 preceding siblings ...)
  2018-02-26  3:48 ` gmoreira at gmail dot com
@ 2018-02-26 22:08 ` dsmith at redhat dot com
  2018-04-26  7:50 ` gmoreira at gmail dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dsmith at redhat dot com @ 2018-02-26 22:08 UTC (permalink / raw)
  To: systemtap

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

David Smith <dsmith at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |SUSPENDED
   Last reconfirmed|                            |2018-02-26
     Ever confirmed|0                           |1

--- Comment #6 from David Smith <dsmith at redhat dot com> ---
(In reply to Gustavo Moreira from comment #5)
> But yeah it would be needed to write some code to fix it completely.

If you have the time to figure this out, go ahead and send us a patch. We'll be
happy to review it and check it in for you.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug runtime/22671] MIPSEL error Unknown register: a4
  2018-01-04  6:42 [Bug runtime/22671] New: MIPSEL error Unknown register: a4 mysecondaccountabc at gmail dot com
                   ` (5 preceding siblings ...)
  2018-02-26 22:08 ` dsmith at redhat dot com
@ 2018-04-26  7:50 ` gmoreira at gmail dot com
  2018-04-26 20:59 ` fche at redhat dot com
  2023-12-06 15:31 ` wcohen at redhat dot com
  8 siblings, 0 replies; 10+ messages in thread
From: gmoreira at gmail dot com @ 2018-04-26  7:50 UTC (permalink / raw)
  To: systemtap

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

Gustavo Moreira <gmoreira at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gmoreira at gmail dot com

--- Comment #7 from Gustavo Moreira <gmoreira at gmail dot com> ---
Created attachment 10988
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10988&action=edit
MIPS o32 ABI patch

This is based on arch/mips/include/ptrace.h and ARM registers.stp.
However, it doesn't seem to be working correctly, the values extracted from the
user stack, for some reason, aren't the correct ones. 
I would appreciate if you can review the patch and help me out.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug runtime/22671] MIPSEL error Unknown register: a4
  2018-01-04  6:42 [Bug runtime/22671] New: MIPSEL error Unknown register: a4 mysecondaccountabc at gmail dot com
                   ` (6 preceding siblings ...)
  2018-04-26  7:50 ` gmoreira at gmail dot com
@ 2018-04-26 20:59 ` fche at redhat dot com
  2023-12-06 15:31 ` wcohen at redhat dot com
  8 siblings, 0 replies; 10+ messages in thread
From: fche at redhat dot com @ 2018-04-26 20:59 UTC (permalink / raw)
  To: systemtap

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

Frank Ch. Eigler <fche at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fche at redhat dot com

--- Comment #8 from Frank Ch. Eigler <fche at redhat dot com> ---
Merged that patch (slightly adjusted).
Sorry, I am not sure what to do with the userspace registers, though there
should be a user-side pt_regs struct with a saved register dump available.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

* [Bug runtime/22671] MIPSEL error Unknown register: a4
  2018-01-04  6:42 [Bug runtime/22671] New: MIPSEL error Unknown register: a4 mysecondaccountabc at gmail dot com
                   ` (7 preceding siblings ...)
  2018-04-26 20:59 ` fche at redhat dot com
@ 2023-12-06 15:31 ` wcohen at redhat dot com
  8 siblings, 0 replies; 10+ messages in thread
From: wcohen at redhat dot com @ 2023-12-06 15:31 UTC (permalink / raw)
  To: systemtap

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

William Cohen <wcohen at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WONTFIX
             Status|SUSPENDED                   |RESOLVED
                 CC|                            |wcohen at redhat dot com

--- Comment #9 from William Cohen <wcohen at redhat dot com> ---
Don't have any access to MIPS machines, so it is unlikely that we will be able
to address this further.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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

end of thread, other threads:[~2023-12-06 15:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-04  6:42 [Bug runtime/22671] New: MIPSEL error Unknown register: a4 mysecondaccountabc at gmail dot com
2018-01-05 14:25 ` [Bug runtime/22671] " dsmith at redhat dot com
2018-01-08  0:43 ` mysecondaccountabc at gmail dot com
2018-01-15 18:31 ` dsmith at redhat dot com
2018-01-26 21:26 ` dsmith at redhat dot com
2018-02-26  3:48 ` gmoreira at gmail dot com
2018-02-26 22:08 ` dsmith at redhat dot com
2018-04-26  7:50 ` gmoreira at gmail dot com
2018-04-26 20:59 ` fche at redhat dot com
2023-12-06 15:31 ` wcohen at redhat dot com

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).