Bug ID 1221706
Summary GCC 14: systemtap package fails
Classification openSUSE
Product openSUSE Tumbleweed
Version Current
Hardware Other
OS Other
Status NEW
Severity Normal
Priority P5 - None
Component Development
Assignee screening-team-bugs@suse.de
Reporter michal.jires@suse.com
QA Contact qa-bugs@suse.de
CC tonyj@suse.com
Blocks 1220574
Target Milestone ---
Found By ---
Blocker ---

Building systemtap with GCC 14 fails here:
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:Gcc7/systemtap/standard/x86_64

Due to:

bpf-translate.cxx: In function ‘bpf::BPF_Section*
bpf::output_probe(BPF_Output&, program&, const std::string&, unsigned int)’:
bpf-translate.cxx:5044:39: error: ‘void* calloc(size_t, size_t)’ sizes
specified with ‘sizeof’ in the earlier argument and not in the later argument
[-Werror=calloc-transposed-args]
 5044 |   bpf_insn *buf = (bpf_insn*) calloc (sizeof(bpf_insn), ninsns);
      |                                       ^~~~~~~~~~~~~~~~
bpf-translate.cxx:5044:39: note: earlier argument should specify number of
elements, later size of each element
bpf-translate.cxx:5046:41: error: ‘void* calloc(size_t, size_t)’ sizes
specified with ‘sizeof’ in the earlier argument and not in the later argument
[-Werror=calloc-transposed-args]
 5046 |   Elf64_Rel *rel = (Elf64_Rel*) calloc (sizeof(Elf64_Rel), nreloc);
      |                                         ^~~~~~~~~~~~~~~~~
bpf-translate.cxx:5046:41: note: earlier argument should specify number of
elements, later size of each element

staprun.c: In function ‘main’:
staprun.c:550:50: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier
argument and not in the later argument [-Werror=calloc-transposed-args]
  550 |                 char ** new_argv = calloc(sizeof(char *),argc+2);
      |                                                  ^~~~
staprun.c:550:50: note: earlier argument should specify number of elements,
later size of each element





Builds with automatically generated:

Index: systemtap-5.0/bpf-translate.cxx
===================================================================
--- systemtap-5.0.orig/bpf-translate.cxx
+++ systemtap-5.0/bpf-translate.cxx
@@ -5041,9 +5041,9 @@ output_probe(BPF_Output &eo, program &pr
        }
     }

-  bpf_insn *buf = (bpf_insn*) calloc (sizeof(bpf_insn), ninsns);
+  bpf_insn *buf = (bpf_insn*) calloc (ninsns, sizeof(bpf_insn));
   assert (buf);
-  Elf64_Rel *rel = (Elf64_Rel*) calloc (sizeof(Elf64_Rel), nreloc);
+  Elf64_Rel *rel = (Elf64_Rel*) calloc (nreloc, sizeof(Elf64_Rel));
   assert (rel);

   unsigned i = 0, r = 0;
Index: systemtap-5.0/staprun/staprun.c
===================================================================
--- systemtap-5.0.orig/staprun/staprun.c
+++ systemtap-5.0/staprun/staprun.c
@@ -547,7 +547,7 @@ int main(int argc, char **argv)
            us to extend argv[], with all the C fun that entails. */
 #ifdef HAVE_OPENAT
         if (relay_basedir_fd >= 0) {
-                char ** new_argv = calloc(sizeof(char *),argc+2);
+                char ** new_argv = calloc(argc+2,sizeof(char *));
                 const int new_Foption_size = 10; /* -FNNNNN */
                 char * new_Foption = malloc(new_Foption_size);
                 int i;


You are receiving this mail because: