Systemd/src/test
Christian Göttsche c8f12abc73 Fix clang-11 issues
Tested with clang 11.0.0-++20200715043845+0e377e253c1-1~exp1 on Debian sid

../src/network/test-networkd-conf.c:104:56: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
        test_config_parse_duid_rawdata_one(BYTES_0_128 + 2, 0, &(DUID){0, 128, BYTES_1_128});
                                           ~~~~~~~~~~~~^~~
../src/network/test-networkd-conf.c:104:56: note: use array indexing to silence this warning
        test_config_parse_duid_rawdata_one(BYTES_0_128 + 2, 0, &(DUID){0, 128, BYTES_1_128});
                                                       ^
                                           &           [  ]
1 warning generated.

../src/test/test-clock.c:52:17: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
                ftruncate(fileno(f), 0);
                ^~~~~~~~~ ~~~~~~~~~~~~
1 warning generated.

(gdb) run
Starting program: systemd/build/test-alloc-util
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
x1: 0x7fffffffd2d0
x2: 0x7fffffffdac0
y: 0x7fffffffd2cc
z: 0x7fffffffd2c0
cleanup2(0x7fffffffd2cc)
cleanup3(0x7fffffffd2c0)
cleanup1(0x7fffffffdac0)
cleanup1(0x7fffffffd2d0)
*** buffer overflow detected ***: terminated

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt full
        set = {__val = {0, 18446744073709551615, 0, 0, 0, 0, 140737348658240, 140737348659520, 0, 0, 0, 0, 0, 0, 0, 0}}
        pid = <optimized out>
        tid = <optimized out>
        ret = <optimized out>
        save_stage = 1
        act = {__sigaction_handler = {sa_handler = 0x22ff0, sa_sigaction = 0x22ff0}, sa_mask = {__val = {140737349888603, 4217127, 4217127, 4217127, 4217127, 4217383, 0, 0, 0, 0, 143329, 143344, 140737351162752, 8959, 18446744073709551328, 4289072}},
          sa_flags = -138460788, sa_restorer = 0xffffffffffffffff}
        sigs = {__val = {32, 0 <repeats 15 times>}}
        ap = {{gp_offset = 24, fp_offset = 0, overflow_arg_area = 0x7fffffffd280, reg_save_area = 0x7fffffffd210}}
        fd = <optimized out>
        list = <optimized out>
        nlist = <optimized out>
        cp = <optimized out>
No locals.
No locals.
No locals.
No locals.
No locals.
        l = 0
No locals.
        p1 = 0x405500 "\223Nd\n\351\301mA\214\262A\247\306b\276\317\327\353\346k\035\024\273{\276&!kλ\233\217\t\207\276\327\347\351\355\307R\276\063{\235w=\237E\357\277KL\245\374\245\066M\201+\333\064\272\332g>1<@"
        p2 = <optimized out>
        i = <optimized out>
No locals.
2020-07-26 11:32:06 +02:00
..
generate-sym-test.py journal: properly mark two definitions that are deprecated with GCC attributes for that 2020-01-31 15:02:00 +01:00
meson.build test: increase timeout for test-path 2020-07-22 12:12:36 +02:00
test-acl-util.c util-lib: split out all temporary file related calls into tmpfiles-util.c 2018-12-02 13:22:29 +01:00
test-af-list.c tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
test-alloc-util.c Fix clang-11 issues 2020-07-26 11:32:06 +02:00
test-architecture.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-arphrd-list.c basic/arphrd: stop discriminating against NETROM and CISCO 2019-09-25 12:17:51 +02:00
test-ask-password-api.c shared/ask-password-api: show "(press TAB for no echo)" 2020-02-06 10:51:24 +01:00
test-async.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-barrier.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-bitmap.c tree-wide: drop copyright headers from frequent contributors 2018-06-20 11:58:53 +02:00
test-boot-timestamps.c test: Skip test-boot-timestamps on permission denied 2020-05-06 22:01:50 +02:00
test-bpf-devices.c tree-wide: avoid some loaded terms 2020-06-25 09:00:19 +02:00
test-bpf-firewall.c tests: move unit files to units/ subdirectory 2020-03-19 16:23:27 +01:00
test-btrfs.c tree-wide: fix spelling of lookup and setup verbs 2020-03-03 15:02:53 +01:00
test-bus-util.c bus-util: drop now-unused functions 2018-09-20 16:52:02 +02:00
test-calendarspec.c calendarspec: be more graceful with two kinds of calendar expressions 2020-05-05 08:57:14 +02:00
test-cap-list.c basic/cap-list: reduce scope of variables 2020-07-10 16:55:24 +02:00
test-capability.c basic/capability-util: let cap_last_cap() return unsigned integer 2020-07-10 16:55:24 +02:00
test-cgroup-cpu.c core: add CPUQuotaPeriodSec= 2019-02-14 11:04:42 -08:00
test-cgroup-mask.c tests: move unit files to units/ subdirectory 2020-03-19 16:23:27 +01:00
test-cgroup-setup.c tests: various small fixes for strict systems 2020-04-26 20:18:48 +02:00
test-cgroup-unit-default.c tests: Fix description of test units 2020-06-02 18:59:47 +02:00
test-cgroup-util.c test: fix potential use-after-free 2020-05-04 17:10:18 +02:00
test-cgroup.c test-cgroup: skip if /sys/fs/cgroup unknown fs 2020-04-25 10:00:43 +02:00
test-chase-symlinks.c log: introduce log_parse_environment_cli() and log_setup_cli() 2020-06-24 16:49:26 +02:00
test-chown-rec.c core: drop suid/sgid bit of files/dirs when doing recursive chown 2019-03-26 08:29:37 +01:00
test-clock.c Fix clang-11 issues 2020-07-26 11:32:06 +02:00
test-condition.c condition: add ConditionEnvironment= 2020-05-15 16:05:33 +02:00
test-conf-files.c basic/conf-files: make conf_files_list() take just a single directory 2019-09-16 09:15:05 +02:00
test-conf-parser.c conf-parser: return mtime in config_parse() and friends 2020-06-02 19:32:20 +02:00
test-copy.c tests: various small fixes for strict systems 2020-04-26 20:18:48 +02:00
test-coredump-util.c Add parser and printer for coredump filter mask 2020-04-09 12:51:41 +02:00
test-cpu-set-util.c core: add support for setting CPUAffinity= to special "numa" value 2020-03-16 08:57:28 +01:00
test-daemon.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-date.c tree-wide: drop double newline 2019-11-04 00:30:32 +09:00
test-dev-setup.c inaccessible: move inaccessible file nodes to /systemd/ subdir in runtime dir always 2020-06-09 16:23:56 +02:00
test-device-nodes.c tree-wide: drop copyright lines for more authors 2018-06-22 16:39:45 +02:00
test-dissect-image.c dissect: support single-filesystem verity images with external verity hash 2020-06-09 12:19:21 +01:00
test-dlopen.c Drop my copyright headers 2018-06-14 13:03:20 +02:00
test-dns-domain.c resolve: reject host names with leading or trailing dashes in /etc/hosts 2018-12-10 09:56:56 +01:00
test-ellipsize.c tree-wide: drop copyright headers from frequent contributors 2018-06-20 11:58:53 +02:00
test-emergency-action.c units: allow and use SuccessAction=exit-force in system systemd-exit.service 2018-10-17 19:32:07 +02:00
test-engine.c tests: move unit files to units/ subdirectory 2020-03-19 16:23:27 +01:00
test-env-file.c test-unit-file: move some tests to new test-env-file.c 2019-07-19 16:51:14 +02:00
test-env-util.c tree-wide: drop double newline 2019-11-04 00:30:32 +09:00
test-escape.c shared/escape: add new escape style with \n\t escaped 2020-04-09 09:58:10 +02:00
test-exec-util.c tests: various small fixes for strict systems 2020-04-26 20:18:48 +02:00
test-execute.c tree-wide: avoid some loaded terms 2020-06-25 09:00:19 +02:00
test-exit-status.c tree-wide: various code-formatting improvements 2019-09-22 07:17:27 +02:00
test-extract-word.c tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
test-fd-util.c test: Use assert_se() where variables are only checked by assert 2020-05-06 23:03:25 +02:00
test-fdset.c util-lib: split out all temporary file related calls into tmpfiles-util.c 2018-12-02 13:22:29 +01:00
test-fileio.c fileio: add support for read_full_file() on AF_UNIX stream sockets 2020-07-21 10:23:44 +02:00
test-firewall-util.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-format-table.c test-format-table: add tests for TABLE_STRV 2020-01-15 11:52:40 +09:00
test-format-util.c test: fix argument type of test_format_bytes_one() 2019-06-27 10:31:55 +09:00
test-fs-util.c test-fs-util: use log_info instead of printf 2020-07-14 22:18:38 +02:00
test-fstab-util.c tree-wide: Initialize _cleanup_ variables if needed 2020-05-13 22:56:42 +02:00
test-gcrypt-util.c Fix SPDX license tags 2018-06-14 13:05:41 +02:00
test-glob-util.c tree-wide: drop glob.h when glob-util.h is included 2019-11-04 00:30:32 +09:00
test-hash.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-hashmap-ordered.awk
test-hashmap-plain.c basic/hashmap: make _ensure_allocated return 1 on actual allocations 2020-05-27 16:48:04 +02:00
test-hashmap.c basic/hashmap: allow NULL values in strdup hashmaps and add test 2020-05-06 16:56:42 +02:00
test-hexdecoct.c Delete duplicate lines 2019-01-12 16:02:26 +01:00
test-hostname-util.c Add %l as specifier for the hostname without any domain component 2020-05-07 17:36:44 +02:00
test-hostname.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
test-id128.c id128: introduce ID128_UUID_STRING_MAX for sizing UUID buffers 2019-12-10 11:56:18 +01:00
test-in-addr-util.c test: add tests for test_in_addr_prefix_to_string() 2019-03-04 23:45:07 +09:00
test-install-root.c shared/install: do not require /dev/null to be present in chroots 2020-07-05 20:06:22 +02:00
test-install.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-io-util.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
test-ip-protocol-list.c test: add tests for ip_protocol_{from,to}_name() 2018-12-02 06:13:47 +01:00
test-ipcrm.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-job-type.c core: add helper function to check job status 2019-10-01 15:05:27 +02:00
test-journal-importer.c tests: move unit files to units/ subdirectory 2020-03-19 16:23:27 +01:00
test-json.c json: use our regular way to turn off compiler warnings 2020-05-25 18:23:50 +02:00
test-libmount.c Add helper function for mnt_table_parse_{stream,mtab} 2019-04-23 23:29:29 +02:00
test-libudev.c tree-wide: drop stdio.h when stdio-util.h is included 2019-11-04 00:30:32 +09:00
test-list.c tree-wide: beautify remaining copyright statements 2018-06-14 10:20:21 +02:00
test-load-fragment.c test: Test memory limit parsing 2020-06-24 23:16:11 +02:00
test-local-addresses.c netlink: move local-addresses.[ch] to src/shared 2019-07-24 09:06:50 +02:00
test-locale-util.c locale-util: add support for touch emoji 2020-07-01 11:17:27 +02:00
test-log.c basic/log: add a define for path relative to source root 2019-07-04 10:27:19 +02:00
test-loopback.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-mount-util.c Split out part of mount-util.c into mountpoint-util.c 2018-11-29 21:03:44 +01:00
test-mountpoint-util.c test-mountpoint-util: improve output a bit 2019-09-24 15:22:28 +02:00
test-namespace.c pid1: create ro private tmp dirs when /tmp or /var/tmp is read-only 2020-07-14 19:47:15 +02:00
test-netlink-manual.c tree-wide: drop libkmod.h when module-util.h is included 2019-11-04 00:30:32 +09:00
test-ns.c core: add RootHashSignature service parameter 2020-06-25 08:45:21 +01:00
test-nscd-flush.c shared: add helper for flushing nscd caches 2018-12-15 12:10:19 +01:00
test-nss.c tree-wide: replace if_indextoname() with format_ifname() 2019-05-29 14:21:19 +09:00
test-offline-passwd.c Move offline-password.[ch] to shared and add test-offline-passwd 2020-07-18 14:14:19 +02:00
test-ordered-set.c test-ordered-set: add a case where we get 0 for duplicate entries 2020-07-23 15:47:21 +02:00
test-os-util.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-parse-util.c tests: beef up integer parsing tests 2020-06-05 15:56:32 +02:00
test-path-lookup.c test: Add test for setting generator paths via environment 2020-03-04 11:25:14 +01:00
test-path-util.c meson: make user $PATH configurable 2019-11-13 22:34:14 +01:00
test-path.c test-path: decrease variable scope 2020-07-22 12:12:54 +02:00
test-pretty-print.c codespell: fix spelling errors 2019-04-29 16:47:18 +02:00
test-prioq.c tree-wide: use _cleanup_set_free_ where appropriate 2020-05-06 17:08:17 +02:00
test-proc-cmdline.c tests: various small fixes for strict systems 2020-04-26 20:18:48 +02:00
test-process-util.c tree-wide: more repeated words 2020-07-07 12:08:22 +02:00
test-procfs-util.c tests: various small fixes for strict systems 2020-04-26 20:18:48 +02:00
test-random-util.c random-util: make use of GRND_INSECURE when it is defined 2020-05-10 11:15:16 +02:00
test-ratelimit.c Drop RATELIMIT macros 2019-09-20 16:05:53 +02:00
test-replace-var.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-rlimit-util.c tree-wide: drop missing.h 2019-10-31 17:57:03 +09:00
test-sched-prio.c tests: move unit files to units/ subdirectory 2020-03-19 16:23:27 +01:00
test-sd-hwdb.c tests: various small fixes for strict systems 2020-04-26 20:18:48 +02:00
test-sd-path.c sd-path: handle case of missing runtime dir in test 2020-03-27 20:12:45 +01:00
test-seccomp.c tree-wide: avoid some loaded terms 2020-06-25 09:00:19 +02:00
test-selinux.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-serialize.c util-lib: split out all temporary file related calls into tmpfiles-util.c 2018-12-02 13:22:29 +01:00
test-set-disable-mempool.c test: add tests for $SYSTEMD_MEMPOOL= 2018-10-12 17:54:23 +09:00
test-set.c basic/set: add set_ensure_consume() 2020-06-24 10:38:15 +02:00
test-sigbus.c util: split out memcmp()/memset() related calls into memory-util.[ch] 2019-03-13 12:16:43 +01:00
test-signal-util.c tree-wide: drop signal.h when signal-util.h is included 2019-11-04 00:30:32 +09:00
test-siphash24.c util: split out memcmp()/memset() related calls into memory-util.[ch] 2019-03-13 12:16:43 +01:00
test-sizeof.c macro: introduce DISABLE_WARNING_TYPE_LIMITS and make use of it everywhere 2020-05-25 18:25:09 +02:00
test-sleep.c tree-wide: Replace assert() by assert_se() when there is side effect 2020-05-10 09:23:12 +02:00
test-socket-netlink.c util-lib: move things that parse ifnames to shared/ 2020-01-11 12:07:28 +01:00
test-socket-util.c util: introduce in_addr_port_ifindex_name_from_string_auto() and in_addr_port_ifindex_name_to_string() 2020-07-21 03:55:34 +09:00
test-specifier.c test-specifier: add a simple test which prints "global" specifiers 2020-05-07 17:36:44 +02:00
test-stat-util.c tree-wide: drop missing.h 2019-10-31 17:57:03 +09:00
test-static-destruct.c test: add test for static destructor 2018-12-03 17:34:23 +01:00
test-strbuf.c tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
test-string-util.c string-util: add helper for extracting n'th line of a string 2020-01-13 16:37:42 +01:00
test-strip-tab-ansi.c shared/logs-show: strip trailing carriage returns at EOL/EOF 2019-10-29 10:54:45 +01:00
test-strv.c tree-wide: support a bunch of additional specifiers 2020-04-28 22:47:21 +02:00
test-strxcpyx.c tree-wide: drop string.h when string-util.h or friends are included 2019-11-04 00:30:32 +09:00
test-sysctl-util.c shared/sysctl-util: normalize repeated slashes or dots to a single value 2020-01-30 10:48:27 +01:00
test-systemd-tmpfiles.py codespell: fix spelling errors 2019-04-29 16:47:18 +02:00
test-tables.c udev/link-config: rename MACPolicy to MACAddressPolicy 2019-03-22 17:16:17 +01:00
test-terminal-util.c test-terminal-util: fix typo 2020-04-08 19:45:08 +02:00
test-time-util.c test: add basic test for clock mapping 2020-07-21 17:33:47 +02:00
test-tmpfiles.c util-lib: split out all temporary file related calls into tmpfiles-util.c 2018-12-02 13:22:29 +01:00
test-udev.c namespace-util: introduce helper for combining unshare() + MS_SLAVE remount 2020-07-07 11:20:42 +02:00
test-uid-range.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
test-umask-util.c tests: add test for umask-util.h 2019-04-30 09:53:09 +02:00
test-umount.c tests: various small fixes for strict systems 2020-04-26 20:18:48 +02:00
test-unaligned.c util: split out memcmp()/memset() related calls into memory-util.[ch] 2019-03-13 12:16:43 +01:00
test-unit-file.c tree-wide: drop double newline 2019-11-04 00:30:32 +09:00
test-unit-name.c unit-name: fix a potential memory leak 2020-07-06 17:13:37 +02:00
test-user-util.c test: add test for parse_uid_range() 2020-06-05 15:56:32 +02:00
test-utf8.c shared/logs-show: strip trailing carriage returns at EOL/EOF 2019-10-29 10:54:45 +01:00
test-util.c macro: add new FOREACH_POINTER() macro magic 2020-07-01 11:17:28 +02:00
test-varlink.c tests: add varlink test 2019-05-09 14:14:20 -04:00
test-verbs.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00
test-watch-pid.c tests: move unit files to units/ subdirectory 2020-03-19 16:23:27 +01:00
test-watchdog.c tests: use a helper function to parse environment and open logging 2018-09-14 09:29:57 +02:00
test-web-util.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
test-xattr-util.c util-lib: split out all temporary file related calls into tmpfiles-util.c 2018-12-02 13:22:29 +01:00
test-xdg-autostart.c xdg-autostart: ignore all empty entries in multi-string entries 2020-07-07 14:02:16 +02:00
test-xml.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00