public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug tapsets/18711] New: Pass 4 failure on RHEL7 for examples netfilter_summary and netfilter_drop
@ 2015-07-23 12:50 mcermak at redhat dot com
  2015-07-23 17:20 ` [Bug tapsets/18711] " jistone at redhat dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: mcermak at redhat dot com @ 2015-07-23 12:50 UTC (permalink / raw)
  To: systemtap

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

            Bug ID: 18711
           Summary: Pass 4 failure on RHEL7 for examples netfilter_summary
                    and netfilter_drop
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tapsets
          Assignee: systemtap at sourceware dot org
          Reporter: mcermak at redhat dot com
  Target Milestone: ---

Created attachment 8452
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8452&action=edit
netfilter.h differences between 3.10.0-123 and 3.10.0-294

Bug similar to rhbz1055778 now appears again when using systemtap-2.8-6.el7 (or
current upstream 3952632) on top of kernel-3.10.0-294.el7. The error is:

=======
 7.2 S x86_64 #  /usr/bin/stap -g   netfilter_drop.stp TCP 1 -c "sleep 2" 
/tmp/stapBT8dKn/stap_0a103d85fb485e2a1e15b0ad9128aea7_13604_src.c:2507:1:
error: initialization from incompatible pointer type [-Werror]
 .hook = enter_netfilter_probe_0,
 ^
/tmp/stapBT8dKn/stap_0a103d85fb485e2a1e15b0ad9128aea7_13604_src.c:2507:1:
error: (near initialization for ‘netfilter_opts_0.hook’) [-Werror]
cc1: all warnings being treated as errors
make[1]: ***
[/tmp/stapBT8dKn/stap_0a103d85fb485e2a1e15b0ad9128aea7_13604_src.o] Error 1
make: *** [_module_/tmp/stapBT8dKn] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed.  [man error::pass4]
 7.2 S x86_64 #
=======

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

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

* [Bug tapsets/18711] Pass 4 failure on RHEL7 for examples netfilter_summary and netfilter_drop
  2015-07-23 12:50 [Bug tapsets/18711] New: Pass 4 failure on RHEL7 for examples netfilter_summary and netfilter_drop mcermak at redhat dot com
@ 2015-07-23 17:20 ` jistone at redhat dot com
  2015-07-29 11:40 ` mcermak at redhat dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jistone at redhat dot com @ 2015-07-23 17:20 UTC (permalink / raw)
  To: systemtap

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

Josh Stone <jistone at redhat dot com> changed:

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

--- Comment #1 from Josh Stone <jistone at redhat dot com> ---
(In reply to Martin Cermak from comment #0)
> Created attachment 8452 [details]
> netfilter.h differences between 3.10.0-123 and 3.10.0-294

There's something funny here.  The latter has linux-3.10.0-294.fc20.x86_64 in
the path -- *fc20*?  Was this a local rpmbuild of your own on a Fedora 20 host? 

Anyway, the relevant difference appears to be a kabi hack:

-                              int (*okfn)(struct sk_buff *));
+#ifndef __GENKSYMS__
+                              const struct nf_hook_state *state
+#else
+                              int (*okfn)(struct sk_buff *)
+#endif
+                              );

We have autoconf checks somewhat related to this.  The change to "state" looks
like what we're calling STAPCONF_NETFILTER_V41.  But I'm not sure how
__GENKSYMS__ is set for our module build, or which way we'll have to actually
use this.

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

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

* [Bug tapsets/18711] Pass 4 failure on RHEL7 for examples netfilter_summary and netfilter_drop
  2015-07-23 12:50 [Bug tapsets/18711] New: Pass 4 failure on RHEL7 for examples netfilter_summary and netfilter_drop mcermak at redhat dot com
  2015-07-23 17:20 ` [Bug tapsets/18711] " jistone at redhat dot com
@ 2015-07-29 11:40 ` mcermak at redhat dot com
  2015-07-30  8:35 ` mcermak at redhat dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mcermak at redhat dot com @ 2015-07-29 11:40 UTC (permalink / raw)
  To: systemtap

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

