5142 Commits
Author SHA1 Message Date
Calvin Rose b80a5a9d94 Update CHANGELOG for 1.43.1 release v1.43.1 2026-11-22 10:44:50 -06:00
Calvin Rose 2e3039acfe Formatting. 2026-11-22 10:42:43 -06:00
nabeel-dev21 89269acd6b fix stack overflow in ffi/signature with more than 32 argument types (#1941)
* fix stack overflow in ffi/signature with more than 32 argument types

* size ffi signatures by argument count instead of capping at 32
2026-11-21 09:30:32 -06:00
nabeel-dev21 8c51aff7c0 reject funcdef references to a def that is still being unmarshalled (#1943)
* size funcdef environments before unmarshalling its constants

* reject funcdef references to a def that is still being unmarshalled
2026-11-21 09:22:27 -06:00
Calvin Rose d8d3727445 Address #1946 - bad environment variable escaping on windows.
We had the correct logic for posix, but were missing it for the windows
implementation.
2026-11-21 08:33:57 -06:00
nabeel-dev21 3a35438306 trap INT64_MIN / -1 in int/s64 div and mod (#1945) 2026-11-18 21:04:01 -06:00
Calvin Rose 187844bdb8 Address #1942 - fix unix addresses overflowing.
Also fixes a related memory leak with unpacking unix addresses.
2026-11-18 20:54:34 -06:00
nabeel-dev21 ec71f781ef fix int32 overflow in array/remove and memcmp range checks (#1944)
at + n in array/remove and offset + len in memcmp could overflow and
pass the range check. Compare against the remaining length instead.
2026-11-18 19:45:45 -06:00
Calvin Rose 538f2579f7 Revert "Address #1935"
This reverts commit 1f163d4d44.
2026-11-15 10:24:26 -06:00
Calvin Rose 2941c74f34 Allow setting optimization level to asm. 2026-11-14 10:52:47 -06:00
Calvin Rose 284619edd1 Formatting. 2026-11-13 21:31:28 -06:00
Alex Alejandre a4b032661e Give vm loop indexed? ds fast path to skip generic accessor calls (#1901)
JOP_IN JOP_GET JOP_GET_INDEX JOP_PUT_INDEX JOP_NEXT handle arrays and tuples
without calling janet_in, janet_get, janet_getindex, janet_putindex, janet_next_impl.
As this inline case can't raise or allocate to the fiber stack, it can skip vm_commit
and reloading the stack!

The same approach works for strings and buffers, but strings share an implementation
with symbols and keywords, requiring some extra checks. I built the switch to avoid
slow downs due to such checks (for dictionary? ds) but stringly types aren't on
the hot path and expanding JOP_IN and JOP_GET's implementation seems worse than the gain.
2026-11-13 21:30:31 -06:00
nabeel-dev21 f63f7ccdf3 fix stack over-read in os/strftime when the result does not fit (#1938) 2026-11-07 12:46:26 -06:00
Calvin Rose c4a803c8fb Don't update cosmo build. 2026-11-07 11:40:20 -06:00
Calvin Rose e4b5045683 Prepare for 1.43.0 release v1.43.0 2026-11-07 08:53:57 -06:00
Calvin Rose 1f163d4d44 Address #1935
Make FFI signatures shared between threads.
2026-11-03 21:21:11 -06:00
Calvin Rose 7195808230 Compiler warnings. 2026-11-03 21:17:43 -06:00
nabeel-dev21 5ba1950150 reserve a slot for structarg and namedargs in janet_verify (#1936) 2026-11-03 21:16:26 -06:00
Calvin Rose 36706b5e6d Allow the old code to still compile, just disable inlining. 2026-11-01 16:20:08 -06:00
Calvin Rose 9538ed2a52 Check jump target overflow.
Found by a fuzzer and manually simplified. Comparison operators have
custom inlining code that wasn't checking the distance between jump
targets before compiling.
2026-11-01 16:14:21 -06:00
Calvin Rose a2c0d0c892 Macos-14 deprecated 2026-10-31 18:37:46 -05:00
Calvin Rose 79950f5f43 Add SECURITY.md 2026-10-31 18:35:35 -05:00
Calvin Rose a5e5d20493 Make the traversal code for shallow and deeep keys the same.
The old code had a quirk where it implicitly assumed that the capacity
was a power of 2. This actually isn't always the case for huge tables
but the side effect was just a bad distribution of keys in that case.

Either way, seems better to make sure the traversal code doesn't
diverge. Splitting into *_shallow and *_deep implementations shows the
logic better as well for the optimization.
2026-10-29 22:48:32 -05:00
74b07bdd8d validate channel image before allocating in janet_chanat_unmarshal (#1934)
* validate channel image before allocating in janet_chanat_unmarshal

Fix panic by changing allocation order of abstract and channel.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Calvin Rose <calsrose@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-10-29 19:48:18 -05:00
Calvin Rose cdcf00f35c make peg check more paranoid, check at runtime too 2026-10-29 18:18:39 -05:00
nabeel-dev21 6f49ba66af reject unmarshalled fiber with no stack frames but resumable status (#1933) 2026-10-28 20:32:56 -05:00
nabeel-dev21 42afbe8104 reject out-of-range named argument count in janet_verify (#1932) 2026-10-27 18:51:50 -05:00
Calvin Rose 85f3cbb31f A simpler, peg only alternative to the buffer-pin branch. 2026-10-26 00:46:18 -05:00
Calvin Rose afdff116f0 Allow bundle collisions with directories
Two bundles can now share a directory created with the same permissions.
When removing bundles, each package installs a unique ".keep" file that
must be removed before the outer directory can be removed. If we failed
to delete a directory during cleanup, it is likely because it still has
contents from other packages. The keep file means that adding directory
will also add at least 1 child file.
2026-10-25 09:49:32 -05:00
nabeel-dev21 15fbfc9e49 fix use-after-free formatting a buffer into itself with %s (#1929) 2026-10-25 07:57:06 -05:00
nabeel-dev21 8132a7368e reject out-of-range captured environment index in janet_verify (#1926)
* reject out-of-range captured environment index in janet_verify

* treat any negative env index as capture-current-frame in the vm
2026-10-24 09:26:12 -05:00
nabeel-dev21 4475a3d51c validate captured env before reading locals in debug/stack (#1928) 2026-10-24 09:13:19 -05:00
nabeel-dev21 dc0f243bb9 reject short sourcemap and symbolmap entries in janet_asm1 (#1927) 2026-10-23 18:21:37 -05:00
Calvin Rose cc57cf5bd7 Redo cleanup for too many closures.
With more fuzzing data and closer inspection, seems we were just not
properly balancing scope pops. Handling a NULL pop just hid the issue.
2026-10-23 05:35:41 -05:00
Calvin Rose e98c33b6b6 Handle compiler failure cleanup better.
After adding the "too many closures" error, we tried to pop a NULL scope
during cleanup - this can segfault. Handle bad scope state better during
cleanup.
2026-10-23 05:19:55 -05:00
nabeel-dev21 a2fa318663 reject function env count that disagrees with funcdef in unmarshal (#1925) 2026-10-22 20:49:50 -05:00
Calvin Rose 9281343716 Fix #1918 - Generalize the fix for compiler configurations where pointer size is not
the same as our register size.

Mostly for x32, but gets rid of the hard-coded ifdef with logic that
calls out the issue and makes it clear what assumptions we are making.
2026-10-21 21:29:15 -05:00
Calvin Rose 2ff6b2cec0 Raise a compile error on too many closures.
Previously, we had silent miscompiles in some cases.

The ideal fix is to let us reference upvalues beyond slot 255. One way
would be to add a new instruction pair that would reference a 16-bit
constant index, which would itself encode a pair of at least 16 bit
values instead of the current instruction which encodes a pair of 8 bit
values.
2026-10-21 18:16:42 -05:00
nabeel-dev21 3606abc6d7 reject oversized bytecode length in peg unmarshal (#1921)
* reject oversized bytecode length in peg unmarshal

* trim peg unmarshal size check and cover the abstract header
2026-10-19 20:01:47 -05:00
Calvin Rose 914e3b7cc8 clunky language 2026-10-17 08:00:27 -05:00
nabeel-dev21 aebd5d71b7 reject negative argument index in peg unmarshal (#1920) 2026-10-17 07:30:45 -05:00
jcates14andjcates 6e4217836a Register streams with the event loop on unmarshal on all Unix backends (#1919)
Streams sent to another thread with ev/thread were only re-registered with the receiving thread's event loop on the poll backend. On kqueue and epoll, waiting on them hung forever, and on epoll closing them raised "No such file or directory".

Co-authored-by: jcates <jcates@>
2026-10-16 21:21:19 -05:00
Calvin Rose b7e32da0aa Formatting. 2026-10-10 13:21:42 -05:00
Calvin Rose af2471cefb peg undefined behavior fixes. 2026-10-10 11:39:05 -05:00
sogaiuandsogaiu b61531881b Update man page and tweak a bit (#1917)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
2026-10-09 18:34:50 -05:00
Alex Alejandre 246951c809 Add cffi support to x32 (#1911) 2026-10-08 08:07:21 -05:00
Arthur Chan 8357f71519 OSS-Fuzz: Add new fuzzer targets assembly process (#1913)
Signed-off-by: Arthur SC Chan <arthur.chan@adalogics.com>
2026-10-08 08:01:48 -05:00
Arthur Chan f73474eb2f OSS-Fuzz: Update fuzz_fiber for breakpoint calls (#1912)
Signed-off-by: Arthur SC Chan <arthur.chan@adalogics.com>
2026-10-08 08:01:30 -05:00
Alex Alejandre 78f5996fcf Protect against different vector widths (#1909)
GCC aligns alloca to the widest enabled vector type (16 bytes, 32 with avx,
64 with avx-512). With AVX the block address is `lea 0x1f(%rsp)` rounded down
to the nearest 32-divisible, but half the time the block starts 16 bytes higher
so the function reads the stack arguments 2 slots away from where it should.
Without AVX the address is `lea 0xf(%rsp)` which is the stack pointer.
2026-10-07 21:55:15 -05:00
Arthur Chan 3bc551a29d OSS-Fuzz: Add new fuzzer targets fiber functions (#1908)
Signed-off-by: Arthur SC Chan <arthur.chan@adalogics.com>
2026-10-07 07:50:34 -05:00