Bug 485756 - ktorrent bad_alloc
Summary: ktorrent bad_alloc
Status: REPORTED
Alias: None
Product: ktorrent
Classification: Applications
Component: general (other bugs)
Version First Reported In: 23.08.5
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-18 19:45 UTC by lg3dx6fd
Modified: 2024-07-13 14:52 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lg3dx6fd 2024-04-18 19:45:37 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

SUMMARY


STEPS TO REPRODUCE
1. Maybe try download a torrent at 100 MiB/sec ?
2. Have bunch of free memory ( 18 GB full-free, though 50GB available if use what is for caches, and +750GB of swap space)
3. 

OBSERVED RESULT
crash

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: gentoo linux kde plasma stable gcc -O3 -flto 
(available in About System)
KDE Plasma Version: 5.27.11
KDE Frameworks Version:  5.115
Qt Version: 5.15.12

ADDITIONAL INFORMATION

backtrace from gdb:

```
gdb ktorrent
GNU gdb (Gentoo 14.1 vanilla) 14.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ktorrent...
(gdb) r
Starting program: /usr/bin/ktorrent 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffeb7ff6c0 (LWP 84380)]
[New Thread 0x7fffeaffe6c0 (LWP 84381)]
[New Thread 0x7fffea7fd6c0 (LWP 84382)]
[New Thread 0x7fffe9bff6c0 (LWP 84383)]
[New Thread 0x7fffe93fe6c0 (LWP 84384)]
[New Thread 0x7fffe8bfd6c0 (LWP 84385)]
[Thread 0x7fffe8bfd6c0 (LWP 84385) exited]
[Thread 0x7fffe9bff6c0 (LWP 84383) exited]
[Thread 0x7fffe93fe6c0 (LWP 84384) exited]
[New Thread 0x7fffe93fe6c0 (LWP 84387)]
[New Thread 0x7fffe9bff6c0 (LWP 84388)]
[New Thread 0x7fffe8bfd6c0 (LWP 84389)]
[Thread 0x7fffe8bfd6c0 (LWP 84389) exited]
[Thread 0x7fffe9bff6c0 (LWP 84388) exited]
[Thread 0x7fffe93fe6c0 (LWP 84387) exited]
[New Thread 0x7fffe9bff6c0 (LWP 84390)]
[New Thread 0x7fffe93fe6c0 (LWP 84391)]
[Thread 0x7fffe9bff6c0 (LWP 84390) exited]
[New Thread 0x7fffe9bff6c0 (LWP 84401)]
[Thread 0x7fffe9bff6c0 (LWP 84401) exited]
[New Thread 0x7fffe9bff6c0 (LWP 84402)]
[Thread 0x7fffe9bff6c0 (LWP 84402) exited]
[New Thread 0x7fffe9bff6c0 (LWP 84406)]
[New Thread 0x7fffe8bfd6c0 (LWP 84407)]
Error Opening file /usr/share/GeoIP/GeoIP.dat
[New Thread 0x7fffd363c6c0 (LWP 84425)]
[New Thread 0x7fffd2e3b6c0 (LWP 84426)]
[New Thread 0x7fffd263a6c0 (LWP 84427)]
[New Thread 0x7fffd1e396c0 (LWP 84428)]
[Detaching after fork from child process 84429]
[Detaching after fork from child process 84437]
[Detaching after fork from child process 84440]
[Detaching after fork from child process 84442]
[New Thread 0x7fffb021f6c0 (LWP 84444)]
[New Thread 0x7fffafa1e6c0 (LWP 84445)]
[New Thread 0x7fffaf21d6c0 (LWP 84446)]
[New Thread 0x7fffaea1c6c0 (LWP 84447)]
[Thread 0x7fffb021f6c0 (LWP 84444) exited]
[Thread 0x7fffafa1e6c0 (LWP 84445) exited]
[Thread 0x7fffaf21d6c0 (LWP 84446) exited]
[Thread 0x7fffaea1c6c0 (LWP 84447) exited]
[New Thread 0x7fffaea1c6c0 (LWP 84463)]
[Thread 0x7fffaea1c6c0 (LWP 84463) exited]
[New Thread 0x7fffaea1c6c0 (LWP 84464)]
[New Thread 0x7fffaf21d6c0 (LWP 84465)]
[New Thread 0x7fffafa1e6c0 (LWP 84466)]
[Thread 0x7fffd263a6c0 (LWP 84427) exited]
[Thread 0x7fffd2e3b6c0 (LWP 84426) exited]
[Thread 0x7fffd363c6c0 (LWP 84425) exited]
[Thread 0x7fffd1e396c0 (LWP 84428) exited]
Warning: Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt.
You must not let any exception whatsoever propagate through Qt code.
If that is not possible, in Qt 5 you must at least reimplement
QCoreApplication::notify() and catch all exceptions there.

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Thread 1 "ktorrent" received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
44	     return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007ffff54af5df in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007ffff5460612 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff54494ed in __GI_abort () at abort.c:79
#4  0x00007ffff56a0b32 in __gnu_cxx::__verbose_terminate_handler ()
    at /usr/src/debug/sys-devel/gcc-13.2.1_p20240113-r1/gcc-13-20240113/libstdc++-v3/libsupc++/vterminate.cc:95
#5  0x00007ffff56b44e6 in __cxxabiv1::__terminate (handler=<optimized out>)
    at /usr/src/debug/sys-devel/gcc-13.2.1_p20240113-r1/gcc-13-20240113/libstdc++-v3/libsupc++/eh_terminate.cc:48
#6  0x00007ffff56b3179 in __cxa_call_terminate (ue_header=0x55555762a860)
    at /usr/src/debug/sys-devel/gcc-13.2.1_p20240113-r1/gcc-13-20240113/libstdc++-v3/libsupc++/eh_call.cc:54
#7  0x00007ffff56b385c in __cxxabiv1::__gxx_personality_v0
    (version=<optimized out>, actions=6, exception_class=5138137972254386944, ue_header=<optimized out>, context=<optimized out>)
    at /usr/src/debug/sys-devel/gcc-13.2.1_p20240113-r1/gcc-13-20240113/libstdc++-v3/libsupc++/eh_personality.cc:688
#8  0x00007ffff6fbc6a4 in _Unwind_RaiseException_Phase2
    (exc=exc@entry=0x55555762a860, context=context@entry=0x7fffffffceb0, frames_p=frames_p@entry=0x7fffffffcdb8)
    at /usr/src/debug/sys-devel/gcc-13.2.1_p20240113-r1/gcc-13-20240113/libgcc/unwind.inc:64
#9  0x00007ffff6fbcf84 in _Unwind_Resume (exc=exc@entry=0x55555762a860)
    at /usr/src/debug/sys-devel/gcc-13.2.1_p20240113-r1/gcc-13-20240113/libgcc/unwind.inc:242
#10 0x00007ffff7d8da35 in bt::TorrentControl::stop (this=<optimized out>, wjob=0x0)
    at /usr/src/debug/net-libs/libktorrent-23.08.5/libktorrent-23.08.5/src/torrent/torrentcontrol.cpp:452
#11 0x00007ffff7dff584 in bt::TorrentControl::~TorrentControl (this=0x555555f4b610, this=<optimized out>)
    at /usr/src/debug/net-libs/libktorrent-23.08.5/libktorrent-23.08.5/src/torrent/torrentcontrol.cpp:104
#12 0x00007ffff7dff639 in bt::TorrentControl::~TorrentControl (this=0x555555f4b610, this=<optimized out>)
    at /usr/src/debug/net-libs/libktorrent-23.08.5/libktorrent-23.08.5/src/torrent/torrentcontrol.cpp:124
#13 0x00007ffff7f3833e in qDeleteAll<QList<bt::TorrentInterface*>::const_iterator> (end=..., begin=...) at /usr/include/qt5/QtCore/qalgorithms.h:320
#14 qDeleteAll<kt::QueuePtrList> (c=...) at /usr/include/qt5/QtCore/qalgorithms.h:328
#15 kt::QueueManager::~QueueManager (this=0x555555f034f0, this=<optimized out>)
    at /usr/src/debug/net-p2p/ktorrent-23.08.5/ktorrent-23.08.5/libktcore/torrent/queuemanager.cpp:53
#16 0x00007ffff7f383b9 in kt::QueueManager::~QueueManager (this=0x555555f034f0, this=<optimized out>)
    at /usr/src/debug/net-p2p/ktorrent-23.08.5/ktorrent-23.08.5/libktcore/torrent/queuemanager.cpp:54
#17 0x00005555555bc51a in kt::Core::~Core (this=0x555555ef8fc0, this=<optimized out>)
    at /usr/src/debug/net-p2p/ktorrent-23.08.5/ktorrent-23.08.5/ktorrent/core.cpp:115
#18 0x00005555555ca82e in kt::Core::~Core (this=0x555555ef8fc0, this=<optimized out>)
    at /usr/src/debug/net-p2p/ktorrent-23.08.5/ktorrent-23.08.5/ktorrent/core.cpp:113
#19 kt::GUI::~GUI (this=0x7fffffffd290, this=<optimized out>) at /usr/src/debug/net-p2p/ktorrent-23.08.5/ktorrent-23.08.5/ktorrent/gui.cpp:116
#20 0x00005555555b0093 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/net-p2p/ktorrent-23.08.5/ktorrent-23.08.5/ktorrent/main.cpp:251
Comment 1 lg3dx6fd 2024-04-18 20:01:46 UTC
recompiled without lto, got another bad_alloc:

backtrace:

[Thread 0x7fffcddc96c0 (LWP 79595) exited]
Warning: Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt.
You must not let any exception whatsoever propagate through Qt code.
If that is not possible, in Qt 5 you must at least reimplement
QCoreApplication::notify() and catch all exceptions there.

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Thread 1 "ktorrent" received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
44	     return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007ffff54af5df in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007ffff5460612 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff54494ed in __GI_abort () at abort.c:79
#4  0x00007ffff56a0b32 in __gnu_cxx::__verbose_terminate_handler ()
    at /usr/src/debug/sys-devel/gcc-13.2.1_p20240113-r1/gcc-13-20240113/libstdc++-v3/libsupc++/vterminate.cc:95
#5  0x00007ffff56b44e6 in __cxxabiv1::__terminate (handler=<optimized out>)
    at /usr/src/debug/sys-devel/gcc-13.2.1_p20240113-r1/gcc-13-20240113/libstdc++-v3/libsupc++/eh_terminate.cc:48
#6  0x00007ffff56b3179 in __cxa_call_terminate (ue_header=0x55555777cb30)
    at /usr/src/debug/sys-devel/gcc-13.2.1_p20240113-r1/gcc-13-20240113/libstdc++-v3/libsupc++/eh_call.cc:54
#7  0x00007ffff56b385c in __cxxabiv1::__gxx_personality_v0
    (version=<optimized out>, actions=6, exception_class=5138137972254386944, ue_header=<optimized out>, context=<optimized out>)
    at /usr/src/debug/sys-devel/gcc-13.2.1_p20240113-r1/gcc-13-20240113/libstdc++-v3/libsupc++/eh_personality.cc:688
#8  0x00007ffff6faa6a4 in _Unwind_RaiseException_Phase2
    (exc=exc@entry=0x55555777cb30, context=context@entry=0x7fffffffcb50, frames_p=frames_p@entry=0x7fffffffca58)
    at /usr/src/debug/sys-devel/gcc-13.2.1_p20240113-r1/gcc-13-20240113/libgcc/unwind.inc:64
#9  0x00007ffff6faaf84 in _Unwind_Resume (exc=exc@entry=0x55555777cb30)
    at /usr/src/debug/sys-devel/gcc-13.2.1_p20240113-r1/gcc-13-20240113/libgcc/unwind.inc:242
#10 0x00007ffff5aa1251 in QIODevice::readAll (this=this@entry=0x7fffffffcdb0)
    at /usr/src/debug/dev-qt/qtcore-5.15.12-r2/qtbase-everywhere-src-5.15.12/src/corelib/io/qiodevice.cpp:892
#11 0x00007ffff73181d1 in KConfigIniBackend::parseConfig (this=this@entry=0x55555604ddc0, currentLocale=..., entryMap=..., options=..., 
    options@entry=..., merging=merging@entry=true) at /usr/src/debug/kde-frameworks/kconfig-5.115.0/kconfig-5.115.0/src/core/kconfigini.cpp:89
#12 0x00007ffff73192cc in KConfigIniBackend::writeConfig (this=0x55555604ddc0, locale=..., entryMap=..., options=...)
    at /usr/src/debug/kde-frameworks/kconfig-5.115.0/kconfig-5.115.0/src/core/kconfigini.cpp:414
#13 0x00007ffff7302d1e in KConfig::sync (this=0x55555604e620) at /usr/src/debug/kde-frameworks/kconfig-5.115.0/kconfig-5.115.0/src/core/kconfig.cpp:481
#14 0x00007ffff7df248e in bt::TorrentControl::stop (this=0x55555604cb90, wjob=0x0)
    at /usr/src/debug/net-libs/libktorrent-23.08.5/libktorrent-23.08.5/src/torrent/torrentcontrol.cpp:460
#15 0x00007ffff7ded584 in bt::TorrentControl::~TorrentControl (this=0x55555604cb90, this=<optimized out>)
    at /usr/src/debug/net-libs/libktorrent-23.08.5/libktorrent-23.08.5/src/torrent/torrentcontrol.cpp:104
#16 0x00007ffff7ded639 in bt::TorrentControl::~TorrentControl (this=0x55555604cb90, this=<optimized out>)
    at /usr/src/debug/net-libs/libktorrent-23.08.5/libktorrent-23.08.5/src/torrent/torrentcontrol.cpp:124
#17 0x00007ffff7f28a8e in qDeleteAll<QList<bt::TorrentInterface*>::const_iterator> (end=..., begin=...) at /usr/include/qt5/QtCore/qalgorithms.h:320
#18 qDeleteAll<kt::QueuePtrList> (c=...) at /usr/include/qt5/QtCore/qalgorithms.h:328
#19 kt::QueueManager::~QueueManager (this=0x555555eecdb0, __in_chrg=<optimized out>)
    at /usr/src/debug/net-p2p/ktorrent-23.08.5/ktorrent-23.08.5/libktcore/torrent/queuemanager.cpp:53
#20 0x00007ffff7f28b09 in kt::QueueManager::~QueueManager (this=0x555555eecdb0, __in_chrg=<optimized out>)
    at /usr/src/debug/net-p2p/ktorrent-23.08.5/ktorrent-23.08.5/libktcore/torrent/queuemanager.cpp:54
#21 0x00005555555b101e in kt::Core::~Core (this=0x555555f155a0, __in_chrg=<optimized out>)
--Type <RET> for more, q to quit, c to continue without paging--
    at /usr/src/debug/net-p2p/ktorrent-23.08.5/ktorrent-23.08.5/ktorrent/core.cpp:115
#22 0x00005555555b16e9 in kt::Core::~Core (this=0x555555f155a0, __in_chrg=<optimized out>)
    at /usr/src/debug/net-p2p/ktorrent-23.08.5/ktorrent-23.08.5/ktorrent/core.cpp:118
#23 0x00005555555bcbe2 in kt::GUI::~GUI (this=0x7fffffffd290, __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
    at /usr/src/debug/net-p2p/ktorrent-23.08.5/ktorrent-23.08.5/ktorrent/gui.cpp:116
#24 0x00005555555902ba in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/net-p2p/ktorrent-23.08.5/ktorrent-23.08.5/ktorrent/main.cpp:251
Comment 2 lg3dx6fd 2024-04-18 20:09:13 UTC
recompiled with -O0 -march=native -ggdb3 , no lto 

at roughly 102.65 MiB/s it crashed with bad_alloc

[Thread 0x7fffd2ca46c0 (LWP 160020) exited]
Warning: Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt.
You must not let any exception whatsoever propagate through Qt code.
If that is not possible, in Qt 5 you must at least reimplement
QCoreApplication::notify() and catch all exceptions there.

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Thread 1 "ktorrent" received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
44	     return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007ffff54af5df in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007ffff5460612 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff54494ed in __GI_abort () at abort.c:79
#4  0x00007ffff56a0b32 in __gnu_cxx::__verbose_terminate_handler ()
    at /usr/src/debug/sys-devel/gcc-13.2.1_p20240113-r1/gcc-13-20240113/libstdc++-v3/libsupc++/vterminate.cc:95
#5  0x00007ffff56b44e6 in __cxxabiv1::__terminate (handler=<optimized out>)
    at /usr/src/debug/sys-devel/gcc-13.2.1_p20240113-r1/gcc-13-20240113/libstdc++-v3/libsupc++/eh_terminate.cc:48
#6  0x00007ffff56b3179 in __cxa_call_terminate (ue_header=0x555557a337a0)
    at /usr/src/debug/sys-devel/gcc-13.2.1_p20240113-r1/gcc-13-20240113/libstdc++-v3/libsupc++/eh_call.cc:54
#7  0x00007ffff56b385c in __cxxabiv1::__gxx_personality_v0
    (version=<optimized out>, actions=6, exception_class=5138137972254386944, ue_header=<optimized out>, context=<optimized out>)
    at /usr/src/debug/sys-devel/gcc-13.2.1_p20240113-r1/gcc-13-20240113/libstdc++-v3/libsupc++/eh_personality.cc:688
#8  0x00007ffff6f686a4 in _Unwind_RaiseException_Phase2
    (exc=exc@entry=0x555557a337a0, context=context@entry=0x7fffffffcc20, frames_p=frames_p@entry=0x7fffffffcb28)
    at /usr/src/debug/sys-devel/gcc-13.2.1_p20240113-r1/gcc-13-20240113/libgcc/unwind.inc:64
#9  0x00007ffff6f68f84 in _Unwind_Resume (exc=exc@entry=0x555557a337a0)
    at /usr/src/debug/sys-devel/gcc-13.2.1_p20240113-r1/gcc-13-20240113/libgcc/unwind.inc:242
#10 0x00007ffff5aa152b in QLockFilePrivate::isApparentlyStale (this=this@entry=0x7fffc3ffd950)
    at /usr/src/debug/dev-qt/qtcore-5.15.12-r2/qtbase-everywhere-src-5.15.12/src/corelib/io/qlockfile.cpp:396
#11 0x00007ffff5c01750 in QLockFile::tryLock (this=<optimized out>, timeout=timeout@entry=-1)
    at /usr/src/debug/dev-qt/qtcore-5.15.12-r2/qtbase-everywhere-src-5.15.12/src/corelib/io/qlockfile.cpp:254
#12 0x00007ffff5c0195a in QLockFile::lock (this=<optimized out>)
    at /usr/src/debug/dev-qt/qtcore-5.15.12-r2/qtbase-everywhere-src-5.15.12/src/corelib/io/qlockfile.cpp:216
#13 0x00007ffff72d1099 in KConfigIniBackend::lock (this=0x5555560be310)
    at /usr/src/debug/kde-frameworks/kconfig-5.115.0/kconfig-5.115.0/src/core/kconfigini.cpp:645
#14 0x00007ffff72c0f6e in KConfigPrivate::lockLocal (this=0x5555560c0c90)
    at /usr/src/debug/kde-frameworks/kconfig-5.115.0/kconfig-5.115.0/src/core/kconfig.cpp:128
#15 KConfig::sync (this=0x5555560bf0f0) at /usr/src/debug/kde-frameworks/kconfig-5.115.0/kconfig-5.115.0/src/core/kconfig.cpp:431
#16 0x00007ffff7db048e in bt::TorrentControl::stop (this=0x5555560bdd30, wjob=0x0)
    at /usr/src/debug/net-libs/libktorrent-23.08.5/libktorrent-23.08.5/src/torrent/torrentcontrol.cpp:460
#17 0x00007ffff7dab584 in bt::TorrentControl::~TorrentControl (this=0x5555560bdd30, this=<optimized out>)
    at /usr/src/debug/net-libs/libktorrent-23.08.5/libktorrent-23.08.5/src/torrent/torrentcontrol.cpp:104
#18 0x00007ffff7dab639 in bt::TorrentControl::~TorrentControl (this=0x5555560bdd30, this=<optimized out>)
    at /usr/src/debug/net-libs/libktorrent-23.08.5/libktorrent-23.08.5/src/torrent/torrentcontrol.cpp:124
#19 0x00007ffff7eec058 in qDeleteAll<QList<bt::TorrentInterface*>::const_iterator> (begin=..., end=...) at /usr/include/qt5/QtCore/qalgorithms.h:320
#20 0x00007ffff7eea9a8 in qDeleteAll<kt::QueuePtrList> (c=...) at /usr/include/qt5/QtCore/qalgorithms.h:328
#21 0x00007ffff7ee5562 in kt::QueueManager::~QueueManager (this=0x555555f8d780, __in_chrg=<optimized out>)
--Type <RET> for more, q to quit, c to continue without paging--
    at /usr/src/debug/net-p2p/ktorrent-23.08.5/ktorrent-23.08.5/libktcore/torrent/queuemanager.cpp:53
#22 0x00007ffff7ee55d2 in kt::QueueManager::~QueueManager (this=0x555555f8d780, __in_chrg=<optimized out>)
    at /usr/src/debug/net-p2p/ktorrent-23.08.5/ktorrent-23.08.5/libktcore/torrent/queuemanager.cpp:54
#23 0x00005555555a4701 in kt::Core::~Core (this=0x555555f89240, __in_chrg=<optimized out>)
    at /usr/src/debug/net-p2p/ktorrent-23.08.5/ktorrent-23.08.5/ktorrent/core.cpp:115
#24 0x00005555555a47bc in kt::Core::~Core (this=0x555555f89240, __in_chrg=<optimized out>)
    at /usr/src/debug/net-p2p/ktorrent-23.08.5/ktorrent-23.08.5/ktorrent/core.cpp:118
#25 0x00005555555b5cba in kt::GUI::~GUI (this=0x7fffffffd290, __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
    at /usr/src/debug/net-p2p/ktorrent-23.08.5/ktorrent-23.08.5/ktorrent/gui.cpp:116
#26 0x00005555555a19fd in main (argc=1, argv=0x7fffffffd4f8) at /usr/src/debug/net-p2p/ktorrent-23.08.5/ktorrent-23.08.5/ktorrent/main.cpp:251
Comment 3 lg3dx6fd 2024-04-18 20:19:21 UTC
recompiled with -fsanitize=address -fsanitize=leak -O0 -march=native -ggdb3 .

got this at roughlt 60 MiB/s download speed

==9516==ERROR: AddressSanitizer: out of memory: failed to allocate 0x1000 (4096) bytes of InternalMmapVector (error code: 12)
ERROR: Failed to mmap
Comment 4 lg3dx6fd 2024-04-18 20:30:06 UTC
I guess it somehow relates to the bug https://bugs.kde.org/show_bug.cgi?id=456666
Comment 5 lg3dx6fd 2024-04-18 22:06:11 UTC
Some really smart guys from IRC #gentoo said it can relate to kernel overcommiting https://www.kernel.org/doc/html/latest/mm/overcommit-accounting.html

After 
# root : sysctl vm.overcommit_memory=1
I cannot get the problem