I have a third-party Ubuntu repo at http://packages.sil.org/ubuntu. I'm using a Xenial test machine. After refreshing sources with apt-get update, I run appstreamcli as follows:
If I run it from a root shell (sudo -s) or wrap it with a shell (sudo bash -c '...') I get the same result. Previously, it would run successfully like this, but the behaviour has now changed. The only difference I can think of is that I've installed build dependencies for appstream and have built it from source. However, I haven't done make install and it doesn't matter whether I run the built-from-source version or the installed package.
Very annoyingly, if I try to run appstreamcli from gdb, it runs successfully! So I can't step through the code and see exactly what's happening. Instead, I'm having to rely on creating a core dump, and because it's being run from a set-uid program, I have to set /proc/sys/fs/suid_dumpable and /proc/sys/kernel/core_pattern appropriately. I can then use ^\ to send SIGQUIT and use gdb on the resulting core dump.
I get the following backtrace:
#0 0x00007f912e1a18b4 in yaml_event_delete () from /usr/lib/x86_64-linux-gnu/libyaml-0.so.2
#1 0x00007f912fa767e0 in as_yamldata_parse_distro_data (ydt=0x1612d20,
data=0x1712580 "---\nFile: DEP-11\nVersion: '0.8'\nOrigin: pso-ubuntu-xenial-universe\nMediaBaseUrl: http://packages.sil.org/ubuntu/appstream/media\n\360\273p\001", error=0x7ffff1342c20) at /home/mayhewn/src/appstream/appstream/src/as-yamldata.c:1932
#2 0x00007f912fa77063 in as_metadata_parse_yaml (metad=0x161ed40,
data=0x1712580 "---\nFile: DEP-11\nVersion: '0.8'\nOrigin: pso-ubuntu-xenial-universe\nMediaBaseUrl: http://packages.sil.org/ubuntu/appstream/media\n\360\273p\001", error=0x7ffff1342c20) at /home/mayhewn/src/appstream/appstream/src/as-metadata.c:255
#3 0x00007f912fa77486 in as_metadata_parse_file (metad=0x161ed40, file=0x1619d40, error=0x7ffff1342c20)
at /home/mayhewn/src/appstream/appstream/src/as-metadata.c:357
#4 0x00007f912fa7cc2b in as_data_pool_load_metadata (dpool=0x1612c80) at /home/mayhewn/src/appstream/appstream/src/as-data-pool.c:465
#5 0x00007f912fa7ce29 in as_data_pool_update (dpool=0x1612c80, error=0x7ffff1342d00)
at /home/mayhewn/src/appstream/appstream/src/as-data-pool.c:512
#6 0x00007f912fa6c76b in as_cache_builder_refresh (builder=0x1612c30, force=0, error=0x7ffff1342d78)
at /home/mayhewn/src/appstream/appstream/src/as-cache-builder.c:537
#7 0x0000000000405114 in ascli_refresh_cache (dbpath=0x0, datapath=0x0, forced=0)
at /home/mayhewn/src/appstream/appstream/tools/ascli-actions-mdata.c:61
#8 0x0000000000403d61 in as_client_run (argv=0x7ffff1343128, argc=2) at /home/mayhewn/src/appstream/appstream/tools/appstream-cli.c:202
#9 0x000000000040405b in main (argc=4, argv=0x7ffff1343128) at /home/mayhewn/src/appstream/appstream/tools/appstream-cli.c:255
The content of /var/lib/app-info/yaml/packages.sil.org_ubuntu_dists_xenial_universe_dep11_Components-amd64.yml.gz is:
It looks like as_metadata_parse_yaml is being given some extra junk characters on the end of the real data (\360\273p\001). These are definitely not in the real file (I checked with zcat ... | hexdump -C).
I have a third-party Ubuntu repo at http://packages.sil.org/ubuntu. I'm using a Xenial test machine. After refreshing sources with
apt-get update, I runappstreamclias follows:It then hangs, using 100% CPU. I've left it as long as 10 minutes and it still doesn't finish. The output is:
If I run it from a root shell (
sudo -s) or wrap it with a shell (sudo bash -c '...') I get the same result. Previously, it would run successfully like this, but the behaviour has now changed. The only difference I can think of is that I've installed build dependencies forappstreamand have built it from source. However, I haven't donemake installand it doesn't matter whether I run the built-from-source version or the installed package.Very annoyingly, if I try to run
appstreamclifromgdb, it runs successfully! So I can't step through the code and see exactly what's happening. Instead, I'm having to rely on creating a core dump, and because it's being run from a set-uid program, I have to set/proc/sys/fs/suid_dumpableand/proc/sys/kernel/core_patternappropriately. I can then use^\to sendSIGQUITand usegdbon the resulting core dump.I get the following backtrace:
The content of
/var/lib/app-info/yaml/packages.sil.org_ubuntu_dists_xenial_universe_dep11_Components-amd64.yml.gzis:It looks like
as_metadata_parse_yamlis being given some extra junk characters on the end of the real data (\360\273p\001). These are definitely not in the real file (I checked withzcat ... | hexdump -C).The output of
ldd tools/appstreamcliis:So it's picking up system libraries for everything except
libappstream.so.3, as it should.The text was updated successfully, but these errors were encountered: