Bugzilla – Bug 1221706
GCC 14: systemtap package fails
Last modified: 2024-06-04 12:45:47 UTC
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;
I fixed the gcc build issue yesterday but during testing I noticed current systemtap in openSUSE-release-20240326-2824.1 appears to be broken on even the most basic "hello world". I'm on vacation today&tomorrow but I was going to look at this over the weekend when I'm back. If you need the build issue fixed before then changes are in: home:jones_tony:branches:devel:tools/systemtap (see systemtap.changes)
Fix pushed. Runtime errors resolved via bsc#1222249
This is an autogenerated message for OBS integration: This bug (1221706) was mentioned in https://build.opensuse.org/request/show/1164227 Factory / systemtap