2026-02-13 15:44:21 Displayed 19 times

KC3 memory leaks

Last two weeks I've been working on dropping libevent2 support in favor of kqueue. It lead to two things : I can now stop my server gracefully and I lost ASan as it is not available on BSD. No problem, I read in some OpenBSD related project and in malloc(3) manual page that OpenBSD has a nice 4-levels deep stack trace for memory leaks.

Now I'm sending claude-code for all the addr2line magic and we found many memory leaks it's awesome. Since I can close the webserver (kc3_httpd, the program serving this very webpage) gracefully I get to have a memleak audit from otto malloc.

For now my production servers still run with the leaks and after few hours of polling the kqueue fd the heap grows to a few gigs its aweful XD