You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
serving slots are not exported once the program depends on Net.HTTP (entrypoint case) #376
Filing for the record from kexhq/rodolfo's own bug tracker (docs/kex-issues.md#1), where this was found and fixed before it was ever filed as its own GitHub issue — opening now so there's a place to point at (and reopen from, if it ever regresses).
A serving process whose slots are called from a route handler failed on its first call, the moment the program also depended on Net.HTTP — even when nothing in the program actually called into Net.HTTP:
** exception error: {'function not exported', {Library, add, 3}}
The process started fine, and the exact same slot worked in a program that didn't touch Net.HTTP at all. Adding the dependency — directly via using Net.HTTP, or transitively via using Rodolfo — was enough to break it, regardless of whether the call site spelled the module qualified or not.
Repro (historical — already fixed, see below)
using Net.HTTP, only: [Headers]
record Counter do
n : Integer = 0
end
serving Counter do
slot add(x: Integer) -> Reply<Integer> do
new.n = @n + x
return { new, reply: new.n }
end
end
main do
let counter = Process.spawn(Counter {})
IO.printLine("${counter.add(5)}")
IO.printLine("${counter.add(3)}")
end
Root cause (as understood at the time)
The runtime dispatches slots in runtime/src/kex_intrinsic_process.erl (invoke_slot): it checks erlang:function_exported/3 for the declared arity and otherwise retries at arity + 1 with an extra #{}. Both lookups missed, which pointed at the code generator not emitting the slot exports for the compilation unit, rather than at the dispatcher itself.
Status
Fixed on 331cbb5. Re-verified independently on kex main (b913dac, 2026-09-19): the exact repro above runs correctly — add(5) → 5, add(3) → 8 — with a serving block declared directly in the entrypoint module, Net.HTTP imported alongside it either way. Verified in a multi-module layout too, so it wasn't an artifact of a single-file program.
The narrower remaining case — a serving block declared in an imported module (not the entrypoint) still fails the same way when Net.HTTP is anywhere in the program — is filed separately, since it turned out to be a distinct defect once this one was fixed.
Closing on file, since the fix is already confirmed on main.
Activity
akoskovacs commentedon Sep 19, 2026
Already fixed on
331cbb5and re-verified against currentmain(b913dac) as described above — closing on file.Cross-reference kexhq/kex#376/#377 for #1/#2