Open muelli opened 6 years ago
Starting program: /usr/bin/flatpak build-export --arch=x86_64 --gpg-sign=tobiasmue@gnome.org --exclude=/lib/debug/\* --include=/lib/debug/app --exclude=/share/runtime/locale/\*/\* /var/tmp/fb.repo fpbuilder master
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffedf0a700 (LWP 19204)]
[New Thread 0x7fffed709700 (LWP 19205)]
WARNING: Binary not found for Exec line in /home/muelli/vcs/gnome-keysign/flatpak/fpbuilder/export/share/applications/org.gnome.Keysign.desktop: python -m keysign
bt
Thread 1 "flatpak" received signal SIGSEGV, Segmentation fault.
malloc_consolidate (av=av@entry=0x7ffff5bb6c20 <main_arena>) at malloc.c:4498
4498 malloc.c: No such file or directory.
(gdb) bt
#0 0x00007ffff5865130 in malloc_consolidate (av=av@entry=0x7ffff5bb6c20 <main_arena>) at malloc.c:4498
#1 0x00007ffff5867f16 in _int_malloc (av=av@entry=0x7ffff5bb6c20 <main_arena>, bytes=bytes@entry=32816) at malloc.c:3706
#2 0x00007ffff586af3e in __GI___libc_malloc (bytes=32816) at malloc.c:3086
#3 0x00007ffff58aff6c in __alloc_dir (fd=fd@entry=11, close_fd=close_fd@entry=false, flags=<optimised out>, statp=statp@entry=0x7fffffffd5c0)
at ../sysdeps/posix/opendir.c:218
#4 0x00007ffff58b063c in __fdopendir (fd=11)
at ../sysdeps/posix/fdopendir.c:50
#5 0x00007ffff72ee164 in glnx_dirfd_iterator_init_take_fd (dfd=0x7fffffffd6a4, dfd_iter=0x7fffffffd740, error=0x0) at libglnx/glnx-dirfd.c:127
#6 0x00007ffff72ee1fb in glnx_dirfd_iterator_init_at (dfd=<optimised out>, path=path@entry=0x7ffff72f4f73 ".", follow=follow@entry=1, out_dfd_iter=out_dfd_iter@entry=0x7fffffffd740, error=error@entry=0x0) at libglnx/glnx-dirfd.c:106
#7 0x00007ffff72b0414 in cleanup_tmpdir (self=self@entry=0x555555873040, cancellable=cancellable@entry=0x0, error=error@entry=0x0)
at src/libostree/ostree-repo-commit.c:1750
#8 0x00007ffff72b3f43 in ostree_repo_abort_transaction (self=0x555555873040, cancellable=0x0, error=0x0) at src/libostree/ostree-repo-commit.c:2164
#9 0x000055555558637d in ()
#10 0x00005555555714cd in ()
#11 0x00007ffff57fd1c1 in __libc_start_main (main=
---Type <return> to continue, or q <return> to quit---
0x555555571340, argc=10, argv=0x7fffffffdbf8, init=<optimised out>, fini=<optimised out>, rtld_fini=<optimised out>, stack_end=0x7fffffffdbe8)
at ../csu/libc-start.c:308
#12 0x000055555557186a in ()
(gdb) fr 8
#8 0x00007ffff72b3f43 in ostree_repo_abort_transaction (self=0x555555873040,
cancellable=0x0, error=0x0) at src/libostree/ostree-repo-commit.c:2164
2164 src/libostree/ostree-repo-commit.c: No such file or directory.
(gdb) info locals
No locals.
(gdb) down
#7 0x00007ffff72b0414 in cleanup_tmpdir (self=self@entry=0x555555873040,
cancellable=cancellable@entry=0x0, error=error@entry=0x0)
at src/libostree/ostree-repo-commit.c:1750
1750 in src/libostree/ostree-repo-commit.c
(gdb) info local
_glnxautoprefixerror_18 = {prefix = 0x7ffff72f6a65 "tmpdir cleanup",
error = 0x0}
curtime_secs = 1525546860
dfd_iter = {initialized = 0, fd = 0, padding_data = {0x0, 0x0, 0x0, 0x0}}
(gdb) p self
$1 = 0x555555873040
(gdb) p self->tmp_dir_fd
$2 = 9
(gdb) p *self
$3 = {parent = {g_type_instance = {g_class = 0x555555875b50}, ref_count = 2,
qdata = 0x0},
stagedir_prefix = 0x555555863430 "staging-0a702689-94e1-40ce-9b48-13de040965b9-", commit_stagedir = {initialized = 1, src_dfd = 9, fd = 12,
path = 0x555555875660 "staging-0a702689-94e1-40ce-9b48-13de040965b9-86IIlu"}, commit_stagedir_lock = {initialized = 1, dfd = 9,
path = 0x55555584ebf0 "staging-0a702689-94e1-40ce-9b48-13de040965b9-86IIlu-lock", fd = 13, operation = 6}, repodir_fdrel = 0x0, repodir = 0x555555879c00,
repo_dir_fd = 3, tmp_dir_fd = 9, cache_dir_fd = 10, cache_dir = 0x0,
objects_dir_fd = 8, uncompressed_objects_dir_fd = -1, sysroot_dir = 0x0,
sysroot = {priv = {p = 0x0}}, remotes_config_dir = 0x0, txn_lock = {p = 0x0,
i = {0, 0}}, txn = {refs = 0x0, collection_refs = 0x0, stats = {
metadata_objects_total = 789, metadata_objects_written = 1,
content_objects_total = 6519, content_objects_written = 0,
content_bytes_written = 0, padding1 = 0, padding2 = 0, padding3 = 0,
padding4 = 0}, blocksize = 4096, max_blocks = 17247443}, txn_locked = 1,
cache_lock = {p = 0x0, i = {0, 0}}, dirmeta_cache_refcount = 0,
dirmeta_cache = 0x0, inited = 1, writable = 1,
sysroot_kind = OSTREE_REPO_SYSROOT_KIND_NO, writable_error = 0x0,
in_transaction = 1, disable_fsync = 0, disable_xattrs = 0,
zlib_compression_level = 6, Python Exception <class 'gdb.error'> There is no member named keys.:
loose_object_devino_hash = 0x7fffe0006760,
updated_uncompressed_dirs = 0x0, object_sizes = 0x0, device = 64769,
inode = 655368, owner_uid = 1000, target_owner_uid = 4294967295,
---Type <return> to continue, or q <return> to quit---
target_owner_gid = 4294967295, min_free_space_percent = 3,
test_error_flags = 0, config = 0x5555558461e0, Python Exception <class 'gdb.error'> There is no member named keys.:
remotes = 0x55555581cea0,
remotes_lock = {p = 0x0, i = {0, 0}}, mode = OSTREE_REPO_MODE_ARCHIVE,
enable_uncompressed_cache = 1, generate_sizes = 0,
tmp_expiry_seconds = 86400, collection_id = 0x0, add_remotes_config_dir = 0,
lock_timeout_seconds = -2, payload_link_threshold = 18446744073709551615,
fs_support_reflink = -1, parent_repo = 0x0}
(gdb)
Flatpak eventually calls ostree_repo_sign_commit
which in turn calls sign_data
.
In there, GPG_ERR_AMBIGUOUS_NAME
is not handled and it bails out https://github.com/ostreedev/ostree/blob/579faf92fd668082e63520cb4ba324754d2b00bd/src/libostree/ostree-repo.c#L4644 https://github.com/ostreedev/ostree/pull/1579
Some bug in flatpak then does not handle this error nicely and crashes.
Flatpak detects the error in ostree_repo_sign_commit like this:
if (!ostree_repo_sign_commit (repo,
commit_checksum,
keyid,
opt_gpg_homedir,
cancellable,
error))
goto out;
....
out:
if (repo)
ostree_repo_abort_transaction (repo, cancellable, NULL);
And then we get the crash in ostree aborting the transaction. This is probably an ostree bug.
Given the malloc stuff in the backtrace its probably a double free or memory scribble. Can you still reproduce this? If so, could you run the build-export under valgrind?
My flatpak-builder crashes:
I cannot really attach gdb, because I'm too stupid to make it print a stacktrace. Then again, the Ubuntu PPA doesn't have debug symbols anyway.
When I run flatpak-builder without
--gpg-sign
then it does not crash.