Repository navigation
Description
Bug Description
Using the latest WSL versions typesense docker image is not working anymore. i did not test default installation but i guess it would have the same problem.
WSL-Version: 3.0.1.0
Kernelversion: 6.18.40.1-1
Error is "Segmentation fault".
Reproduction Steps
On a windows machine using the latest WSL version run the image inside wsl
docker run typesense/typesenseExpected vs Actual
Expected behavior
typesense should start up
Actual behavior
Segmentation fault.
Environment
- Typesense version: 31.1 and 30.1
Additional Context
i got claude opus 5.5 to fix this issue by building new container image and LD_PRELOAD a helper class. It describes the problem like this:
Cause: The issue is with the WSL kernel 6.18.40.1-microsoft-standard-WSL2. It was built without CONFIG_TASKSTATS, which means that the file /proc/self/io does not exist.
Typesense uses the brpc library internally, and brpc reads this file during program startup. When the file is missing, brpc tries to log an error before the logging system is initialized, causing it to crash.
That is why even --version resulted in an immediate segfault, with no output at all, across all versions from 27.1 through 30.1.
I confirmed this with a gdb backtrace.
dockerfile:
ARG TYPESENSE_VERSION=30.1
FROM ubuntu:22.04 AS shim
RUN apt-get update && apt-get install -y --no-install-recommends gcc libc6-dev && rm -rf /var/lib/apt/lists/*
COPY procio-shim.c /src/
RUN gcc -O2 -shared -fPIC -o /src/procio-shim.so /src/procio-shim.c -ldl
FROM typesense/typesense:${TYPESENSE_VERSION}
COPY --from=shim /src/procio-shim.so /usr/local/lib/procio-shim.so
ENV LD_PRELOAD=/usr/local/lib/procio-shim.so
procio-shim.so
// WSL kernels built without CONFIG_TASKSTATS have no /proc/<pid>/io.
// brpc (used by typesense) reads it during static init and segfaults when it is missing.
#define _GNU_SOURCE
#include <dlfcn.h>
#include <stdio.h>
#include <string.h>
static const char FAKE_IO[] =
"rchar: 0\nwchar: 0\nsyscr: 0\nsyscw: 0\n"
"read_bytes: 0\nwrite_bytes: 0\ncancelled_write_bytes: 0\n";
static int is_proc_io(const char *path) {
if (!path) return 0;
if (strcmp(path, "/proc/self/io") == 0) return 1;
size_t n = strlen(path);
return strncmp(path, "/proc/", 6) == 0 && n > 3 && strcmp(path + n - 3, "/io") == 0;
}
static FILE *fake_io(const char *path, const char *mode) {
FILE *real = NULL;
FILE *(*real_fopen)(const char *, const char *) = dlsym(RTLD_NEXT, "fopen");
if (real_fopen) real = real_fopen(path, mode);
if (real) return real;
return fmemopen((void *)FAKE_IO, sizeof(FAKE_IO) - 1, "r");
}
FILE *fopen(const char *path, const char *mode) {
if (is_proc_io(path)) return fake_io(path, mode);
FILE *(*real)(const char *, const char *) = dlsym(RTLD_NEXT, "fopen");
return real(path, mode);
}
FILE *fopen64(const char *path, const char *mode) {
if (is_proc_io(path)) return fake_io(path, mode);
FILE *(*real)(const char *, const char *) = dlsym(RTLD_NEXT, "fopen64");
return real(path, mode);
}
Activity
solvingproblemswithtechnology commentedon Oct 1, 2026
Same error here. I'm trying to rollback WSL version first. 2.9.13 still doesn't work. Rolling back to 2.7.14 worked:
https://github.com/microsoft/WSL/releases/tag/2.7.14
udit2303 commentedon Oct 2, 2026
Hi, same here! found out the issue,
Typesense was crashing with
SIGSEGV (139)during startup on local WSL. The failure occurs inside the Typesense binary when accessing process-I/O accounting functionality (/proc/<pid>/io), causing container healthchecks to fail and the E2E stack to abort.I found a temporary workaround for this.
Built a small preload library (
fakeprocio.so) that stubs the problematic process-I/O accounting calls used by Typesense. The library is injected into the container via:ibril15 commentedon Oct 7, 2026
Hi everyone, same here (summary below drafted by AI):
Same issue here (Windows 10 19045, Docker Desktop, WSL 3.0.1.0 / kernel 6.18.40.1).
Adding a before/after comparison:
CONFIG_TASKSTATS=y,
CONFIG_TASK_XACCT=y,
CONFIG_TASK_IO_ACCOUNTING=y.
/proc/self/io is missing and /proc/config.gz shows "# CONFIG_TASKSTATS is not set".
Downgrading WSL to 2.7.14 is a working workaround. Note that WSL auto-updates via the Microsoft Store, so people may hit this without changing anything.
strace of
typesense-server --versionon 3.0.1.0 (last lines):openat(AT_FDCWD, "/proc/self/io", O_RDONLY) = -1 ENOENT
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x8} ---
I've reported the kernel config change on the WSL side.
freestyledork commentedon Oct 19, 2026
Some extra context, I am seeing this issue with typesense 27.x as well. I rolled back WSL for the fix.