Index | Thread | Search

From:
Christoph Liebender <christoph@liebender.dev>
Subject:
net/nheko leaks memory
To:
ports@openbsd.org
Date:
Sun, 30 Nov 2025 21:13:53 +0100

Download raw body.

Thread
  • Christoph Liebender:

    net/nheko leaks memory

Hello ports@,

after finally figuring out how to get nheko working with dbus secrets, I 
have found that it leaks memory - quite quickly - when exiting.

Steps to reproduce:

- start nheko
- do something with it (probably optional)
- quit nheko (I quit via cwm keyboard shortcut)
- observe how memory usage grows, very quickly.

This requires killing nheko manually.

For some investigation, I built nheko v0.12.1 manually from git with 
debug symbols, to run it in gdb. I get a segfault, originating from libc 
(?). The backtrace is down below.

Could this be something OpenBSD specific? I suppose it would have 
already been reported upstream, if it would be a non-platform-dependent 
issue...

Can anybody reproduce?

Thread 1 received signal SIGSEGV, Segmentation fault.
_rthread_mutex_timedlock (mutexp=<optimized out>, trywait=0, abs=0x0, 
timed=0) at /usr/src/lib/libc/thread/rthread_mutex.c:165
165		    (void *)mutex->owner);
(gdb) backtrace
#0  _rthread_mutex_timedlock (mutexp=<optimized out>, trywait=0, 
abs=0x0, timed=0) at /usr/src/lib/libc/thread/rthread_mutex.c:165
#1  0x00000f570f4571a4 in event_add () from 
/usr/local/lib/libevent_core.so.2.1
#2  0x00000f56c6e65618 in coeurl::Client::addsock(int, int) () from 
/usr/local/lib/libcoeurl.so.0.1
#3  0x00000f56c6e657fb in coeurl::Client::sock_cb(void*, int, int, 
void*, void*) () from /usr/local/lib/libcoeurl.so.0.1
#4  0x00000f56995da97c in mev_sh_entry_update () from 
/usr/local/lib/libcurl.so.26.34
#5  0x00000f56995d9ef1 in mev_assess () from /usr/local/lib/libcurl.so.26.34
#6  0x00000f5699599df2 in Curl_cshutdn_add () from 
/usr/local/lib/libcurl.so.26.34
#7  0x00000f56995936f6 in cpool_discard_conn () from 
/usr/local/lib/libcurl.so.26.34
#8  0x00000f5699593474 in Curl_cpool_destroy () from 
/usr/local/lib/libcurl.so.26.34
#9  0x00000f56995d30af in curl_multi_cleanup () from 
/usr/local/lib/libcurl.so.26.34
#10 0x00000f56c6e65d1b in coeurl::Client::~Client() () from 
/usr/local/lib/libcoeurl.so.0.1
#11 0x00000f569f7e40ac in mtx::http::Client::~Client() () from 
/usr/local/lib/libmatrix_client.so.4.0
#12 0x00000f546a059e93 in __destroy_at<mtx::http::Client, 0> 
(__loc=0xf56af46b918) at /usr/include/c++/v1/__memory/construct_at.h:67
#13 0x00000f546a059e4a in destroy<mtx::http::Client, void, 0> 
(__p=0xf56af46b918)
     at /usr/include/c++/v1/__memory/allocator_traits.h:339
#14 0x00000f546a059def in 
__on_zero_shared_impl<std::__1::allocator<mtx::http::Client>, 0> 
(this=0xf56af46b900)
     at /usr/include/c++/v1/__memory/shared_ptr.h:283
#15 0x00000f546a059b93 in 
std::__1::__shared_ptr_emplace<mtx::http::Client, 
std::__1::allocator<mtx::http::Client> >::__on_zero_shared 
(this=0xf56af46b900) at /usr/include/c++/v1/__memory/shared_ptr.h:286
#16 0x00000f54697bce8e in 
std::__1::__shared_count::__release_shared[abi:ne190107]() 
(this=0xf56af46b900)
     at /usr/include/c++/v1/__memory/shared_ptr.h:156
#17 0x00000f54697bce2a in 
std::__1::__shared_weak_count::__release_shared[abi:ne190107]() 
(this=0xf56af46b900)
     at /usr/include/c++/v1/__memory/shared_ptr.h:185
#18 0x00000f546a059329 in 
std::__1::shared_ptr<mtx::http::Client>::~shared_ptr[abi:ne190107]() (
     this=0xf546a403a80 <http::client()::client_>) at 
/usr/include/c++/v1/__memory/shared_ptr.h:668
#19 0x00000f567dc9cd22 in _libc___cxa_finalize (dso=0x0) at 
/usr/src/lib/libc/stdlib/atexit.c:177
#20 0x00000f567dce2065 in _libc_exit (status=0) at 
/usr/src/lib/libc/stdlib/exit.c:54
#21 0x00000f5469683e72 in _start ()