ONLYOFFICE / appimage-desktopeditors

Portable version of ONLYOFFICE Desktop Editors
https://www.onlyoffice.com/apps.aspx
GNU Affero General Public License v3.0
56 stars 9 forks source link

/usr/lib/libhogweed.so.4: undefined symbol: __gmpn_cnd_sub_n #3

Closed probonopd closed 2 years ago

probonopd commented 6 years ago

Someone reports over at https://linuxfr.org/news/sortie-des-applications-de-bureau-de-onlyoffice-en-version-5-1-au-format-appimage:

# ArchLinux
$ ./DesktopEditors-x86_64.AppImage
./DesktopEditors: symbol lookup error: /usr/lib/libhogweed.so.4: undefined symbol: __gmpn_cnd_sub_n

Seems we had a similar issue with libhogweed here, maybe @darealshinji has an idea what needs to be done to fix this.

darealshinji commented 6 years ago

__gmpn_cnd_sub_n is a symbol from libgmp, see: readelf -s /usr/lib/x86_64-linux-gnu/libgmp.so.10 | grep __gmpn_cnd_sub_n

My assumption here: it loads libhogweed from the system instead of the AppImage, perhaps it already has loaded an incompatible version libgmp from within the AppImage? Bundle libhogweed with all its dependencies and see if that fixes it.

probonopd commented 6 years ago

Thanks @darealshinji

darealshinji commented 6 years ago

By the way:

https://github.com/ONLYOFFICE/desktop-apps/blob/master/win-linux/package/linux/deb/onlyoffice-desktopeditors/DEBIAN/control https://github.com/ONLYOFFICE/desktop-apps/blob/master/win-linux/package/linux/rpm/requires.spec

Maybe they shouldn't manually declare all the dependencies but use the packaging tools instead to do that automatically.

agolybev commented 6 years ago

Hi @darealshinji, Bundling libhogweed inside AppImage doesn't fix problem. We'll investigate it. Thank you for your approach.

vstoykov commented 6 years ago

On Fedora 28 I have the same error

./DesktopEditors: symbol lookup error: /lib64/libhogweed.so.4: undefined symbol: __gmpn_cnd_sub_n
AnwarShah commented 6 years ago

The same thing happened on Manjaro deepin for me. What's the problem? Is it fixed?

mittman commented 6 years ago

+1 with AppImage on ArchLinux

mikhailnov commented 6 years ago
chmod +x ./DesktopEditors-x86_64.AppImage
./DesktopEditors-x86_64.AppImage --appimage-extract
cd squashfs-root
rm -fv ./usr/bin/libgmp.so*
./AppRun
mikhailnov commented 6 years ago

You bundle libgmp.so, which loaded (LD_PRELOAD) before the system libhogweed.so. But system libhogweed.so is linked againsted the system libgmp.so, not yours. Either bundle both of them or don't bundle them both.

metal3d commented 6 years ago

Hi,

We really need to have a fixed package, Appimage or RPM/DEB because, at this time, there is no way to startup OnlyOffice on Fedora 29. Any chance to see it working soon ?

mikhailnov commented 6 years ago

@metal3d you can use https://gitlab.com/nixtux-packaging/appimage2pkg to build an RPM for Fedora from Appimage. that script already deletes ./usr/bin/libgmp.so*

metal3d commented 6 years ago

Thanks @mikhailnov, but unfortunately the built RPM is not correct:

Error: Transaction check error:
  file /usr/share/icons from install of onlyoffice-desktopeditors-appimage-5.1.27-6.x86_64 conflicts with file from package filesystem-3.9-2.fc29.x86_64
  file /usr/share/icons/hicolor/256x256 from install of onlyoffice-desktopeditors-appimage-5.1.27-6.x86_64 conflicts with file from package hicolor-icon-theme-0.17-3.fc29.noarch
  file /usr/share/icons/hicolor from install of onlyoffice-desktopeditors-appimage-5.1.27-6.x86_64 conflicts with file from package fedora-logos-28.0.3-2.fc29.x86_64
  file /usr/share/icons/hicolor/256x256 from install of onlyoffice-desktopeditors-appimage-5.1.27-6.x86_64 conflicts with file from package fedora-logos-28.0.3-2.fc29.x86_64

And I guess it will have the same problem than https://github.com/ONLYOFFICE/DesktopEditors/issues/146 for Fedora 29.

mikhailnov commented 6 years ago

