Commit Graph

118 Commits

Author SHA1 Message Date
iphydf
662c2140f3
test: Add goblint static analyser. 2024-01-24 23:31:00 +00:00
iphydf
97bdd83937
refactor: Make event dispatch ordered by receive time. 2024-01-15 16:32:10 +00:00
Green Sky
acdc67387b
fix(ci): window builds now build in parallel
Co-authored-by: Maxim Biro <nurupo.contributions@gmail.com>
2024-01-14 10:01:35 -05:00
iphydf
df76f5cf47
chore: Move from gcov to llvm source-based coverage. 2024-01-12 10:27:48 +00:00
iphydf
afc38f2458
test: Add more unit tests for add_to_list. 2024-01-10 02:58:13 +00:00
iphydf
05ce5c1ab9
test: Add "infer" CI check to github, remove from circle.
This now uses our own built image with the current master of infer.
2024-01-09 10:59:53 +00:00
iphydf
b148a2afff
chore: Simplify msvc build using vcpkg. 2024-01-06 12:27:31 +00:00
iphydf
cac074c57f
chore: Add fetch-sha256 script to update bootstrap node hash.
This fetches it from github, so we don't need to build it locally.

Not super ideal, because devs are supposed to build it locally to prove
reproducibility, but we can keep that diligence on the dev to do once
when actually merging the PR.
2024-01-03 23:01:55 +00:00
iphydf
40b5fbbe9d
chore: Remove settings.yml in favour of hs-github-tools.
Centralised settings means we can update them without having to pass all
the CI checks of each repo.
2024-01-02 21:38:33 +00:00
iphydf
5407384211
cleanup: Use github actions matrix to simplify CI. 2023-12-27 14:39:17 +00:00
iphydf
6a90ddfe4e
cleanup: Run clang-tidy on headers, as well. 2023-12-27 02:37:39 +00:00
iphydf
fad6e4e173
cleanup: Make all .c files include the headers they need. 2023-12-27 01:21:47 +00:00
iphydf
ef4897a898
cleanup: Upgrade to clang-tidy-17 and fix some warnings. 2023-12-27 01:05:47 +00:00
iphydf
b7f9367f6f
test: Upgrade cppcheck, fix some warnings.
Also started teaching it about toxcore's alloc/dealloc functions in
hopes of it catching some errors (it doesn't seem to be very good at
this, but maybe better than nothing?).
2023-12-27 00:00:10 +00:00
iphydf
895a6af122
cleanup: Remove NaCl support.
We now depend on libsodium unconditionally. Future work will require
functions from libsodium, and nobody we're aware of uses the nacl build
for anything other than making sure it still works on CI.
2023-12-25 00:36:38 +00:00
iphydf
572924e924
chore: Build a docker image with coverage info in it.
We can then use that to build a coverage web UI on render.com using the
Dockerfile.nginx build.
2023-12-22 00:25:37 +00:00
iphydf
425216d9ec
fix: Correct a use-after-free and fix some memory leaks.
Also: use `find_package` to find gtest. This fixes the coverage build to
include unit tests.
2023-12-21 17:17:51 +00:00
iphydf
19d8f180d6
chore: Update github actions uses.
The old ones are going to stop working soon.
2023-12-19 20:06:15 +00:00
iphydf
68c827609a
chore: Move s390x build to post-merge.
It takes 15+ minutes and will very rarely fail, so it's not worth
blocking PRs on it.
2023-12-18 16:45:49 +00:00
iphydf
d390947245
chore: Upgrade sonar-scan jvm to java 17.
https://community.sonarsource.com/t/java-11-is-deprecated-as-a-runtime-env-to-scan-your-projects/9659
2023-11-23 11:23:54 +00:00
iphydf
814090f2b8
chore: Cancel old PR builds on docker and sonar-scan workflows.
Also, don't error on test failures on windows (they are very flaky).
2023-11-22 23:38:50 +00:00
iphydf
83efb17367
perf: Add a KVM FreeBSD build on cirrus ci. 2023-11-22 23:17:27 +00:00
iphydf
28f39049f6
chore: Retry freebsd tests 2 times.
Also, use `cmake --build` instead of manually calling `gmake`. This
allows us to maybe later use `ninja` instead of `gmake` without changing
this build invocation.

Also, increase timeout to 120 seconds. FreeBSD tests are slow.
2023-11-22 21:12:16 +00:00
iphydf
7155f7f60e
test: Add an s390x build (on alpine) for CI.
It doesn't work at all, because we're missing something in the net code
to do with endian conversions. I haven't investigated, yet, but at least
now we have a failing test that can be investigated.

Also moved to cmake 3.5 at minimum. CMake will stop supporting lower
versions than that, soon.

Also moved to C11 from C99 to get `static_assert`.

Also made a network ERROR into a WARNING. It triggers on FreeBSD.
2023-11-22 18:29:26 +00:00
iphydf
6c35cef63f
chore: Add a compcert docker run script.
Useful for local runs. Does the same as CI, so if it fails on CI, this
can be used to test locally, avoiding slow CI round trips.
2023-11-18 06:19:21 +00:00
iphydf
41e6ea865e
cleanup: Use tcc docker image for CI.
Instead of repeating the instructions in github actions configs.
2023-11-18 03:44:06 +00:00
iphydf
a549807df7
refactor: Add mem module to allow tests to override allocators.
This will allow us to do more interesting things with memory allocation
within toxcore, and allow fuzzers to explore various allocation failure
paths.
2023-08-30 22:55:05 +00:00
Robin Linden
b0f6331856
chore: Fix the Android CI job
* Bump the targeted API on armeabi and x86 to 19
  - Starting with the r24 NDK, Jelly Bean (APIs 16, 17, and 18) is no
    longer supported.

