telegram-desktop: <jemalloc>: Unsupported system page size

Problems with packages? Post here, using [tags] of the package name.

telegram-desktop: <jemalloc>: Unsupported system page size

Postby alllexx88 » Sat May 04, 2024 8:02 pm

While running on Raspberry Pi 5 with linux-rpi-16k, I get this error when trying to launch telegram-desktop:
[code]$ telegram-desktop
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
../glib/glib/gprintf.c:350: failed to allocate memory[/code]

When replacing linux-rpi-16k with linux-rpi, the error is gone.

[code]$ pacman -Q telegram-desktop
telegram-desktop 4.16.6-1
$ pacman -Q linux-rpi-16k
linux-rpi-16k 6.6.28-1
$ pacman -Q jemalloc
jemalloc 1:5.3.0-3[/code]

This link appears to be relevant: make_clickable_callback(MAGIC_URL_FULL, ' ', 'https://github.com/telegramdesktop/tdesktop/issues/26103', '', ' class="postlink"') Strangely, it says the issue is fixed on Arch Linux ARM, but I'm still seeing this error with the latest versions of all of installed packages.
Last edited by alllexx88 on Mon May 20, 2024 6:06 pm, edited 1 time in total.
alllexx88
 
Posts: 12
Joined: Sat May 04, 2024 9:16 am

Re: telegram-desktop: <jemalloc>: Unsupported system page si

Postby alllexx88 » Sun May 05, 2024 12:34 pm

I built telegram-desktop 5.0.0-1 from Arch Linux sources, and it works perfectly fine, with the current jemalloc from Arch Linux ARM. Maybe, the telegram-desktop 4.16.6-1 from the repos was linked against a bad static version of jemalloc, since ldd doesn't list libjemalloc, unlike the 5.0.0-1 I built myself:

[code]$ ldd `which telegram-desktop`|grep jemalloc
libjemalloc.so.2 => /usr/lib/libjemalloc.so.2 (0x00007fff184b0000)[/code]

It took some time to compile, and also a big swap (I used 8.7G).
alllexx88
 
Posts: 12
Joined: Sat May 04, 2024 9:16 am

Re: telegram-desktop: <jemalloc>: Unsupported system page si

Postby alllexx88 » Mon May 13, 2024 9:32 am

telegram-desktop was just upgraded to 5.0.1-1 on the extra repo. The jemalloc error is still there with the current version. I can't find the PKGBUILD used to build archlinuxarm telegram-desktop, but seeing that jemalloc isn't a dependency for telegram-desktop, cmake/external/jemalloc/CMakeLists.txt probably builds static jemalloc during telegram-desktop compilation, which doesn't support 16k page size. It helps to instead build with current shared extra/jemalloc, which is built with 16k page size support. Fixing this should be as simple as adding jemalloc dependency, I could create a PR, but I can't find the sources for this package: it's not on make_clickable_callback(MAGIC_URL_FULL, ' ', 'https://github.com/archlinuxarm/PKGBUILDs/tree/master/extra', '', ' class="postlink"')
alllexx88
 
Posts: 12
Joined: Sat May 04, 2024 9:16 am

Re: telegram-desktop: <jemalloc>: Unsupported system page si

Postby dpasini » Thu May 16, 2024 4:33 pm

Has this issue been fixed? I am trying desperately to install Telegram on the Raspberry Pi 5 but to no success.. Please help!
dpasini
 
Posts: 1
Joined: Thu May 16, 2024 4:31 pm

Re: telegram-desktop: <jemalloc>: Unsupported system page si

Postby graysky » Thu May 16, 2024 6:16 pm

Could be incompatible with 16k frames used by linux-rpi-16k. Try installing linux-rpi, reboot and try it again.
graysky
Developer
 
Posts: 1870
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: telegram-desktop: <jemalloc>: Unsupported system page si

Postby alllexx88 » Mon May 20, 2024 5:56 pm

@graysky It's definitely has to do with 16k page size. And the solution is actually pretty simple: just add 'jemalloc' dependency to the PKGBUILD. Current telegram-desktop binary is built without external jemalloc, so the telegram-desktop cmake builds a static one for itself, without the support for 16k pages. While the extra/jemalloc package is built with 16k support, so all it takes is just linking against this jemalloc. I used Arch sources from make_clickable_callback(MAGIC_URL_FULL, ' ', 'https://gitlab.archlinux.org/archlinux/packaging/packages/telegram-desktop', '', ' class="postlink"') with these minor adjustments:

[code]diff --git a/PKGBUILD b/PKGBUILD
index bfed5d5..e5ddb5a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,12 +2,12 @@
# Contributor: hexchain <i@hexchain.org>
pkgname=telegram-desktop
pkgver=5.0.1
-pkgrel=1
+pkgrel=2
pkgdesc='Official Telegram Desktop client'
-arch=('x86_64')
+arch=('aarch64' 'x86_64')
url="https://desktop.telegram.org/"
license=('GPL3')
-depends=('hunspell' 'ffmpeg' 'hicolor-icon-theme' 'lz4' 'minizip' 'openal'
+depends=('hunspell' 'ffmpeg' 'hicolor-icon-theme' 'jemalloc' 'lz4' 'minizip' 'openal'
'qt6-imageformats' 'qt6-svg' 'qt6-wayland' 'xxhash'
'rnnoise' 'pipewire' 'libxtst' 'libxrandr' 'libxcomposite' 'libxdamage' 'abseil-cpp' 'libdispatch'
'openssl' 'protobuf' 'glib2' 'libsigc++-3.0' 'kcoreaddons')[/code]

And the resulting binary indeed links against libjemalloc:

[code]$ ldd /usr/bin/telegram-desktop|grep jemalloc
libjemalloc.so.2 => /usr/lib/libjemalloc.so.2 (0x00007fff66200000)[/code]

And it works just fine with linux-rpi-16k.

@graysky do you happen to know how to suggest these changes to archlinuxarm codebase? Right now I don't see telegram-desktop on make_clickable_callback(MAGIC_URL_FULL, ' ', 'https://github.com/archlinuxarm/PKGBUILDs', '', ' class="postlink"')

Thanks!
alllexx88
 
Posts: 12
Joined: Sat May 04, 2024 9:16 am

Re: telegram-desktop: <jemalloc>: Unsupported system page si

Postby graysky » Mon May 20, 2024 8:21 pm

I asked Kevin to do it, thanks for reporting back.
graysky
Developer
 
Posts: 1870
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: telegram-desktop: <jemalloc>: Unsupported system page si

Postby alllexx88 » Tue May 21, 2024 7:29 am

@graysky Great, thanks!
alllexx88
 
Posts: 12
Joined: Sat May 04, 2024 9:16 am


Return to Packages

Who is online

Users browsing this forum: No registered users and 13 guests