After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 705967 - Don't pass non-checksums to ostree_repo_has_object()
Don't pass non-checksums to ostree_repo_has_object()
Status: RESOLVED FIXED
Product: ostree
Classification: Infrastructure
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: OSTree maintainer(s)
OSTree maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-08-14 08:11 UTC by Stef Walter
Modified: 2013-08-14 17:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't pass non-checksums to ostree_repo_has_object() (2.26 KB, patch)
2013-08-14 08:11 UTC, Stef Walter
committed Details | Review

Description Stef Walter 2013-08-14 08:11:44 UTC
The following command causes an assertion:

**
ERROR:src/libostree/ostree-core.c:1059:ostree_get_relative_object_path: assertion failed: (strlen (checksum) == 64)
Aborted (core dumped)

Stack trace:
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
    file=file@entry=0x7ffff7dd8bb5 "src/libostree/ostree-core.c", 
    line=line@entry=1059, 
    func=func@entry=0x7ffff7dd9360 <__PRETTY_FUNCTION__.24360> "ostree_get_relative_object_path", message=<optimized out>) at gtestutils.c:1912
    file=0x7ffff7dd8bb5 "src/libostree/ostree-core.c", line=1059, 
    func=0x7ffff7dd9360 <__PRETTY_FUNCTION__.24360> "ostree_get_relative_object_path", expr=<optimized out>) at gtestutils.c:1923
    checksum=0x7fffffffe693 "fedora-19/x86_64", 
    type=OSTREE_OBJECT_TYPE_COMMIT, compressed=0)
    at src/libostree/ostree-core.c:1059
    checksum=0x7fffffffe693 "fedora-19/x86_64", type=OSTREE_OBJECT_TYPE_COMMIT)
    at src/libostree/ostree-repo.c:1276
    objtype=OSTREE_OBJECT_TYPE_COMMIT, 
    checksum=0x7fffffffe693 "fedora-19/x86_64", 
    out_stored_path=0x7fffffffe0e0, cancellable=0x0, error=0x7fffffffe250)
    at src/libostree/ostree-repo.c:2180
    objtype=OSTREE_OBJECT_TYPE_COMMIT, 
    checksum=0x7fffffffe693 "fedora-19/x86_64", 
    out_have_object=0x7fffffffe148, cancellable=0x0, error=0x7fffffffe250)
    at src/libostree/ostree-repo.c:2211
    objtype=OSTREE_OBJECT_TYPE_COMMIT, rev=0x7fffffffe693 "fedora-19/x86_64", 
    inout_was_found=0x7fffffffe1cc, cancellable=0x0, error=0x7fffffffe250)
    at src/ostree/ot-builtin-show.c:157
    repo_path=0x66be40, cancellable=0x0, error=0x7fffffffe250)
---Type <return> to continue, or q <return> to quit---
    at src/ostree/ot-builtin-show.c:238
    commands=0x641c20 <commands>, res_error=0x7fffffffe2e0)
    at src/ostree/ot-main.c:249
    at src/ostree/main.c:67
(gdb) up
Comment 1 Stef Walter 2013-08-14 08:11:50 UTC
Created attachment 251575 [details] [review]
Don't pass non-checksums to ostree_repo_has_object()

The 'ostree show' command passed non-checksum arguments
to the ostree_repo_has_object() function which led to
an assertion.
Comment 2 Colin Walters 2013-08-14 12:46:16 UTC
Review of attachment 251575 [details] [review]:

Looks good.  BTW it should be a matter of adding 3 lines to tests/test-basic.sh to add test coverage for this, if you're up for it.   But I'm planning to add some test coverage with your fixes here for the xattr stuff at least here soon myself.
Comment 3 Stef Walter 2013-08-14 14:07:56 UTC
Done. 

By the way 'make check' doesn't work. 

I vaguely you remember talking about installed tests, but coming from someone who's into things like Build API [1] this is inconsistent and surprising. Just saying :P

[1] http://people.gnome.org/~walters/docs/build-api.txt
Comment 4 Stef Walter 2013-08-14 14:09:45 UTC
Attachment 251575 [details] pushed as 1904e3e - Don't pass non-checksums to ostree_repo_has_object()
Comment 5 Colin Walters 2013-08-14 17:43:24 UTC
(In reply to comment #3)
> Done. 
> 
> By the way 'make check' doesn't work. 
> 
> I vaguely you remember talking about installed tests, but coming from someone
> who's into things like Build API [1] this is inconsistent and surprising. Just
> saying :P

check isn't in the build API.  I just use installed tests for ostree at the moment.

Basically:

$ jhbuild buildone ostree
$ gnome-desktop-testing-runner -p 0 ostree/