Libcurl gnutls works in the appimage 9n ALT Linux, where libcurls is also built without gnutls.

probonopd commented 6 years ago

@metal3d you can use https://gitlab.com/nixtux-packaging/appimage2pkg to build an RPM for Fedora from Appimage.

Why would anyone want to do that? Users can extract an AppImage directly using -appimage-extract, and then delete the offending library.

that script already deletes ./usr/bin/libgmp.so*

The proper fix would be to do this in whatever script builds the AppImage in the first place.

mikhailnov commented 6 years ago

Why would anyone want to do that?

Because onlyoffice has not been able to make a good linux build since the first public version of onlyoffice. When we talk about corporate machines, manyal installation of Appimage is unacceptable. The official RPM is buggy and unusable. So I had to repack the appimage into RPM.

The proper fix would be to do this in whatever script builds the AppImage in the first place.

Onlyoffice has long been talking about linux but their builds have always had errors, so I wouldn't wait for a propper solution.

mikhailnov commented 6 years ago

More than that, when desktop editors were released, you wrote that you want different linux distributions to include onlyoffice. About 3 years have passed. Desktopeditors are reported to be unbuildable from source.

mikhailnov commented 6 years ago

@metal3d Fixed in appimage2pkg v1.2 https://gitlab.com/nixtux-packaging/appimage2pkg/tags/ https://yadi.sk/d/MwQr75YWqs2kKA

probonopd commented 5 years ago

So to be clear:

The authors of https://github.com/ONLYOFFICE/appimage-desktopeditors need to delete usr/bin/libgmp.so* inside their AppImage to fix this.

cc @agolybev

mikhailnov commented 5 years ago

No,, that's not a solution. I've looked into how the AppImage is packed https://github.com/ONLYOFFICE/appimage-desktopeditors/blob/master/DesktopEditors-x86_64.yml OnlyOffice deb is just being repacked. All libraries, inluding libgmp.so.* are bundled automatically by AppImage builder because binaries from the deb package depend on them. Binaries in the deb must be fixed, not the AppImage.

mikhailnov commented 5 years ago

Maybe Alexey @agolybev can make a repository with specs used to build deb and RPM packages, than maybe I or some one else can make contributions.

agolybev commented 5 years ago

Hi @mikhailnov, here you are

mikhailnov commented 5 years ago

@agolybev Thank you, but I miss something. 1) Here https://github.com/ONLYOFFICE/desktop-apps/blob/master/win-linux/package/linux/deb/onlyoffice-desktopeditors/DEBIAN/control#L10 you specify runtime dependencies, but when deb is build, dh_shlibs makes a list of native runtime dependencies automatically 2) there is no debian/rules 3) so, you first run https://github.com/ONLYOFFICE/desktop-apps/blob/master/Makefile , then run https://github.com/ONLYOFFICE/desktop-apps/blob/master/win-linux/package/linux/Makefile#L223 and get a deb package without debian/rules?

4) Then how are libraries bundled? I did not find the code. Maybe this https://github.com/ONLYOFFICE/desktop-apps/blob/master/win-linux/package/linux/Makefile#L181 ?

mikhailnov commented 5 years ago

Also found building bundled libs in https://github.com/ONLYOFFICE/core/blob/29e3f90ebfc4ff7666363af58b906df582a698a2/Makefile

agolybev commented 5 years ago

Hi @mikhailnov, Desktopeditor building process is the sequence of calls make in the root in the set of repositories. Unfortunately, we haven't provided it yet.

mikhailnov commented 5 years ago

Is this sequence the only missing thing to build OnlyOffice DesktopEditors? I think the sequence is not hard to understand without additional manuals.

agolybev commented 5 years ago

Hi, @mikhailnov it will be look like this:

cd core/Common/3dParty/ && ./make.sh
cd core && make all desktop
cd sdkjs && make desktop

export DEST_DIR=$(pwd)/core/build/linux_desktop/desktop_64
export QT_PATH=/usr/local/Qt-5.9.6
export QT_ICU=/usr/lib/x86_64-linux-gnu
export WEBAPPS_DIR=../web-apps-pro/deploy

cd desktop-apps && make install 

cd ..
ln -s $DEST_DIR $(pwd)/core/build/linux_desktop/desktop_full_modern_64

cd desktop-apps/win-linux/package/linux && make deb rpm
mikhailnov commented 5 years ago

Thank you very much! I will try to package OnlyOffice DesktopEditors for ROSA Linux, but a bit later.

