Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[regression] Unable to load .flatpakref in gnome-software (it crashes) with 0.11.5 #1632

Closed
ahayzen opened this issue Apr 30, 2018 · 3 comments

Comments

@ahayzen
Copy link

ahayzen commented Apr 30, 2018

Linux distribution and version

Ubuntu 18.04

Flatpak version

Flatpak version 0.11.5.

Description of the problem

Tried to install Inkscape from flathub.org using the .flatpakref, but this crashed gnome-software. It looks like libflatpak is causing the crash.

This was probably introduced in 0.11.4 and I didn't spot when testing as I got distracted with the other regression (sorry).

Steps to reproduce

What happened:

  1. Install flatpak and the flathub repo
  2. Navigate to flathub.org
  3. Find an app, eg Inkscape
  4. Click install and open the file in "software installer" (or similar)
  5. Notice that gnome-software appears, but then crashes (and apport runs to collect the crash on Ubuntu)

What I expected to happen:
At step 5 to see Inkscape on gnome-software as an app to install.

Full crash report (without the base64 encoded core, contact if you need it) https://pastebin.ubuntu.com/p/hwT8tW8xqr/

Here is just the SegvAnalysis and StackTrace

...
SegvAnalysis:
 Segfault happened at: 0x7f966a2f7eb0 <flatpak_remote_state_lookup_sparse_cache+16>:	mov    0x20(%rdi),%rbx
 PC (0x7f966a2f7eb0) ok
 source "0x20(%rdi)" (0x00000020) not located in a known VMA region (needed readable region)!
 destination "%rbx" ok
 Stack memory exhausted (SP below stack segment)
SegvReason: reading NULL VMA
SourcePackage: gnome-software
Stacktrace:
 #0  flatpak_remote_state_ensure_metadata (error=<optimised out>, self=<optimised out>) at common/flatpak-dir.c:228
 No locals.
 #1  flatpak_remote_state_lookup_sparse_cache (self=self@entry=0x0, ref=ref@entry=0x7f96500d44d0 "app/org.inkscape.Inkscape/x86_64/stable", error=error@entry=0x0) at common/flatpak-dir.c:365
         cache = <optimised out>
         pos = 32662
 #2  0x00007f966a2edc65 in flatpak_remote_ref_new (coll_ref=coll_ref@entry=0x7f96500db6c0, commit=commit@entry=0x0, remote_name=0x7f96500d5f60 "org.inkscape.Inkscape-origin", state=state@entry=0x0) at lib/flatpak-remote-ref.c:353
         kind = FLATPAK_REF_KIND_APP
         download_size = 0
         installed_size = 0
         metadata = 0x0
         metadata_bytes = 0x0
         parts = 0x7f96500d6140
         ref = <optimised out>
         sparse = 0x0
         full_ref = 0x7f96500d44d0 "app/org.inkscape.Inkscape/x86_64/stable"
         eol = 0x0
         eol_rebase = 0x0
 #3  0x00007f966a2f1378 in flatpak_installation_install_ref_file (self=0x55946fc1b360, ref_file_data=0x55946fc1b2f0, cancellable=0x55946fc1d960, error=<optimised out>) at lib/flatpak-installation.c:1623
         dir = 0x7f963c0042a0
         remote = 0x7f96500d5f60 "org.inkscape.Inkscape-origin"
         ref = 0x7f96500d43b0 "app/org.inkscape.Inkscape/x86_64/stable"
         collection_id = 0x0
         coll_ref = 0x7f96500db6c0
 #4  0x00007f966a57669c in gs_flatpak_file_to_app_ref () from /usr/lib/x86_64-linux-gnu/gs-plugins-11/libgs_plugin_flatpak.so
 No symbol table info available.
 #5  0x00007f966a578601 in gs_plugin_file_to_app () from /usr/lib/x86_64-linux-gnu/gs-plugins-11/libgs_plugin_flatpak.so
 No symbol table info available.
 #6  0x000055946d21e49c in ?? ()
 No symbol table info available.
 #7  0x000055946d21e903 in ?? ()
 No symbol table info available.
 #8  0x000055946d21fc42 in ?? ()
 No symbol table info available.
 #9  0x00007f968c810be6 in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
 No symbol table info available.
 #10 0x00007f968cb957d0 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
 No symbol table info available.
 #11 0x00007f968cb94e05 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
 No symbol table info available.
 #12 0x00007f9689e486db in start_thread (arg=0x7f9660df2700) at pthread_create.c:463
         pd = 0x7f9660df2700
         now = <optimised out>
         unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140283847059200, 8823832614826602830, 140283847056448, 0, 94096044021920, 140721850902832, -8838229894027611826, -8837858202352946866}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
         not_first_call = <optimised out>
 #13 0x00007f9689b7188f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
 No locals.
...
@ahayzen
Copy link
Author

ahayzen commented Apr 30, 2018

It looks like flatpak_remote_state_ensure_metadata is getting a null state (or "self") and then trying to do self->metadata on this. So guess either flatpak_remote_state_ensure_metadata needs to protect itself from nullptr or further up eg in flatpak_remote_state_lookup_sparse_cache etc. Also I could be totally wrong, first time reading the code :-)

And I assume this came in with the FlatpakRemoteState #1575

@hughsie
Copy link
Collaborator

hughsie commented May 1, 2018

This also causes gnome-software CI to fail, and I'm expecting to besieged with dups for this on Fedora 28.

mwleeds added a commit to mwleeds/flatpak that referenced this issue May 1, 2018
In flatpak_remote_ref_new(), the state parameter is optional, so check
if it's NULL before trying to use it in
flatpak_remote_state_lookup_sparse_cache(). This prevents a seg fault
when GNOME Software is installing a .flatpakref file.

Fixes flatpak#1632
mwleeds added a commit to endlessm/flatpak that referenced this issue May 1, 2018
In flatpak_remote_ref_new(), the state parameter is optional, so check
if it's NULL before trying to use it in
flatpak_remote_state_lookup_sparse_cache(). This prevents a seg fault
when GNOME Software is installing a .flatpakref file.

Fixes flatpak/flatpak#1632
mwleeds added a commit to endlessm/flatpak that referenced this issue May 1, 2018
In flatpak_remote_ref_new(), the state parameter is optional, so check
if it's NULL before trying to use it in
flatpak_remote_state_lookup_sparse_cache(). This prevents a seg fault
when GNOME Software is installing a .flatpakref file.

Fixes flatpak/flatpak#1632
mwleeds added a commit to endlessm/flatpak that referenced this issue May 1, 2018
In flatpak_remote_ref_new(), the state parameter is optional, so check
if it's NULL before trying to use it in
flatpak_remote_state_lookup_sparse_cache(). This prevents a seg fault
when GNOME Software is installing a .flatpakref file.

Fixes flatpak/flatpak#1632
@TrySpace
Copy link

TrySpace commented Jun 24, 2022

I have the same issue on debian 10, and when I use the terminal: flatpak install ./Dowloads/name_of_pkg.flatpakref it doesn't autocomplete the path, nor does it find the .flatpakref file when I manually enter the path...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants