iovisor / iovisor/bcc

0.29.1 + master (706ec4fe): compile time warnings

Open
#4,907 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

First just summary stats
```console
[tkloczko@pers-jacek SPECS]$ rpmbuild -ba bcc.spec --quiet 2>&1 | grep -- \\[-W | sed 's/.*\[//; s/\]//' | sort | uniq -c | sort -nr 17 -Wstringop-overflow=
2 -Wodr
2 -Wcomment
1 -Wuse-after-free
```
And ..

Extracted stderr

```console
bcc/src/cc/frontends/clang/kbuild_helper.cc:84:3: warning: multi-line comment [-Wcomment]
84 | // USERINCLUDE := \
| ^
bcc/src/cc/frontends/clang/kbuild_helper.cc:93:3: warning: multi-line comment [-Wcomment]
93 | // LINUXINCLUDE := \
| ^
warning: sdist: standard file not found: should have one of README, README.rst, README.txt, README.md

bcc/introspection/bps.c: In function ‘print_one_prog’:
bcc/introspection/bps.c:227:7: warning: pointer ‘map_ids_48’ may be used after ‘realloc’ [-Wuse-after-free]
227 | free(map_ids);
| ^~~~~~~~~~~~~
bcc/introspection/bps.c:220:36: note: call to ‘realloc’ here
220 | prog_info.map_ids = ptr_to_u64(realloc(map_ids,
| ^~~~~~~~~~~~~~~~
221 | nr_map_ids * sizeof(*map_ids)));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘poll’,
inlined from ‘perf_reader_poll’ at bcc/src/cc/perf_reader.c:231:7:
/usr/include/bits/poll2.h:39:10: warning: ‘__poll_chk’ specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
39 | return __glibc_fortify (poll, __nfds, sizeof (*__fds),
| ^
/usr/include/bits/poll2.h: In function ‘perf_reader_poll’:
/usr/include/bits/poll2.h:28:12: note: in a call to function ‘__poll_chk’ declared with attribute ‘access (write_only, 1, 2)’
28 | extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
| ^
In function ‘poll’,
inlined from ‘perf_reader_poll’ at bcc/src/cc/perf_reader.c:231:7:
/usr/include/bits/poll2.h:39:10: warning: ‘__poll_chk’ specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
39 | return __glibc_fortify (poll, __nfds, sizeof (*__fds),
| ^
/usr/include/bits/poll2.h: In function ‘perf_reader_poll’:
/usr/include/bits/poll2.h:28:12: note: in a call to function ‘__poll_chk’ declared with attribute ‘access (write_only, 1, 2)’
28 | extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
| ^
In function ‘poll’,
inlined from ‘perf_reader_poll’ at bcc/src/cc/perf_reader.c:231:7:
/usr/include/bits/poll2.h:39:10: warning: ‘__poll_chk’ specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
39 | return __glibc_fortify (poll, __nfds, sizeof (*__fds),
| ^
/usr/include/bits/poll2.h: In function ‘perf_reader_poll’:
/usr/include/bits/poll2.h:28:12: note: in a call to function ‘__poll_chk’ declared with attribute ‘access (write_only, 1, 2)’
28 | extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
| ^
bcc/examples/cpp/pyperf/PyPerfUtil.cc:29:20: warning: ‘PYPERF_BPF_PROGRAM’ violates the C++ One Definition Rule [-Wodr]
29 | extern std::string PYPERF_BPF_PROGRAM;
| ^
bcc/examples/cpp/pyperf/PyPerfBPFProgram.cc:11:26: note: type ‘const struct string’ itself violates the C++ One Definition Rule
11 | extern const std::string PYPERF_BPF_PROGRAM = R"(
| ^
bcc/examples/cpp/pyperf/PyPerfBPFProgram.cc:11:26: note: ‘PYPERF_BPF_PROGRAM’ was previously declared here
bcc/examples/cpp/pyperf/PyPerfUtil.cc:28:21: warning: ‘kPy36OffsetConfig’ violates the C++ One Definition Rule [-Wodr]
28 | extern OffsetConfig kPy36OffsetConfig;
| ^
bcc/examples/cpp/pyperf/Py36Offsets.cc:11:27: note: type ‘const struct OffsetConfig’ itself violates the C++ One Definition Rule
11 | extern const OffsetConfig kPy36OffsetConfig = {
| ^
bcc/examples/cpp/pyperf/PyPerfType.h:74:3: note: the incompatible type is defined here
74 | } OffsetConfig;
| ^
bcc/examples/cpp/pyperf/Py36Offsets.cc:11:27: note: ‘kPy36OffsetConfig’ was previously declared here
11 | extern const OffsetConfig kPy36OffsetConfig = {
| ^
In function ‘poll’,
inlined from ‘perf_reader_poll’ at bcc/src/cc/perf_reader.c:231:7:
/usr/include/bits/poll2.h:39:10: warning: ‘__poll_chk’ specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
39 | return __glibc_fortify (poll, __nfds, sizeof (*__fds),
| ^
/usr/include/bits/poll2.h: In function ‘perf_reader_poll’:
/usr/include/bits/poll2.h:28:12: note: in a call to function ‘__poll_chk’ declared with attribute ‘access (write_only, 1, 2)’
28 | extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
| ^
In function ‘poll’,
inlined from ‘perf_reader_poll’ at bcc/src/cc/perf_reader.c:231:7:
/usr/include/bits/poll2.h:39:10: warning: ‘__poll_chk’ specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
39 | return __glibc_fortify (poll, __nfds, sizeof (*__fds),
| ^
/usr/include/bits/poll2.h: In function ‘perf_reader_poll’:
/usr/include/bits/poll2.h:28:12: note: in a call to function ‘__poll_chk’ declared with attribute ‘access (write_only, 1, 2)’
28 | extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
| ^
In function ‘poll’,
inlined from ‘perf_reader_poll’ at bcc/src/cc/perf_reader.c:231:7:
/usr/include/bits/poll2.h:39:10: warning: ‘__poll_chk’ specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
39 | return __glibc_fortify (poll, __nfds, sizeof (*__fds),
| ^
/usr/include/bits/poll2.h: In function ‘perf_reader_poll’:
/usr/include/bits/poll2.h:28:12: note: in a call to function ‘__poll_chk’ declared with attribute ‘access (write_only, 1, 2)’
28 | extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
| ^
In function ‘poll’,
inlined from ‘perf_reader_poll’ at bcc/src/cc/perf_reader.c:231:7:
/usr/include/bits/poll2.h:39:10: warning: ‘__poll_chk’ specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
39 | return __glibc_fortify (poll, __nfds, sizeof (*__fds),
| ^
/usr/include/bits/poll2.h: In function ‘perf_reader_poll’:
/usr/include/bits/poll2.h:28:12: note: in a call to function ‘__poll_chk’ declared with attribute ‘access (write_only, 1, 2)’
28 | extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
| ^
In function ‘poll’,
inlined from ‘perf_reader_poll’ at bcc/src/cc/perf_reader.c:231:7:
/usr/include/bits/poll2.h:39:10: warning: ‘__poll_chk’ specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
39 | return __glibc_fortify (poll, __nfds, sizeof (*__fds),
| ^
/usr/include/bits/poll2.h: In function ‘perf_reader_poll’:
/usr/include/bits/poll2.h:28:12: note: in a call to function ‘__poll_chk’ declared with attribute ‘access (write_only, 1, 2)’
28 | extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
| ^
In function ‘poll’,
inlined from ‘perf_reader_poll’ at bcc/src/cc/perf_reader.c:231:7:
/usr/include/bits/poll2.h:39:10: warning: ‘__poll_chk’ specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
39 | return __glibc_fortify (poll, __nfds, sizeof (*__fds),
| ^
/usr/include/bits/poll2.h: In function ‘perf_reader_poll’:
/usr/include/bits/poll2.h:28:12: note: in a call to function ‘__poll_chk’ declared with attribute ‘access (write_only, 1, 2)’
28 | extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
| ^
In function ‘poll’,
inlined from ‘perf_reader_poll’ at bcc/src/cc/perf_reader.c:231:7:
/usr/include/bits/poll2.h:39:10: warning: ‘__poll_chk’ specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
39 | return __glibc_fortify (poll, __nfds, sizeof (*__fds),
| ^
/usr/include/bits/poll2.h: In function ‘perf_reader_poll’:
/usr/include/bits/poll2.h:28:12: note: in a call to function ‘__poll_chk’ declared with attribute ‘access (write_only, 1, 2)’
28 | extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
| ^
In function ‘poll’,
inlined from ‘perf_reader_poll’ at bcc/src/cc/perf_reader.c:231:7:
/usr/include/bits/poll2.h:39:10: warning: ‘__poll_chk’ specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
39 | return __glibc_fortify (poll, __nfds, sizeof (*__fds),
| ^
/usr/include/bits/poll2.h: In function ‘perf_reader_poll’:
/usr/include/bits/poll2.h:28:12: note: in a call to function ‘__poll_chk’ declared with attribute ‘access (write_only, 1, 2)’
28 | extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
| ^
In function ‘poll’,
inlined from ‘perf_reader_poll’ at bcc/src/cc/perf_reader.c:231:7:
/usr/include/bits/poll2.h:39:10: warning: ‘__poll_chk’ specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
39 | return __glibc_fortify (poll, __nfds, sizeof (*__fds),
| ^
/usr/include/bits/poll2.h: In function ‘perf_reader_poll’:
/usr/include/bits/poll2.h:28:12: note: in a call to function ‘__poll_chk’ declared with attribute ‘access (write_only, 1, 2)’
28 | extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
| ^
In function ‘poll’,
inlined from ‘perf_reader_poll’ at bcc/src/cc/perf_reader.c:231:7:
/usr/include/bits/poll2.h:39:10: warning: ‘__poll_chk’ specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
39 | return __glibc_fortify (poll, __nfds, sizeof (*__fds),
| ^
/usr/include/bits/poll2.h: In function ‘perf_reader_poll’:
/usr/include/bits/poll2.h:28:12: note: in a call to function ‘__poll_chk’ declared with attribute ‘access (write_only, 1, 2)’
28 | extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
| ^
In function ‘poll’,
inlined from ‘perf_reader_poll’ at bcc/src/cc/perf_reader.c:231:7:
/usr/include/bits/poll2.h:39:10: warning: ‘__poll_chk’ specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
39 | return __glibc_fortify (poll, __nfds, sizeof (*__fds),
| ^
/usr/include/bits/poll2.h: In function ‘perf_reader_poll’:
/usr/include/bits/poll2.h:28:12: note: in a call to function ‘__poll_chk’ declared with attribute ‘access (write_only, 1, 2)’
28 | extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
| ^
In function ‘poll’,
inlined from ‘perf_reader_poll’ at bcc/src/cc/perf_reader.c:231:7:
/usr/include/bits/poll2.h:39:10: warning: ‘__poll_chk’ specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
39 | return __glibc_fortify (poll, __nfds, sizeof (*__fds),
| ^
/usr/include/bits/poll2.h: In function ‘perf_reader_poll’:
/usr/include/bits/poll2.h:28:12: note: in a call to function ‘__poll_chk’ declared with attribute ‘access (write_only, 1, 2)’
28 | extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
| ^
In function ‘poll’,
inlined from ‘perf_reader_poll’ at bcc/src/cc/perf_reader.c:231:7:
/usr/include/bits/poll2.h:39:10: warning: ‘__poll_chk’ specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
39 | return __glibc_fortify (poll, __nfds, sizeof (*__fds),
| ^
/usr/include/bits/poll2.h: In function ‘perf_reader_poll’:
/usr/include/bits/poll2.h:28:12: note: in a call to function ‘__poll_chk’ declared with attribute ‘access (write_only, 1, 2)’
28 | extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
| ^
In function ‘poll’,
inlined from ‘perf_reader_poll’ at bcc/src/cc/perf_reader.c:231:7:
/usr/include/bits/poll2.h:39:10: warning: ‘__poll_chk’ specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
39 | return __glibc_fortify (poll, __nfds, sizeof (*__fds),
| ^
/usr/include/bits/poll2.h: In function ‘perf_reader_poll’:
/usr/include/bits/poll2.h:28:12: note: in a call to function ‘__poll_chk’ declared with attribute ‘access (write_only, 1, 2)’
28 | extern int __poll_chk (struct pollfd *__fds, nfds_t __nfds, int __timeout,
| ^
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.