* Build libsodium w/ --disable-pie
  - Workaround for `ld: error: relocation R_386_PC32 cannot be used
    against symbol 'crypto_auth_hmacsha512_init'; recompile with -fPIC`
2023-08-16 00:59:39 +02:00
iphydf
7205db72e4
cleanup: Remove check_recursion, since tokstyle checks this now.
And tokstyle is better at it, covering not just direct recursion, but
also (most possible instances of) recursion through function pointers.
2022-05-24 21:35:16 +02:00
sudden6
6b5579239b
test: enable additional sanitizers for fuzzing 2022-04-14 20:23:29 +02:00
iphydf
19b9cf3812
test: Enable fuzzing for TCP.
If the `recvbuf` network function returns 0 all the time, that means
there is never any data available on the TCP socket. This change makes
it so there is a random amount of data available on the TCP socket.

This invalidates the bootstrap fuzzer corpus.
2022-04-14 13:19:56 +00:00
iphydf
d539e34f91
chore: Add initial ESP32 docker build.
It won't actually run until we reduce memory consumption by 2 orders of
magnitude, but that'll be the eventual goal.
2022-04-05 20:11:18 +00:00
iphydf
3576df9d79
chore: Add MISRA-2012 check using cppcheck's misra addon.
Disabled a whole bunch of rules from the MISRA-C set. Some of them
should be fixed, but most of the ones we violate have good reasons. This
PR documents those reasons.
2022-04-04 20:29:54 +00:00
iphydf
e4d1958ffa
refactor: Allow NULL logger; make it no-op in NDEBUG. 2022-04-03 18:29:22 +00:00
zugz (tox)
e49a477a84
feat: add forwarding and announce request handling
This is the "server-side" part of the new friend finding system,
allowing DHT nodes to store small amounts of data and permit searching
for it. A forwarding (proxying) mechanism allows this to be used by TCP
clients, and deals with non-transitivity in the network.
2022-04-03 00:00:08 +00:00
iphydf
b66f4959e2
chore: Add dependabot config.
To keep the third_party/cmp submodule up-to-date.
2022-04-03 08:45:09 +00:00
iphydf
660e346fce
cleanup: Disallow stack frames of over 9000 bytes.
This only happens in tests, which are easy to fix. Inside toxcore we
should actually be more stringent, but for now this helps already.
2022-04-01 13:57:16 +00:00
iphydf
09575dc05b
chore: Clone submodules in clusterfuzzlite Dockerfile.
Needed for the build afterwards.

Also added the cflite Dockerfile to automatic CI builds so changes to it
are checked in pull requests.

Also fixed the tokstyle docker image. It needs clang instead of gcc now.
2022-03-30 18:29:46 +00:00
iphydf
2e3819c956
chore: Remove valgrind build.
This is very slow, around 20 minutes, which seriously slows down
velocity for little gain. MSAN runs on unit tests and 1 auto test, so
we'll catch increasingly many valgrind-ish bugs that way in one of the
1-5-minute builds.
2022-03-29 12:53:02 +00:00
iphydf
96ab8918dc
cleanup: Use _Static_assert in gcc/clang.
Hopefully they don't throw warnings at us.
2022-03-27 18:18:33 +00:00
iphydf
ee154da4a9
refactor: Use cmp instead of msgpack-c for events packing.
This library is better in every way.
2022-03-26 23:57:15 +00:00
iphydf
7dde71c4e9
chore: Use "master" as the branch in toktok-fuzzer.
This is the standard across toktok repos. Exceptions are a pain for
automation and tooling.
2022-03-23 23:03:52 +00:00
jfreegman
26c2bb1061
Merge onion_announce changes from new groupchats fork
These changes will make the DHT compatible with the new groupchat
implementation. Additionally, onion announces now support arbitrary
extra data
2022-03-20 17:33:06 -04:00
iphydf
9df7bf7ccd
chore: Add testing/Dockerfile to the CI build. 2022-03-08 20:31:39 +00:00
iphydf
e1e92c1ac1
docs: Clean up doxygen comments to be more doxygen-like. 2022-03-05 22:30:48 +00:00
iphydf
e855135916
chore: Enable a bunch more warnings in GCC builds.
g++ doesn't emit these warnings properly, so the `run-gcc` tool, which
compiles code as C++, doesn't work for all of these. There are a few
builds that do use GCC, e.g. the sonar-scan build, so these flags will
be passed at some point in CI.
2022-02-28 23:26:35 +00:00
iphydf
093927ba4f
test: Add mallocfail and proxy test to our coverage runs. 2022-02-25 01:55:28 +00:00
iphydf
2ce6f5b169
fix: Report failure to DHT bootstrap back to the client.
Also reduce log verbosity a bit.
2022-02-24 11:37:47 +00:00
iphydf
b7f95bbe70
cleanup: Remove any disallowed casts.
The ones in toxav weren't needed. The ones in network.c are
non-trivially correct. Now, the code is more easily verifiable.
2022-02-22 02:19:29 +00:00
iphydf
a6426d7e7a
chore: Make coverity scan a nightly job.
Instead of on every push. It only produces results once a day anyway.
2022-02-19 02:47:36 +00:00