Commit Graph

14947 Commits

Author SHA1 Message Date
Jeroen van Rijn 1bd48df41f Disable test_try_select_raw_happy 2025-06-16 12:59:24 +02:00
Jeroen van Rijn d79d5237ad Merge pull request #5346 from Airtz/master
Fix typo in `error_article_table` lookup
2025-06-16 12:40:03 +02:00
Airtz fe7fbfedc0 Fix typo in error_article_table lookup 2025-06-16 12:22:03 +02:00
Jeroen van Rijn 4281dc4999 Attempt fix brew errors (#5345)
Disable macOS Intel for now.
2025-06-16 12:06:20 +02:00
Jeroen van Rijn 9c9380d158 Merge pull request #5315 from peperronii/master
Expose getpeername() in core:net package as "peer_endpoint"
2025-06-16 11:30:34 +02:00
PePerRoNii acdab793d9 Added Socket_Info_Error to Network_Error union 2025-06-16 16:17:48 +07:00
Jeroen van Rijn 795ceec2cd Merge pull request #5327 from nubunto/fix/pool-join-hangs
fix: pool_join hangs if no threads are started
2025-06-16 10:50:35 +02:00
Bruno Panuto 6874a4cdb0 fix: make pool_finish not hang when pool_start is not called 2025-06-16 00:28:43 -03:00
PePerRoNii c08d9c50c8 Changed TCP_Recv_Err to Socket_Info_Err and tested on darwin_arm64 2025-06-15 12:14:59 +07:00
PePerRoNii 42aa8ac383 Implemented _socket_info_error on peer_endpoint and bound_endpoint 2025-06-15 11:17:49 +07:00
PePerRoNii f49bf1abd2 added Socket_Info_Errors Enum 2025-06-15 10:26:06 +07:00
Jeroen van Rijn 771c1c4332 Merge pull request #5334 from Kelimion/types-checks
Add additional nullptr checks in types.cpp
2025-06-14 01:22:15 +02:00
Jeroen van Rijn cc08dca53d Add additional nullptr checks in types.cpp
Ran into a bunch of nullptr problems while reviving an 8-year old Odin problem.
2025-06-14 01:13:36 +02:00
Laytan Laats 144daf6fff add macOS Tahoe to odin report and core:sys/info 2025-06-14 00:27:37 +02:00
Laytan aa0cffb412 Merge pull request #5328 from laytan/compat-allocator-improvements
mem: compat allocator improvements
2025-06-13 19:41:58 +02:00
Jeroen van Rijn f03484e352 Merge pull request #5332 from Kelimion/replace_environment_variables
Replace core:posix usage in core:os/os2
2025-06-13 18:15:31 +02:00
Jeroen van Rijn 84eaddbd47 WASI 2025-06-13 18:08:35 +02:00
Jeroen van Rijn 8c8406cc4d stub out get_env for js 2025-06-13 18:00:30 +02:00
Jeroen van Rijn 3862555153 Replace core:posix usage in core:os/os2 2025-06-13 17:49:05 +02:00
Jeroen van Rijn fe9f74f7a2 Disable PR comments 2025-06-13 07:24:03 +02:00
Laytan fc7fc4d5cd Merge pull request #5289 from JackMordaunt/jfm-sync_chan_refactor
Jfm sync chan refactor
2025-06-12 21:51:34 +02:00
Jack Mordaunt 3c3fd6e580 tests/core/sync/chan: move global state into test
While this state is not actually needed by more than one test, we can
just make it a static variable.
2025-06-12 16:14:52 -03:00
Jack Mordaunt c1cd525d9d core/sync/chan.select_raw: call try_select_raw with deprecation warning
Eventually select_raw should be a blocking select operation, but for now
we need to migrate people away.
2025-06-12 16:14:52 -03:00
Jack Mordaunt 96b91849a9 core/sync/chan.try_select_raw: fix doc comment typo
Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
2025-06-12 16:14:52 -03:00
Jack Mordaunt 4d7c182f7d tests/core/sync/chan: test harness for chan.try_select_raw
This test harness ensures consistent non-blocking semantics and
validates that we have solved the toctou condition.

The __global_context_for_test is a bit of a hack to fuse together the
test supplied proc and the executing logic in packaage chan.
2025-06-12 16:14:52 -03:00
Jack Mordaunt faae81ba61 core/sync/chan.try_select_raw: test hook for testing the toctou
This is necessary because we need to allow the test guarantee against a
rare condition: where a third-party thread steals a value between the
validity checks can_{send,recv} and the channel operation
try_{send,recv}.
2025-06-12 16:14:52 -03:00
Jack Mordaunt 4043be8567 core/sync/chan.try_select_raw: skip nil input messages
This makes the proc easier and safer to call by letting the caller nil
out messages to skip sends.
2025-06-12 16:14:52 -03:00
Jack Mordaunt fb39e5a2f8 core/sync/chan.try_select_raw: clarify loop control flow
Use a label to clarify the continue statements.
2025-06-12 16:14:52 -03:00
Jack Mordaunt d5b7302ac0 core/sync.try_select_raw: fix TOCTOU
Fixes a TOCTOU where the channel could be used between the call to
can_{recv,send} and {recv,send} causing an unexpected blocking
operation.

To do this we use the non-blocking try_{recv,send} and retry the check
in a loop. This guarantees non-blocking select behaviour, at the cost of
spinning if the input channels are highly contended.

Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
2025-06-12 16:14:52 -03:00
Jack Mordaunt be873af003 core/sync.select_raw: rename to try_select_raw
This follows the convention where non-blocking operations are prefixed
with "try" to indicate as much.

Since select_raw in it's current form doesn't block, it should be
try_select_raw, and allow select_raw to name a blocking implementation.
2025-06-12 16:14:52 -03:00
Jack Mordaunt 7f9589922d core/sync.select_raw: return a useful index
This fixes a flaw in the original implementation: the returned index is
actually useless to the caller.

This is because the index returned refers to the internal "candidate"
list. This list is dynamic, and may not have all of the input channels
(if they weren't ready according to chan.can_{recv,send}). That means
the index is not guaranteed to mean anything to the caller.

The fix introduced here is to return the index into the input slice
(recvs,sends) and an enum to specify which input slice that is.

If no selection was made, then (-1, .None) is returned to communicate as
much.

Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
2025-06-12 16:14:51 -03:00
Laytan Laats 67a8b035db mem: compat allocator improvements
1. store alignment instead of original pointer
2. implement .Query_Info
3. poison the header and alignment portion of the allocation
4. .Resize uses `max(orig_alignment, new_alignment)` as it's alignment
   now
5. .Free passes along the original alignment
2025-06-12 20:40:22 +02:00
Laytan Laats 0ed6cdc98e mem/tlsf: fix asan reporting poisoning of already poisoned region
free on tlsf poisons the entire block, while alloc might only unpoison a
part of it (cause it's size is aligned up). This causes free to
potentially poison an already poisoned portion, which is a
use-after-poison.

Because this is "fine" and intended, I opted to just
@no_sanitize_address it.
2025-06-12 19:37:24 +02:00
Jeroen van Rijn 74f70bfbcb Comment 2025-06-12 17:09:33 +02:00
Jeroen van Rijn 298bab99a4 Merge pull request #5326 from Kelimion/fix-5321
Revert changes to thread_unix.odin
2025-06-12 16:56:29 +02:00
Jeroen van Rijn 5aa377e64e Revert changes to thread_unix.odin 2025-06-12 16:36:40 +02:00
Jeroen van Rijn b119ca0261 Merge pull request #5325 from Kelimion/fix-5321
Fix #5321
2025-06-12 16:14:01 +02:00
Jeroen van Rijn 59ba37f232 Remove transmute 2025-06-12 16:05:34 +02:00
Jeroen van Rijn 994b5a2a6c Remove c import 2025-06-12 16:01:31 +02:00
Jeroen van Rijn caf41aa046 Fix #5321 2025-06-12 16:00:24 +02:00
Jeroen van Rijn eb1b5f7d3a Merge pull request #5322 from Kelimion/fix-5321
Fix #5321 (on Windows)
2025-06-12 11:52:38 +02:00
Jeroen van Rijn ac5f3746cf Fix #5321 2025-06-12 11:30:36 +02:00
Jeroen van Rijn 50ff3fabdc Merge pull request #5317 from Feoramund/fixup-container-queue
Tidy up `core:container/queue`
2025-06-12 00:00:34 +02:00
Jeroen van Rijn a2be547dfd Merge exclude paths 2025-06-11 21:00:38 +02:00
Jeroen van Rijn 8a08edbdc7 Merge pull request #5319 from Kelimion/coverage
Add code coverage
2025-06-11 20:39:48 +02:00
Jeroen van Rijn 828d4c71d2 Now? 2025-06-11 20:33:12 +02:00
Jeroen van Rijn 921414aa74 Let's use the latest Ubuntu and a recent LLVM 2025-06-11 20:04:07 +02:00
Jeroen van Rijn 3965b2e4b4 kcov --version 2025-06-11 19:58:01 +02:00
Jeroen van Rijn 05cba0aca5 Change kcov url 2025-06-11 19:53:49 +02:00
Jeroen van Rijn d37a93cd7d Add code coverage 2025-06-11 19:43:42 +02:00