GarlandKey commented 5 years ago

Can confirm - this is still an issue on Arch based distros as of today. This installation breaking bug was posted over a year ago :S

pojntfx commented 5 years ago

Can also confirm on Fedora Silverblue 30.

tyu1996 commented 5 years ago

There is also a similar issue on latest build (v5.3.5), which the terminal shows this message:

./DesktopEditors: symbol lookup error: /lib/x86_64-linux-gnu/libgnutls.so.30: undefined symbol: __gmpz_limbs_write

BTW, my machine is running Ubuntu-based Pop!OS.

probonopd commented 5 years ago

Is libgmp being bundled? What happens if it is removed from the AppImage?

Reference: https://abi-laboratory.pro/?view=compat_report&l=gmp&v1=5.1.3&v2=6.0.0&obj=f9158&kind=abi

tyu1996 commented 5 years ago

Is libgmp being bundled? What happens if it is removed from the AppImage?

Reference: https://abi-laboratory.pro/?view=compat_report&l=gmp&v1=5.1.3&v2=6.0.0&obj=f9158&kind=abi

Yes, after removed libgmp inside the extracted AppImage, it runs. So will be not including libgmp is the solution for future AppImage releases?

probonopd commented 5 years ago

So will be not including libgmp* is the solution for future AppImage releases?

Can we reasonably expect libgmp* to come as part of the default installation of all major Linux distributions?

mikhailnov commented 5 years ago

Here are reverse dependencies - all packages that depend from libgmp in ROSA 2016.1 repositories:

