Bug 456666 - KTorrent crashes with "mmap failed : Cannot allocate memory" even with plenty of free memory
Summary: KTorrent crashes with "mmap failed : Cannot allocate memory" even with plenty...
Status: REPORTED
Alias: None
Product: ktorrent
Classification: Applications
Component: general (other bugs)
Version First Reported In: 21.12.3
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-13 07:53 UTC by Chris Ross
Modified: 2022-07-13 07:56 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 Chris Ross 2022-07-13 07:53:31 UTC
SUMMARY

Ktorrent does not start, instead crashing out with "mmap failed : Cannot allocate memory" despite there being plenty of memory. Rebooting the computer does not help, ktorrent still won't run.

chris@xavier 08:13:04 ~ $ free -h
               total        used        free      shared  buff/cache   available
Mem:           125Gi       4.2Gi       114Gi        56Mi       6.4Gi       120Gi
Swap:          256Gi          0B       256Gi

STEPS TO REPRODUCE
1.  Boot the computer
2.  Log in (KDE/Plasma)
3.  Choose KTorrent from the "Internet" menu
4. "Nothing happens"
5. Open Konsole
6. Enter "ktorrent --verbose"
7. Output as below...

OBSERVED RESULT

chris@xavier 08:12:58 ~ $ ktorrent --verbose
Wed Jul 13 08:13:02 2022: Bound to ::
Wed Jul 13 08:13:02 2022: UTP: bound to ::
Wed Jul 13 08:13:02 2022: Bound to 0.0.0.0
Wed Jul 13 08:13:02 2022: UTP: bound to 0.0.0.0
Wed Jul 13 08:13:02 2022: Bound to UDP port 6881
Wed Jul 13 08:13:02 2022: Bound to ::
Wed Jul 13 08:13:02 2022: Cannot bind to port 0.0.0.0:6881 : Address already in use
Wed Jul 13 08:13:02 2022: Bound to TCP port 6881
Wed Jul 13 08:13:02 2022: DHT: Starting on port 7881
Wed Jul 13 08:13:02 2022: Bound to ::
Wed Jul 13 08:13:02 2022: DHT: Bound to ::
Wed Jul 13 08:13:02 2022: Bound to 0.0.0.0
Wed Jul 13 08:13:02 2022: DHT: Bound to 0.0.0.0
Wed Jul 13 08:13:02 2022: DHT: finding node 
Wed Jul 13 08:13:02 2022: Cannot open /home/chris/.local/share/ktorrent/groups : No such file or directory
Wed Jul 13 08:13:02 2022: Loading /home/chris/.local/share/ktorrent/tor0/
Wed Jul 13 08:13:02 2022: Loading /home/chris/.local/share/ktorrent/tor1/
Wed Jul 13 08:13:02 2022: Loading /home/chris/.local/share/ktorrent/tor10/
Wed Jul 13 08:13:02 2022: Encoding : UTF-8
Wed Jul 13 08:13:02 2022: Bound to ::
Wed Jul 13 08:13:02 2022: Bound to 0.0.0.0
Wed Jul 13 08:13:02 2022: Loading /home/chris/.local/share/ktorrent/tor11/
Wed Jul 13 08:13:02 2022: Loading /home/chris/.local/share/ktorrent/tor12/
Wed Jul 13 08:13:02 2022: Loading /home/chris/.local/share/ktorrent/tor13/
Wed Jul 13 08:13:02 2022: Loading /home/chris/.local/share/ktorrent/tor14/
Wed Jul 13 08:13:02 2022: Loading /home/chris/.local/share/ktorrent/tor15/
Wed Jul 13 08:13:02 2022: Loading /home/chris/.local/share/ktorrent/tor16/
Wed Jul 13 08:13:02 2022: Loading /home/chris/.local/share/ktorrent/tor17/
Wed Jul 13 08:13:02 2022: Loading /home/chris/.local/share/ktorrent/tor18/
Wed Jul 13 08:13:02 2022: Encoding : UTF-8
Wed Jul 13 08:13:02 2022: Loading /home/chris/.local/share/ktorrent/tor19/
Wed Jul 13 08:13:02 2022: Loading /home/chris/.local/share/ktorrent/tor2/
Wed Jul 13 08:13:04 2022: mmap failed : Cannot allocate memory
Wed Jul 13 08:13:04 2022: mmap failed : Cannot allocate memory
Wed Jul 13 08:13:04 2022: mmap failed : Cannot allocate memory
Wed Jul 13 08:13:04 2022: Uncaught exception: std::bad_alloc
Wed Jul 13 08:13:04 2022: DHT: Stopping 


EXPECTED RESULT

Ktorrent should run

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  KUbuntu 22.04 LTS
KDE Plasma Version:  5.24.4
KDE Frameworks Version:  5.92.0
Qt Version:  5.13.3

ADDITIONAL INFORMATION

This is on a relatively clean install of Kubuntu 22.04 (the current LTS release) although with the preexisting /home
Comment 1 Chris Ross 2022-07-13 07:56:16 UTC
Small correction, the Qt version is 5.15.3