--- Comment #2 from Martin Cermak <mcermak at redhat dot com> ---
I tested that with 3.10.0-229.el7, STAPCONF_NETFILTER_V313 is defined within
tapset-netfilter.cxx and respective #ifdef branch is effective. Looking at
buildrun.cxx, this is probably because autoconf-netfilter.c compiles fine. I am
not sure how exactly is autoconf compiling it yet. But at the end of the day
netfilter_drop.stp works fine.

With 3.10.0-300.el7, none of STAPCONF_NETFILTER_V41, STAPCONF_NETFILTER_V313 is
defined and thus "LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22)" condition wins.
What fixes the issue for me is following update. Yes, it's not a "fix" but a
dirty hack that makes it work (and probably breaks it all elsewhere):

=======
diff --git a/tapset-netfilter.cxx b/tapset-netfilter.cxx
index 12df8d7..b149be1 100644
--- a/tapset-netfilter.cxx
+++ b/tapset-netfilter.cxx
@@ -279,8 +279,10 @@ netfilter_derived_probe_group::emit_module_decls
(systemtap_session& s)

       s.op->newline() << "#elif LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22)";

-      s.op->newline() << "(unsigned int nf_hooknum, struct sk_buff *nf_skb,
const struct net_device *nf_in, const struct net_device *nf_out, int
(*nf_okfn)(struct sk_buff *))";
+//      s.op->newline() << "(unsigned int nf_hooknum, struct sk_buff *nf_skb,
const struct net_device *nf_in, const struct net_device *nf_out, int
(*nf_okfn)(struct sk_buff *))";
+      s.op->newline() << "(const struct nf_hook_ops *nf_ops, struct sk_buff
*nf_skb, const struct net_device *nf_in, const struct net_device *nf_out, const
struct nf_hook_state *nf_state)";
       s.op->newline() << "{";
+      s.op->newline() << "unsigned int nf_hooknum = nf_ops->hooknum;";

       s.op->newline() << "#else";
=======

I found this by repetitive commenting out various pieces of the code, building
it and running. I wonder how I could put some _stp_warn()-ish debugging outputs
there.

However, my nose says that this will probably require new autoconf .c test
program, adding it to buildrun.cxx where some new STAPCONF_NETFILTER_foo macro
will get defined and add a respective new branch to tapset-netfilter.cxx?
__GENKSYMS__ is still a bit mysterious to me, but I can imagine this being
covered by an autoconf test.

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

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

* [Bug tapsets/18711] Pass 4 failure on RHEL7 for examples netfilter_summary and netfilter_drop
  2015-07-23 12:50 [Bug tapsets/18711] New: Pass 4 failure on RHEL7 for examples netfilter_summary and netfilter_drop mcermak at redhat dot com
  2015-07-23 17:20 ` [Bug tapsets/18711] " jistone at redhat dot com
  2015-07-29 11:40 ` mcermak at redhat dot com
@ 2015-07-30  8:35 ` mcermak at redhat dot com
  2015-07-30  8:49 ` mcermak at redhat dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mcermak at redhat dot com @ 2015-07-30  8:35 UTC (permalink / raw)
  To: systemtap

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

--- Comment #3 from Martin Cermak <mcermak at redhat dot com> ---
Created attachment 8460
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8460&action=edit
proposed patch

This is how nf_hookfn looks like in kernel-3.10.0-300.el7:

=======
typedef unsigned int nf_hookfn(const struct nf_hook_ops *ops,
                               struct sk_buff *skb,
                               const struct net_device *in,
                               const struct net_device *out,
#ifndef __GENKSYMS__
                               const struct nf_hook_state *state
#else
                               int (*okfn)(struct sk_buff *)
#endif
                               );
=======

I don't see the __GENKSYMS__ macro in vanilla kernel sources. In the
distribution kernel-3.10.0-300.el7.x86_64 it is defined in
scripts/Makefile.build as follows:

=======
cmd_gensymtypes =                                                           \
    $(CPP) -D__GENKSYMS__ $(c_flags) $< |                                   \
    $(GENKSYMS) $(if $(1), -T $(2))                                         \
     $(patsubst y,-s _,$(CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX))             \
     $(if $(KBUILD_PRESERVE),-p)                                            \
     -r $(firstword $(wildcard $(2:.symtypes=.symref) /dev/null))