rosa-2016 ~ # rpm -qf /usr/lib64/libgmp.so.10
lib64gmp10-6.1.1-3-rosa2016.1.x86_64
rosa-2016 ~ # urpmq --whatrequires lib64gmp10 | sort -u
alex
aria2
cabal-install
cdd
cdd+
cddlib-devel
cm
cocoalib-examples
control-timeout
coreutils
cross-avr-gcc
cross-avr-gcc-c++
ecl
ecm
flint
fplll
freeminer
gambas3-devel
gambas3-gb-clipper
gambas3-gb-db-sqlite2
gambas3-gb-gmp
gambas3-gb-gtk
gambas3-gb-gtk3
gambas3-gb-image-effect
gambas3-gb-pdf
gambas3-gb-qt4
gambas3-gb-qt4-ext
gambas3-gb-qt4-opengl
gambas3-gb-qt4-webkit
gambas3-gb-qt5
gambas3-gb-qt5-ext
gambas3-gb-qt5-opengl
gambas3-gb-qt5-webkit
gambas3-gb-sdl
gambas3-gb-xml
gambas3-gb-xml-html
gambas3-gb-xml-xslt
gambas3-runtime
gap-core
gcc
gcc-c++
gcc-gfortran
gcc-gnat
gcc-go
gcc-java
gcc-objc
gcc-objc++
gcl
genius
gfan
ghc
ghc-ansi-terminal
ghc-ansi-wl-pprint
ghc-async
ghc-base16-bytestring
ghc-base64-bytestring
ghc-base-orphans
ghc-cabalrpmdeps
ghc-clock
ghc-conduit
ghc-ConfigFile
ghc-convertible
ghc-cpphs
ghc-cryptohash-sha256
ghc-curl
ghc-data-default
ghc-data-default-class
ghc-data-default-instances-containers
ghc-data-default-instances-dlist
ghc-data-default-instances-old-locale
ghc-dataenc
ghc-digest
ghc-dlist
ghc-ed25519
ghc-exceptions
ghc-extensible-exceptions
ghc-FindBin
ghc-hackage-security
ghc-happy
ghc-hashable
ghc-hashtables
ghc-haskeline
ghc-haskell-src
ghc-haskell-src-exts
ghc-HaXml
ghc-HDBC
ghc-hostname
ghc-hslogger
ghc-HsSyck
ghc-html
ghc-HTTP
ghc-HUnit
ghc-hxt
ghc-hxt-charproperties
ghc-hxt-regex-xmlschema
ghc-hxt-unicode
ghc-json
ghc-lhs2tex
ghc-libxml
ghc-lifted-base
ghc-MissingH
ghc-mmap
ghc-mmorph
ghc-monad-control
ghc-mtl
ghc-network
ghc-network-uri
ghc-old-locale
ghc-old-time
ghc-optparse-applicative
ghc-parallel
ghc-parsec
ghc-paths
ghc-polyparse
ghc-primitive
ghc-QuickCheck
ghc-random
ghc-regex-base
ghc-regex-compat
ghc-regex-posix
ghc-regex-tdfa
ghc-resourcet
ghc-sandi
ghc-semigroups
ghc-setlocale
ghc-stm
ghc-strict
ghc-stringsearch
ghc-syb
ghc-tagged
ghc-tagsoup
ghc-tar
ghc-tasty
ghc-tasty-hunit
ghc-tasty-quickcheck
ghc-test-framework
ghc-test-framework-hunit
ghc-test-framework-quickcheck2
ghc-text
ghc-tf-random
ghc-transformers-base
ghc-transformers-compat
ghc-unbounded-delays
ghc-unordered-containers
ghc-utf8-string
ghc-vector
ghc-void
ghc-X11
ghc-X11-xft
ghc-xml
ghc-xmonad
ghc-xmonad-contrib
ghc-zip-archive
ghc-zlib
gmsh
gnubg
gretl
kcalc
kmymoney
lib644ti2common0
lib644ti2gmp0
lib644ti2int32_0
lib644ti2int64_0
lib64alkimia4
lib64aqbanking35
lib64botan1.10_1
lib64cgal12
lib64cln6
lib64cloog-isl4
lib64cm0
lib64cvc3_5
lib64d0_blind_id0
lib64ecm1
lib64flint1
lib64fplll0
lib64gcj16
lib64givaro0
lib64gmp10
lib64gmp-devel
lib64gmpxx4
lib64gnutls30
lib64gretl1.0_9
lib64gst7
lib64guile17
lib64guile2.0_22
lib64hogweed4
lib64iml0
lib64isl13
lib64kmm_mymoney4
lib64ksi10
lib64ktorrent6
lib64linboxsage0
lib64mpc2
lib64mpc3
lib64mpfi0
lib64mpfr4
lib64mpfrcx1
lib64ntl5
lib64numexp0
lib64pari-gmp3
lib64parrot
lib64parrot-devel
lib64payeeidentifier_iban_bic4
lib64ppl13
lib64ppl_c4
lib64ratpoints0
lib64rep16
lib64zn_poly0.9
lib64zsolve0
lilypond
meshlab
minetest
minetest-server
netrek-client-cow
nettle
numexp-core
ocaml-mlgmp
openscad
openswan
parrot
perl-Crypt-DH-GMP
perl-Math-BigInt-GMP
perl-Math-GMP
perl-Math-GMPq
perl-Math-GMPz
perl-Math-MPC
perl-Math-MPFR
perl-Math-Prime-Util-GMP
php-gmp
ppl-gprolog
ppl-utils
python3-gmpy
python3-pycrypto
python-gmpy
python-gmpy2
python-pycrypto
ratpoints
R-igraph
R-igraph0
sawfish-pager
snd
strongswan
swi-prolog-nox
unvanquished
xemacs
xemacs-nox
xemacs-xft

or in form of source packages:

rosa-2016 ~ # urpm-wrb lib64gmp10
4ti2
alex
aqbanking
aria2
botan
cabal-install
cdd
cgal
cln
cloog
cm
cocoalib
control-timeout
coreutils
cross-avr-gcc
cvc3
d0_blind_id
ecl
ecm
flint
fplll
freeminer
gambas3
gap
gcc
gcl
genius
gfan
ghc
ghc-ansi-terminal
ghc-ansi-wl-pprint
ghc-async
ghc-base16-bytestring
ghc-base64-bytestring
ghc-base-orphans
ghc-cabalrpmdeps
ghc-clock
ghc-conduit
ghc-ConfigFile
ghc-convertible
ghc-cpphs
ghc-cryptohash-sha256
ghc-curl
ghc-data-default
ghc-data-default-class
ghc-data-default-instances-containers
ghc-data-default-instances-dlist
ghc-data-default-instances-old-locale
ghc-dataenc
ghc-digest
ghc-dlist
ghc-ed25519
ghc-exceptions
ghc-extensible-exceptions
ghc-FindBin
ghc-hackage-security
ghc-happy
ghc-hashable
ghc-hashtables
ghc-haskeline
ghc-haskell-src
ghc-haskell-src-exts
ghc-HaXml
ghc-HDBC
ghc-hostname
ghc-hslogger
ghc-HsSyck
ghc-html
ghc-HTTP
ghc-HUnit
ghc-hxt
ghc-hxt-charproperties
ghc-hxt-regex-xmlschema
ghc-hxt-unicode
ghc-json
ghc-lhs2tex
ghc-libxml
ghc-lifted-base
ghc-MissingH
ghc-mmap
ghc-mmorph
ghc-monad-control
ghc-mtl
ghc-network
ghc-network-uri
ghc-old-locale
ghc-old-time
ghc-optparse-applicative
ghc-parallel
ghc-parsec
ghc-paths
ghc-polyparse
ghc-primitive
ghc-QuickCheck
ghc-random
ghc-regex-base
ghc-regex-compat
ghc-regex-posix
ghc-regex-tdfa
ghc-resourcet
ghc-sandi
ghc-semigroups
ghc-setlocale
ghc-stm
ghc-strict
ghc-stringsearch
ghc-syb
ghc-tagged
ghc-tagsoup
ghc-tar
ghc-tasty
ghc-tasty-hunit
ghc-tasty-quickcheck
ghc-test-framework
ghc-test-framework-hunit
ghc-test-framework-quickcheck2
ghc-text
ghc-tf-random
ghc-transformers-base
ghc-transformers-compat
ghc-unbounded-delays
ghc-unordered-containers
ghc-utf8-string
ghc-vector
ghc-void
ghc-X11
ghc-X11-xft
ghc-xml
ghc-xmonad
ghc-xmonad-contrib
ghc-zip-archive
ghc-zlib
givaro
gmp
gmsh
gnubg
gnutls
gretl
guile
guile1.8
iml
isl
kcalc
kmymoney
ksi
libalkimia
libktorrent
libmpc
librep
lilypond
linalg-linbox
meshlab
minetest
mpfi
mpfr
mpfrcx
netrek-client-cow
nettle
ntl
numexp-core
ocaml-mlgmp
openscad
openswan
pari
parrot
perl-Crypt-DH-GMP
perl-Math-BigInt-GMP
perl-Math-GMP
perl-Math-GMPq
perl-Math-GMPz
perl-Math-MPC
perl-Math-MPFR
perl-Math-Prime-Util-GMP
php
ppl
python3-gmpy
python3-pycrypto
python-gmpy
python-gmpy2
python-pycrypto
ratpoints
R-igraph
R-igraph0
sawfish-pager
smalltalk
snd
strongswan
swi-prolog
unvanquished
xemacs
zn_poly

coreutils!

rosa-2016 ~ # for i in $(rpm -ql coreutils | grep bin/); do if readelf -a $i | grep NEEDED | grep libgmp; then echo $i; fi; done
 0x0000000000000001 (NEEDED)             Совм. исп. библиотека: [libgmp.so.10]
/bin/expr
 0x0000000000000001 (NEEDED)             Совм. исп. библиотека: [libgmp.so.10]
/usr/bin/expr
 0x0000000000000001 (NEEDED)             Совм. исп. библиотека: [libgmp.so.10]
/usr/bin/factor

So, yes, we can expect libgmp to be a part of default installations of most GNU/Linux distributions.

probonopd commented 5 years ago

Thanks for your analysis. Added to the list of libraries that are recommended not to be bundled inside AppImages.

tyu1996 commented 5 years ago

I did a file search on both library files "libhogweed" (this issue's topic) , "libgnutls" and "libgmp*" (I encountered) inside two freshly installed distro Solus 4.0 and Ubuntu 18.04 without installing extra dev dependencies.

find /usr/lib64/ -name "libhogweed*" find /usr/lib64/ -name "libgmp**" find /usr/lib64/ -name "libgnutls**"

Yep, they are all coming along as a part of both systems. This might can support the previous statement by @probonopd .

@agolybev may take a look.

la55u commented 5 years ago

same issue here, Fedora 31, AppImage v5.4.1

$ ./DesktopEditors-x86_64.AppImage 
./DesktopEditors: symbol lookup error: /lib64/libhogweed.so.5: undefined symbol: __gmpn_cnd_sub_n
probonopd commented 4 years ago

Again, please do not bundle libgmp.so.10 in the AppImage.

ShockwaveNN commented 2 years ago

This issue is rather old

I've just rechecked it on latest Arch and Fedora 35 with latest stable DesktopEdtiors and it's run fine without any visible errors

image

I'm closing this issue and if you got any other issues with AppImage on another OS (not Arch) - it's better to create a new issue