public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug runtime/30406] New: C symbol conflicts when using Fedora 36's 6.2 kernels and -DDEBUG_MEM
@ 2023-04-30  4:33 agentzh at gmail dot com
  2023-04-30  4:39 ` [Bug runtime/30406] " agentzh at gmail dot com
  2023-04-30 21:25 ` agentzh at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: agentzh at gmail dot com @ 2023-04-30  4:33 UTC (permalink / raw)
  To: systemtap

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

            Bug ID: 30406
           Summary: C symbol conflicts when using Fedora 36's 6.2 kernels
                    and -DDEBUG_MEM
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: runtime
          Assignee: systemtap at sourceware dot org
          Reporter: agentzh at gmail dot com
  Target Milestone: ---

When using Fedora 36 x86_64's own 6.2 kernel with the latest stap and the
`-DDEBUG_MEM` option, there is symbol conflicts with the kernel headers. It can
be reproduced by the following minimal example:

```
probe tcp.receive {
    println("Hit");
    exit();
}
```

And the compilation error when building the .ko file is like this:

```
$ /opt/stap/bin/stap -DDEBUG_MEM a.stp
In file included from ./include/linux/filter.h:9,
                 from ./include/net/sock_reuseport.h:5,
                 from ./include/net/tcp.h:35,
                 from
/tmp/stapciuh4P/stap_231a49b04a681bf897ea581eaa269a03_18995_src.c:40:
./include/linux/bpf.h:524:9: error: redeclaration of enumerator ‘MEM_PERCPU’
  524 |         MEM_PERCPU              = BIT(4 + BPF_BASE_TYPE_BITS),
      |         ^~~~~~~~~~
In file included from /opt/stap/share/systemtap/runtime/linux/runtime.h:265,
                 from /opt/stap/share/systemtap/runtime/runtime.h:26,
                 from
/tmp/stapciuh4P/stap_231a49b04a681bf897ea581eaa269a03_18995_src.c:21:
/opt/stap/share/systemtap/runtime/linux/alloc.c:56:47: note: previous
definition of ‘MEM_PERCPU’ with type ‘enum _stp_memtype’
   56 | enum _stp_memtype { MEM_KMALLOC, MEM_VMALLOC, MEM_PERCPU };
      |                                               ^~~~~~~~~~
make[1]: *** [scripts/Makefile.build:252:
/tmp/stapciuh4P/stap_231a49b04a681bf897ea581eaa269a03_18995_src.o] Error 1
make: *** [Makefile:2025: /tmp/stapciuh4P] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed.  [man error::pass4]
```

It is the symbol MEM_PERCPU in conflict. I'll propose a patch to add the `STP_`
prefix to stap runtime's symbols there to avoid such issues.

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

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

* [Bug runtime/30406] C symbol conflicts when using Fedora 36's 6.2 kernels and -DDEBUG_MEM
  2023-04-30  4:33 [Bug runtime/30406] New: C symbol conflicts when using Fedora 36's 6.2 kernels and -DDEBUG_MEM agentzh at gmail dot com
@ 2023-04-30  4:39 ` agentzh at gmail dot com
  2023-04-30 21:25 ` agentzh at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: agentzh at gmail dot com @ 2023-04-30  4:39 UTC (permalink / raw)
  To: systemtap

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

--- Comment #1 from agentzh <agentzh at gmail dot com> ---
The patch is here:
https://gist.github.com/agentzh/2014e2656bbace5dbb38bc61695b988a Does it look
good?

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

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

* [Bug runtime/30406] C symbol conflicts when using Fedora 36's 6.2 kernels and -DDEBUG_MEM
  2023-04-30  4:33 [Bug runtime/30406] New: C symbol conflicts when using Fedora 36's 6.2 kernels and -DDEBUG_MEM agentzh at gmail dot com
  2023-04-30  4:39 ` [Bug runtime/30406] " agentzh at gmail dot com
@ 2023-04-30 21:25 ` agentzh at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: agentzh at gmail dot com @ 2023-04-30 21:25 UTC (permalink / raw)
  To: systemtap

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

agentzh <agentzh at gmail dot com> changed:

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

--- Comment #2 from agentzh <agentzh at gmail dot com> ---
Patch was pushed to the git repo after fche gave the greenlight.

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

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

end of thread, other threads:[~2023-04-30 21:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-30  4:33 [Bug runtime/30406] New: C symbol conflicts when using Fedora 36's 6.2 kernels and -DDEBUG_MEM agentzh at gmail dot com
2023-04-30  4:39 ` [Bug runtime/30406] " agentzh at gmail dot com
2023-04-30 21:25 ` agentzh at gmail 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).