public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/30401] New: s390x specific: invalid application of ‘sizeof’ to incomplete type ‘struct stack_frame’
@ 2023-04-28 12:33 mcermak at redhat dot com
  2023-10-06 21:03 ` [Bug runtime/30401] " wcohen at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mcermak at redhat dot com @ 2023-04-28 12:33 UTC (permalink / raw)
  To: systemtap

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

            Bug ID: 30401
           Summary: s390x specific: invalid application of ‘sizeof’ to
                    incomplete type ‘struct stack_frame’
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
          Assignee: systemtap at sourceware dot org
          Reporter: mcermak at redhat dot com
  Target Milestone: ---

Recent 5.14.0-302.el9.s390x latest upstream stap
386aba5769bcba3e1149c277f36baab50bbbbb0c shows:

9 s390x # stap -e 'probe process("/bin/bash").function("main") { printf("%x\n",
int_arg(1)) }'
WARNING: cannot find module /usr/bin/bash debuginfo: No DWARF information found
[man warning::debuginfo]
Missing separate debuginfos, use: debuginfo-install bash-5.1.8-6.el9_1.s390x 
/tmp/staplihN2Y/stap_7f17fea67823b1d8d78574779801cb03_8083_src.c: In function
‘function___global__stp_get_kernel_stack_param__overload_0’:
/tmp/staplihN2Y/stap_7f17fea67823b1d8d78574779801cb03_8083_src.c:1033:58:
error: invalid application of ‘sizeof’ to incomplete type ‘struct stack_frame’
 1033 |         addr = (_stp_kernel_stack_pointer(regs) + sizeof(struct
stack_frame)
      |                                                          ^~~~~~
/tmp/staplihN2Y/stap_7f17fea67823b1d8d78574779801cb03_8083_src.c: At top level:
cc1: note: unrecognized command-line option ‘-Wno-infinite-recursion’ may have
been intended to silence earlier diagnostics
make[1]: *** [scripts/Makefile.build:297:
/tmp/staplihN2Y/stap_7f17fea67823b1d8d78574779801cb03_8083_src.o] Error 1
make: *** [Makefile:1923: /tmp/staplihN2Y] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed.  [man error::pass4]
9 s390x #

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

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

* [Bug runtime/30401] s390x specific: invalid application of ‘sizeof’ to incomplete type ‘struct stack_frame’
  2023-04-28 12:33 [Bug runtime/30401] New: s390x specific: invalid application of ‘sizeof’ to incomplete type ‘struct stack_frame’ mcermak at redhat dot com
@ 2023-10-06 21:03 ` wcohen at redhat dot com
  2023-10-12  3:45 ` wcohen at redhat dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: wcohen at redhat dot com @ 2023-10-06 21:03 UTC (permalink / raw)
  To: systemtap

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

William Cohen <wcohen at redhat dot com> changed:

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

--- Comment #1 from William Cohen <wcohen at redhat dot com> ---
I investigationed why this is failing on rhel9 s390.  The struct stack_frame
was moved arch/s390/include/asm/processor.h to
arch/s390/include/asm/stackframe.h by kernel
git commit 78c98f9074135d3dab4e39544e0a537f92388fce

Author: Martin Schwidefsky <schwidefsky@de.ibm.com>  2019-01-28 02:33:08
Committer: Martin Schwidefsky <schwidefsky@de.ibm.com>  2019-05-02 07:54:11
Parent: 1c705ad5efae9c712e763a47fbcc95b87b7347d2 (s390/opcodes: add missing
instructions to the disassembler)
Child:  ec7bf4789d95a0053bac0dfa36fbefd8cc584eea (s390/ftrace: use
HAVE_FUNCTION_GRAPH_RET_ADDR_PTR)
Branches: master, remotes/origin/master, remotes/origin/mmu_gather-race-fix,
remotes/origin/tty-splice, remotes/origin/x86-rep-insns,
remotes/origin/x86-uaccess-cleanup, wcohen/gcc9
Follows: v5.1-rc2
Precedes: v5.2-rc1

    s390/unwind: introduce stack unwind API

    Rework the dump_trace() stack unwinder interface to support different
    unwinding algorithms. The new interface looks like this:

        struct unwind_state state;
        unwind_for_each_frame(&state, task, regs, start_stack)
                do_something(state.sp, state.ip, state.reliable);

    The unwind_bc.c file contains the implementation for the classic
    back-chain unwinder.

    One positive side effect of the new code is it now handles ftraced
    functions gracefully. It prints the real name of the return function
    instead of 'return_to_handler'.

    Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

I am looking around to see there is a common include that ends up pulling in
the definition of struct stack_frame. The patch above adds "#include
<asm/stacktrace.h>" a number of files.  Might need to resort to a STAPCONF to
add the include where needed.

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

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

* [Bug runtime/30401] s390x specific: invalid application of ‘sizeof’ to incomplete type ‘struct stack_frame’
  2023-04-28 12:33 [Bug runtime/30401] New: s390x specific: invalid application of ‘sizeof’ to incomplete type ‘struct stack_frame’ mcermak at redhat dot com
  2023-10-06 21:03 ` [Bug runtime/30401] " wcohen at redhat dot com
@ 2023-10-12  3:45 ` wcohen at redhat dot com
  2023-10-12  9:17 ` sam at gentoo dot org
  2023-10-12 17:59 ` wcohen at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: wcohen at redhat dot com @ 2023-10-12  3:45 UTC (permalink / raw)
  To: systemtap

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

--- Comment #2 from William Cohen <wcohen at redhat dot com> ---
Created attachment 15164
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15164&action=edit
Patch that allows the reproducer to work on both newer s390 rhel9 and older
rhel8 kernel

This is a propoosed patch to address this issue.  It has been tested on rhel8
and rhel9 s390 kernels to make sure that it doesn't break things for older
kernels.

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

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

* [Bug runtime/30401] s390x specific: invalid application of ‘sizeof’ to incomplete type ‘struct stack_frame’
  2023-04-28 12:33 [Bug runtime/30401] New: s390x specific: invalid application of ‘sizeof’ to incomplete type ‘struct stack_frame’ mcermak at redhat dot com
  2023-10-06 21:03 ` [Bug runtime/30401] " wcohen at redhat dot com
  2023-10-12  3:45 ` wcohen at redhat dot com
@ 2023-10-12  9:17 ` sam at gentoo dot org
  2023-10-12 17:59 ` wcohen at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: sam at gentoo dot org @ 2023-10-12  9:17 UTC (permalink / raw)
  To: systemtap

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

Sam James <sam at gentoo dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sam at gentoo dot org

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

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

* [Bug runtime/30401] s390x specific: invalid application of ‘sizeof’ to incomplete type ‘struct stack_frame’
  2023-04-28 12:33 [Bug runtime/30401] New: s390x specific: invalid application of ‘sizeof’ to incomplete type ‘struct stack_frame’ mcermak at redhat dot com
                   ` (2 preceding siblings ...)
  2023-10-12  9:17 ` sam at gentoo dot org
@ 2023-10-12 17:59 ` wcohen at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: wcohen at redhat dot com @ 2023-10-12 17:59 UTC (permalink / raw)
  To: systemtap

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

William Cohen <wcohen at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from William Cohen <wcohen at redhat dot com> ---
The patch to address this issue has been added to the systemtap upstream git
repository with commit 3ecf49eee2ab7e7.

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

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

end of thread, other threads:[~2023-10-12 17:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-28 12:33 [Bug runtime/30401] New: s390x specific: invalid application of ‘sizeof’ to incomplete type ‘struct stack_frame’ mcermak at redhat dot com
2023-10-06 21:03 ` [Bug runtime/30401] " wcohen at redhat dot com
2023-10-12  3:45 ` wcohen at redhat dot com
2023-10-12  9:17 ` sam at gentoo dot org
2023-10-12 17:59 ` 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).