=======

Branch where __GENKSYMS__ is defined is already covered by autoconf-netfilter.c
aka STAPCONF_NETFILTER_V313. This patch basically adds support for the other
branch, where __GENKSYMS__ is not defined. This solution shouldn't bring any
regression. It tests fine across rhel[567] all supported arches. It namely also
tests fine on arm64 with kernel-4.2.0-0.rc3.14.el7.aarch64.

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

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

* [Bug tapsets/18711] Pass 4 failure on RHEL7 for examples netfilter_summary and netfilter_drop
  2015-07-23 12:50 [Bug tapsets/18711] New: Pass 4 failure on RHEL7 for examples netfilter_summary and netfilter_drop mcermak at redhat dot com
                   ` (2 preceding siblings ...)
  2015-07-30  8:35 ` mcermak at redhat dot com
@ 2015-07-30  8:49 ` mcermak at redhat dot com
  2015-07-31  7:30 ` mcermak at redhat dot com
  2015-07-31 15:49 ` mcermak at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: mcermak at redhat dot com @ 2015-07-30  8:49 UTC (permalink / raw)
  To: systemtap

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

--- Comment #4 from Martin Cermak <mcermak at redhat dot com> ---
(In reply to Martin Cermak from comment #3)
> I don't see the __GENKSYMS__ macro in vanilla kernel sources. In the
> distribution kernel-3.10.0-300.el7.x86_64 it is defined in
> scripts/Makefile.build

Correction: __GENKSYMS__ is defined in vanilla kernel too - the same way.

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

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

* [Bug tapsets/18711] Pass 4 failure on RHEL7 for examples netfilter_summary and netfilter_drop
  2015-07-23 12:50 [Bug tapsets/18711] New: Pass 4 failure on RHEL7 for examples netfilter_summary and netfilter_drop mcermak at redhat dot com
                   ` (3 preceding siblings ...)
  2015-07-30  8:49 ` mcermak at redhat dot com
@ 2015-07-31  7:30 ` mcermak at redhat dot com
  2015-07-31 15:49 ` mcermak at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: mcermak at redhat dot com @ 2015-07-31  7:30 UTC (permalink / raw)
  To: systemtap

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

--- Comment #5 from Martin Cermak <mcermak at redhat dot com> ---
Created attachment 8463
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8463&action=edit
updated patch

Bisection shows that the underlying kernel change first appeared in
kernel-3.10.0-284.el7. Changelog points to rhbz1230935. Attached updated patch
adds this comment to the autoconf test.

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

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

* [Bug tapsets/18711] Pass 4 failure on RHEL7 for examples netfilter_summary and netfilter_drop
  2015-07-23 12:50 [Bug tapsets/18711] New: Pass 4 failure on RHEL7 for examples netfilter_summary and netfilter_drop mcermak at redhat dot com
                   ` (4 preceding siblings ...)
  2015-07-31  7:30 ` mcermak at redhat dot com
@ 2015-07-31 15:49 ` mcermak at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: mcermak at redhat dot com @ 2015-07-31 15:49 UTC (permalink / raw)
  To: systemtap

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

Martin Cermak <mcermak at redhat dot com> changed:

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

--- Comment #6 from Martin Cermak <mcermak at redhat dot com> ---
Fixed in commit 7cfb10eca050964b22bc8f25dd4682b409434078

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

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

end of thread, other threads:[~2015-07-31 15:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-23 12:50 [Bug tapsets/18711] New: Pass 4 failure on RHEL7 for examples netfilter_summary and netfilter_drop mcermak at redhat dot com
2015-07-23 17:20 ` [Bug tapsets/18711] " jistone at redhat dot com
2015-07-29 11:40 ` mcermak at redhat dot com
2015-07-30  8:35 ` mcermak at redhat dot com
2015-07-30  8:49 ` mcermak at redhat dot com
2015-07-31  7:30 ` mcermak at redhat dot com
2015-07-31 15:49 ` mcermak 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).