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

NULL pointer passed to as_checksum_set_value from as_cache_file_read #70

Closed
iainlane opened this issue Sep 6, 2016 · 0 comments
Closed

Comments

@iainlane
Copy link
Contributor

iainlane commented Sep 6, 2016

I was trying to reproduce another bug that I saw (couldn't, might be fixed with 0.10, will keep an eye out), when I made appstreamcli crash like this.

laney@raleigh> sudo env LD_LIBRARY_PATH=/dev/canonical/release/appstream/build/src gdb --args ~/dev/canonical/release/appstream/build/tools/appstreamcli refresh-cache --force 
GNU gdb (Ubuntu 7.11.90.20160824-0ubuntu2) 7.11.90.20160824-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/laney/dev/canonical/release/appstream/build/tools/appstreamcli...done.
(gdb) run
Starting program: /home/laney/dev/canonical/release/appstream/build/tools/appstreamcli refresh-cache --force
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

(appstreamcli:18543): GLib-CRITICAL **: the GVariant format string '{us}' has a type of '{us}' but the given value has a type of 'a{sv}'

(appstreamcli:18543): GLib-CRITICAL **: g_variant_get: assertion 'valid_format_string (format_string, TRUE, value)' failed

Program received signal SIGSEGV, Segmentation fault.
strlen () at ../sysdeps/x86_64/strlen.S:106
106 ../sysdeps/x86_64/strlen.S: No such file or directory.
(gdb) bt
#0  0x00007ffff6f5af06 in strlen () at ../sysdeps/x86_64/strlen.S:106
#1  0x00007ffff7b2fb43 in g_strdup (str=0x2 <error: Cannot access memory at address 0x2>) at ././glib/gstrfuncs.c:362
#2  0x00007ffff72c5a34 in as_checksum_set_value (cs=0x63a710 [AsChecksum], value=0x2 <error: Cannot access memory at address 0x2>) at /home/laney/dev/canonical/release/appstream/src/as-checksum.c:165
#3  0x00007ffff72b62f4 in as_cache_file_read (fname=0x62efd0 "/var/cache/app-info/gv/en_GB.gvz", error=0x7fffffffdec8)
    at /home/laney/dev/canonical/release/appstream/src/as-cache-file.c:1094
#4  0x00007ffff72c14cb in as_pool_load_cache_file (pool=0x62c870 [AsPool], fname=0x62efd0 "/var/cache/app-info/gv/en_GB.gvz", error=0x7fffffffdf98) at /home/laney/dev/canonical/release/appstream/src/as-pool.c:751
#5  0x00007ffff72c13c9 in as_pool_load (pool=0x62c870 [AsPool], cancellable=0x0, error=0x7fffffffdf98)
    at /home/laney/dev/canonical/release/appstream/src/as-pool.c:717
#6  0x00007ffff72c21ff in as_pool_refresh_cache (pool=0x62c870 [AsPool], force=1, error=0x7fffffffe000)
    at /home/laney/dev/canonical/release/appstream/src/as-pool.c:1167
#7  0x00000000004058f3 in ascli_refresh_cache (cachepath=0x0, datapath=0x0, forced=1)
    at /home/laney/dev/canonical/release/appstream/tools/ascli-actions-mdata.c:52
#8  0x000000000040435f in as_client_run (argv=0x7fffffffe3d8, argc=2)
    at /home/laney/dev/canonical/release/appstream/tools/appstream-cli.c:213
#9  0x000000000040469e in main (argc=3, argv=0x7fffffffe3d8)
    at /home/laney/dev/canonical/release/appstream/tools/appstream-cli.c:269

...I think it's because you are iterating the wrong dictionary.

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

1 participant