| Age | Commit message (Collapse) | Author | Lines |
|
When this happened, we tried to print a buffer with a negative length
that resulted in invalid memmove call. This fix both checks that we
don't tried to append a negative buffer, and truncates a prompt that is
too long for the termimal so that one can still enter text with at least
16 visible characters for data entry.
|
|
janet_make_threaded previously created a channel with threaded set to 0
|
|
Indentation levels are not sufficiently clear for deeply nested
data structures. Instead, align items in a collection
with its opening bracket, also known as hanging indentation.
To avoid guessing the length of a "short" collection to print it
on one line, items are now always printed on separate lines.
|
|
|
|
Still fallback to blocking connect with WSAConnect when ConnectEx is not
available or applicable, but ConnectEx is preferred and recommended by
Microsoft.
Also make some changes to our use of OVERLAPPED in various places in the
ev code, replacing all uses with JanetOverlapped. This also let's us
avoid reusing internal fields for OVERLAPPED which may or may not be
used in various places.
|
|
|
|
|
|
|
|
For unclosable files, no need to dup, but for closable files we can get
a resource leak. Valgrind and similar tools won't catch this but IO will
unexpectedly start going to the wrong descriptor if a file was
transferred to a new thread, closed, and then a new file was created.
|
|
|
|
janet_collect() marks janet_vm.root_fiber but not janet_vm.fiber.
When janet_pcall (or janet_continue) is called from a C function,
the inner fiber becomes janet_vm.fiber while root_fiber still points
to the outer fiber. If GC triggers inside the inner fiber's execution,
the inner fiber is not in any GC root set and can be collected —
including its stack memory — while actively running.
This also affects deeply nested cases: F1 -> C func -> janet_pcall ->
F2 -> C func -> janet_pcall -> F3, where F2 is saved only in a C
stack local (tstate.vm_fiber), invisible to GC.
Fix: in janet_continue_no_check, root the fiber with janet_gcroot
when this is a nested call (root_fiber already set). Each nesting
level roots its own fiber, handling arbitrary depth. Top-level calls
(event loop, REPL) skip the root/unroot entirely since root_fiber
is NULL.
Add test/test-gc-pcall.c: standalone C test covering both single
and deep nesting cases.
Co-authored-by: Brett Adams <brett@bletia-9.local>
|
|
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
|
|
|
|
This will run both clang and gcc sanitizers as part of ordinary testing.
|
|
Objects in channels are sent as messages that need to be freed by the
consumer. However, in certain cases, no consumer is available and the
messages were being discarded without properly being freed. This should
also fix `-fsanitize=address` on GCC and CLANG with the default test
suite.
|
|
|
|
|
|
This looks like it could cause deadlocks with threaded channels
(normal channels are unaffected, locking/unlocking is a no-op).
|
|
illumos, like BSD, expects IP_MULTICAST_TTL to be
an unsigned char
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
|
|
for abstract types.
Abstract types whose get/put/length/etc. implementations allocated fiber
slots could break the VM by invalidating the stack pointer in the
interpreter. This is admittedly a bit unusual but is something most
users would probably expect to work. Debugging this would be a real pain.
|
|
|
|
|
|
Be explicit when we are including this functionality. Add a function
module/add-file-extension that can do this programatically.
|
|
This usually shouldn't be needed, but in the case that it is, or if
garbage collection is triggered manually, we can prevent use-after-free.
|
|
|
|
|
|
|
|
|
|
|
|
Order of evaluation becomes more clear in some cases.
|
|
|
|
For remote connections, if you did not manually wait for the connection
to settle, the programmer would see unspecified network errors. This is
is because the underlying TCP Connection had not been established yet.
The correct way to deal with this is to use ConnectEx if available
instead of WSAConnect.
|
|
|
|
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
|
|
This was exposed when printing `(invert (range 200000))`, which
isn't so large that we shouldn't be able to sort it, but was taking
far too long to compute.
|
|
When importing full paths, the old preload code was preventing
(import <fullpath> :fresh true) from working as expected.
|
|
|
|
|
|
Thenc checked stderr for messages. Since the helper makes assert write
to stderr, this caused extra cruft in our test output.
|
|
|