Repository activity
40458 results across all weeks
A failed systhreads hook leaves the masterlock initialised
When caml_thread_domain_initialize_hook_exn fails after st_masterlock_init, the error path calls st_masterlock_destroy but leaves m->init true. The next domain on that slot skips re-initialising the mutex and the condition and uses destroyed objects: the waits on that slot return EINVAL, the return values are ignored, and a systhread that blocks on the maste…
KC Sivaramakrishnan (@kayceesrk)A locked Mutex.t freed by the GC crashes on musl
On Alpine, a mutex left locked, as #14578 asked about, crashes the program once the GC collects it:
Thomas Gazagnaire (@samoht)A profile whose domain terminated cannot be discarded
gc.mli says a profile is implicitly stopped but not discarded when all the domains and threads sampling for it are terminated (gc.mli:611-612). If a child domain starts a profile and then terminates, the parent gets discard: profile not stopped. stop in the parent also fails, because no profile is sampling there. Hence the profile can never be discarded.
KC Sivaramakrishnan (@kayceesrk)ASAN_OPTIONS needs detect_stack_use_after_return=0
Previously I got confusing results due to having the dune cache enabled by default (so an opam reinstall dune passed with new ASAN flags, but only because dune did less work).
Török Edwin (@edwintorok)Add `String.drop_prefix` and `String.drop_suffix`
I'd also like to add String.drop_suffix and String.replace_{prefix,suffix} after discussion. I generally find them very useful, especially for scripting, e.g.:
Michael Neumann (@mneumann)Add a test measuring GC mark, sweep, promotion and compaction speeds
Ported from oxcaml/oxcaml#7161, adapted to this runtime's events and GC logging, plus a minor-collection promotion-rate measurement.
Nick Barnes (@NickBarnes)Add argument ?mkdirs to all open_* and with_open_* functions of Out_channel
This PR builds upon PR #15313.
Volker Diels-Grabsch (@vog)Add example showing rigid-variants mode is required
Add the example from #14770 showing that rigid-variants mode cannot be removed without further changes.
Stefan Muenzel (@smuenzel)Add functions `mkdirs`, `rmtree` and `with_temp_dir`
This PR adds the following 3 closely related helper functions, which I see reinvented over and over again, especially on small wrappers and code generators, where depending on a 3rd-party library just for that purpose is usually not worth it. That's why I believe these are perfect candidates for Stdlib:
Volker Diels-Grabsch (@vog)Add runtime-events counters for per-slice sweep and mark work
Add a couple of per-slice runtime events, reporting the amount of sweep and mark work done during a major GC slice. This will enable GC rate measurement to be done entirely from the runtime events stream (e.g. in another process): see #15280.
Nick Barnes (@NickBarnes)Allocate the continuation of perform after evaluating its argument
Fix for #15196.
Tim McGilchrist (@tmcgilchrist)Array.concat leaks its temporaries when a poll raises
generic_array_concat on more than 16 arrays allocates three temporary arrays and frees them only after gather returns (array.c:677-718). The major path of gather ends with caml_process_pending_actions_with_root (array.c:590). That may run a memprof callback or a signal handler that raises, and the temporaries are then leaked. The two Invalid_argument raises …
KC Sivaramakrishnan (@kayceesrk)Atomic locs allow unsound writes to polymorphic record fields
[%atomic.loc] into a polymorphic record field can be used to implement Obj.magic (h/t @nathanfarlow).
Ryan Tjoa (@rtjoa)Bring FlexDLL in tree
Bring the FlexDLL https://github.com/ocaml/flexdll code into the tree, replacing the Git submodule.
Nicolás Ojeda Bär (@nojb)Bytecode Dynlink from two domains loses a module global
Loading bytecode plugins concurrently from two domains occasionally loses a plugin's global. A later plugin that reads it then fails to link:
KC Sivaramakrishnan (@kayceesrk)CI: fix MSVC build by using the `clang-cl` bundled with Visual Studio
Make sure to use the version of clang-cl shipped with Visual Studio rather than the one installed in the runner image, which can be older than the minimum version required by the STL headers.
Nicolás Ojeda Bär (@nojb)Callback.register leaves named_value_lock held after OOM
caml_register_named_value takes named_value_lock and then allocates the new entry with caml_stat_alloc (callback.c:394-408). The allocation raises Out_of_memory before the unlock at callback.c:415. The lock stays held, and because it is a plain platform mutex, not an error-checking one, locking it again from the same thread hangs instead of failing. Every la…
KC Sivaramakrishnan (@kayceesrk)Check whether vsnprintf_l succeeded in caml_alloc_sprintf_l
Fixes #15251.
Prakhand Patel (@Shivaay19)Concurrent ocamlyacc parsers can crash
Two ocamlyacc parsers running on different domains can read each other's token payloads at the wrong type and segfault. Reproduced on 5.5.0 and trunk f0c1023333, macOS arm64.
KC Sivaramakrishnan (@kayceesrk)Constant array indices can bypass native bounds checks
Native array access at index 2^54 returns the first element instead of raising Invalid_argument. Found with DeepSeek v4.1 Flash 1017. Reproduced on 5.5.0 and trunk f0c1023333, macOS arm64:
KC Sivaramakrishnan (@kayceesrk)