Segfault on flatpak remote-add

  • Done
  • quality assurance status badge
Details
4 participants
  • Ben Sturmfels
  • Jonathan Frederickson
  • Mark H Weaver
  • Ricardo Wurmus
Owner
unassigned
Submitted by
Jonathan Frederickson
Severity
normal
Merged with
J
J
Jonathan Frederickson wrote on 5 May 2019 22:05
(address . bug-guix@gnu.org)
12034386-e609-4dec-997f-bbf6614d8482@www.fastmail.com
I'm attempting to use Flatpak on my Guix system, and I'm experiencing segfaults when attempting to add a remote repo. Provided below are the output of the command I'm attempting to run, as well as some info about my system.

=====
jfred@lambdacrypt ~$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Note that the directories

'/var/lib/flatpak/exports/share'
'/home/jfred/.local/share/flatpak/exports/share'

are not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.

Segmentation fault
=====
Current guix commit:

jfred@lambdacrypt ~$ guix describe -f channels
(list (channel
(name 'guix)
(commit
"187f9636f176d62bf869b787ad410e3a528aa1a0")))
=====
Current user package manifest:

jfred@lambdacrypt ~$ cat guix.scm
(specifications->manifest
'("glibc-utf8-locales"
;;# Dotfiles management
"stow"
"rofi"
"gnupg"
"emacs-password-store"
"pcsc-lite"
;;# Hacking
"emacs"
"git"
"guile@2.2"
"font-adobe-source-code-pro"
"emacs-guix"
;;# Devops
"docker"
"docker-cli"
"docker-compose"
;; System Administration
"htop"
"curl"
;;# Desktop
"gnome-tweak-tool"
"icecat"
"luakit"
"flatpak"
"evolution"
;; Gaming
"tintin++"
"powwow"))
M
M
Mark H Weaver wrote on 6 May 2019 00:36
(name . Jonathan Frederickson)(address . jonathan@terracrypt.net)(address . 35591@debbugs.gnu.org)
87muk0sf4e.fsf@netris.org
Hi Jonathan,

"Jonathan Frederickson" <jonathan@terracrypt.net> writes:
Toggle quote (5 lines)
> I'm attempting to use Flatpak on my Guix system, and I'm experiencing
> segfaults when attempting to add a remote repo. Provided below are the
> output of the command I'm attempting to run, as well as some info
> about my system.

My knowledge of Flatpak is weak, but in general, foreign pre-compiled
binaries will not work on Guix unless they are statically linked.
Traditional dynamically-linked executables expect to find a dynamic
linker and system shared libraries in /lib or /lib64, which do not exist
on a Guix system. It is also fairly common for foreign binaries to
depend on standard files and programs in /usr, /bin, and /sbin, none of
which are present on a Guix system except for /bin/sh.

Having said that, if you must run foreign pre-compiled binaries on Guix,
there are various hacks to do it. One approach is to install symlinks
in /lib*, /usr, /bin, /sbin, etc, pointing to the needed components in
/run/current-system. Another is to modify the pre-compiled binaries to
look for components in the right place using 'patchelf'. We use the
latter approach to bootstrap GHC (Glasgow Haskell Compiler), which can
only be compiled by itself.

I'm sorry I don't have a better answer for you, but Guix was not
designed to run foreign pre-compiled binaries. If that's important to
you, it might be that Guix is not a good fit for you.

However, if your goal is to run Guix-compiled programs in a sandbox,
that's something we are certainly very interested in, and we could use
help. We have "guix container" as a building block, and I know that
some Guix users have experimented with running e.g. GNU IceCat within a
container. I don't know the current status of those efforts. Hopefully
someone more knowledgable in this area will chime in.

Regards,
Mark
J
J
Jonathan Frederickson wrote on 6 May 2019 00:47
(name . Mark H Weaver)(address . mhw@netris.org)(address . 35591@debbugs.gnu.org)
2493358.OLn4tNdJs0@terrabase
On Sunday, May 5, 2019 6:36:06 PM EDT Mark H Weaver wrote:
Toggle quote (8 lines)
> My knowledge of Flatpak is weak, but in general, foreign pre-compiled
> binaries will not work on Guix unless they are statically linked.
> Traditional dynamically-linked executables expect to find a dynamic
> linker and system shared libraries in /lib or /lib64, which do not exist
> on a Guix system. It is also fairly common for foreign binaries to
> depend on standard files and programs in /usr, /bin, and /sbin, none of
> which are present on a Guix system except for /bin/sh.

I believe Flatpak applications are statically linked. (Or rather, individual
applications may be dynamically linked, but they are eventually combined with
a full OS image similarly to how Docker works.)

Toggle quote (4 lines)
> I'm sorry I don't have a better answer for you, but Guix was not
> designed to run foreign pre-compiled binaries. If that's important to
> you, it might be that Guix is not a good fit for you.

It's not the most important thing to me; it may end up being one more reason
for me to start attempting to package things for Guix! But it would still be
nice to be able to run the same tooling that e.g. some Gnome developers are
using to publish their apps across distros. (And the fact that Flatpak is
packaged for Guix seems to imply that it should be possible to use it here.)

Toggle quote (7 lines)
> However, if your goal is to run Guix-compiled programs in a sandbox,
> that's something we are certainly very interested in, and we could use
> help. We have "guix container" as a building block, and I know that
> some Guix users have experimented with running e.g. GNU IceCat within a
> container. I don't know the current status of those efforts. Hopefully
> someone more knowledgable in this area will chime in.

While this isn't my immediate goal, this is also something that I'm interested
in, if someone else knows more about this!
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEEIugt7kcBGD3Sv4NQN3jAIa4BEwFAlzPaB0ACgkQQN3jAIa4
BEz25Q//Rv4YHz7/k6FzI1QDhRHLaZzXPirFE7rCFsv3QHl/gYDXCr/cUF9+vs+W
SrkGYVNErrG3qjHOncdQI3diT4Un9D98UcEILBWVX7aO5YCdv6Z5pTK1umzZgjiW
sFKeS5+mV2ELBQZDd4OQRsiHIDLQRR3oY3ducKp9yjWsl9gHoFzqjRDZkE6TZgqX
kYq0JvPQv3YUr9f0PUJN7ku180VjEjkiIU4LvmmunGStsXSOrv3Wt1VLrrTY0/2w
wN7wY2LFzEI2gP3P4m1GMd7cMrL231uIk0cmT0elV+aYABw2poR6Hsa9mo88myjQ
yxN2mzmp7kNeb9N8Mr8OKKpvhPl96MIGs/C1bqyZP0FNI6mkTwBDisJr8rENWVUy
fTlXxTexICOx1sdgATHB5kKMzYUKg+6seoVJAOT/su42Z3CDGEVLZZYy0kdxJovz
aNStg/bVpQoBciF42cc6uXCFfC5iVj8H5bJxoThxG7N4g6v3ZYubpY10Z12jOSPO
R0vFYfjMy3oFoVQdDTIZ8qU7gO0JbhRySw9GQcXPJV/LHZApH4lBRsTjYcJBZri3
fR8g2raaw0Otsa0USXKFHUma6Izi48usLKXKepXXVkSgcKZFgTZsSo+TEp0uU/u8
+lqySoMwTT/GWsAt0HFNeia8PtrmK5/MTClpolutjD8XZANr0EE=
=l31F
-----END PGP SIGNATURE-----


B
B
Ben Sturmfels wrote on 31 Oct 2019 11:50
(name . Jonathan Frederickson)(address . jonathan@terracrypt.net)(address . 35591@debbugs.gnu.org)
87pnid9ok5.fsf@sturm.com.au
On Sun, 05 May 2019, Jonathan Frederickson wrote:

Toggle quote (5 lines)
> I'm attempting to use Flatpak on my Guix system, and I'm experiencing
> segfaults when attempting to add a remote repo. Provided below are the
> output of the command I'm attempting to run, as well as some info
> about my system.

I learnt on #guix IRC that flatpak works when run with the --user flag:

$ flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
$ flatpak install flathub org.gnome.Builder
$ flatpak run org.gnome.Builder

The segfaulting behaviour is still a bug in my opinion, because it's
extremely user un-friendly, and the requirement for --user is not
obvious.

Regards,
Ben
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEPn825zvdanEG+SAhAjwF4snAaPAFAl26vGoACgkQAjwF4snA
aPCaeQ//THKTnk3DQ9Z2aL3balJaF5vky5CpOGvuLPxh78HNQmV8A6F6tHcDirWx
kOGbpFPXDkxhs/oqUMom8ROFjz1wa0LjxjftJdidO12n9iOm9c+D7hC9pgPHn5tr
c1dcHhv2DEQCsg3uJgnM9iMBS04rT0wQB1P5Mkni/T0HIzsBaUErKihq9j2YnNJd
HiosWIoXaLIxkWkpdRnNkDh8/M2dHcdMK4f+DCB2uMTqR16sHI7AyGo1ON+YS1KE
CLCMtFRFP2t2gWsSChYLHbjkk9Sydk2vCJE2d+Z40F7uGG7dFp3Qgkjr6aLi4lZj
b+Xgbf36JNBuEnLjI7sHDOI3lysoOrQQLL7XljZ15qFYaYteNBsBHNoIqXhdkqvU
lSlvGZVZ3ZXo3ekuSxpFiqykiyG9zgoER8g8jcRevsQ/ZlKJMW3LRRJ/bSJbGHYm
idFTfF39X4d+LF4rK9iLHpgvMiPHK5D8Xn2mVFrs5aIlnddMV7BjuNXd6FX3u7f7
IH6JHs4LtbO/sqae5UlmDMxUqNHmgT+EAW7ttM7XZkgFsTHwVAwEjDgh4/MNErIp
EwdT5Q75L74eDKWK9Ab52GxnzjUEa/5NhafLUrSgj9NuUql4icdpV+N2LgvxVV5X
ImBj2at5ljP1gtE7M3sEASFeUyuLJRmyYNy7I6ZGv4oYDDZHg/8=
=nxvD
-----END PGP SIGNATURE-----

R
R
Ricardo Wurmus wrote on 11 May 2020 22:23
(address . bug-guix@gnu.org)
87tv0m1ar8.fsf@elephly.net
Ben Sturmfels <ben@sturm.com.au> writes:

Toggle quote (17 lines)
> On Sun, 05 May 2019, Jonathan Frederickson wrote:
>
>> I'm attempting to use Flatpak on my Guix system, and I'm experiencing
>> segfaults when attempting to add a remote repo. Provided below are the
>> output of the command I'm attempting to run, as well as some info
>> about my system.
>
> I learnt on #guix IRC that flatpak works when run with the --user flag:
>
> $ flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
> $ flatpak install flathub org.gnome.Builder
> $ flatpak run org.gnome.Builder
>
> The segfaulting behaviour is still a bug in my opinion, because it's
> extremely user un-friendly, and the requirement for --user is not
> obvious.

Yes, segfaults are always bugs, unless you forced the program to
load garbage.

I traced the execution of flatpak and saw that it segfaults right after
failing to created /var/lib/flatpak. Sure enough, after creating it
manually the program no longer segfaults.

--
Ricardo
R
R
Ricardo Wurmus wrote on 11 May 2020 23:38
(address . 35591@debbugs.gnu.org)(name . Jonathan Frederickson)(address . jonathan@terracrypt.net)
87r1vq17b6.fsf@elephly.net
Ricardo Wurmus <rekado@elephly.net> writes:

Toggle quote (26 lines)
> Ben Sturmfels <ben@sturm.com.au> writes:
>
>> On Sun, 05 May 2019, Jonathan Frederickson wrote:
>>
>>> I'm attempting to use Flatpak on my Guix system, and I'm experiencing
>>> segfaults when attempting to add a remote repo. Provided below are the
>>> output of the command I'm attempting to run, as well as some info
>>> about my system.
>>
>> I learnt on #guix IRC that flatpak works when run with the --user flag:
>>
>> $ flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
>> $ flatpak install flathub org.gnome.Builder
>> $ flatpak run org.gnome.Builder
>>
>> The segfaulting behaviour is still a bug in my opinion, because it's
>> extremely user un-friendly, and the requirement for --user is not
>> obvious.
>
> Yes, segfaults are always bugs, unless you forced the program to
> load garbage.
>
> I traced the execution of flatpak and saw that it segfaults right after
> failing to created /var/lib/flatpak. Sure enough, after creating it
> manually the program no longer segfaults.

I reported this here:


I’d say we close this issue here, because the segfault isn’t our fault.

Thoughts?

--
Ricardo
R
R
Ricardo Wurmus wrote on 14 May 2020 07:21
(address . control@debbugs.gnu.org)
87wo5fccrn.fsf@elephly.net
merge 40489 35591
quit
R
R
Ricardo Wurmus wrote on 14 May 2020 07:26
(address . 35591-done@debbugs.gnu.org)(name . Jonathan Frederickson)(address . jonathan@terracrypt.net)
87r1vnccj8.fsf@elephly.net
Ricardo Wurmus <rekado@elephly.net> writes:

Toggle quote (6 lines)
> I reported this here:
>
> https://github.com/flatpak/flatpak/issues/3612
>
> I’d say we close this issue here, because the segfault isn’t our fault.

Upstream has acknowledged and addressed the bug.

Closing.

--
Ricardo
Closed
?