Description of problem: libxdg-basedir has an out of bounds error Version-Release number of selected component (if applicable): libxdg-basedir-1.2.0-14.fc29.x86_64 How reproducible: Always Steps to Reproduce: 1. Compile the program in 'Additional info' 2. Run it with valgrind Actual results: ==8658== Invalid write of size 8 ==8658== at 0x489597E: ??? (in /usr/lib64/libxdg-basedir.so.1.2.0) ==8658== by 0x4895F93: xdgSearchableConfigDirectories (in /usr/lib64/libxdg-basedir.so.1.2.0) ==8658== by 0x401157: main (foo.c:7) ==8658== Address 0x4a6304e is 14 bytes inside a block of size 21 alloc'd ==8658== at 0x483880B: malloc (vg_replace_malloc.c:309) ==8658== by 0x489594D: ??? (in /usr/lib64/libxdg-basedir.so.1.2.0) ==8658== by 0x4895F93: xdgSearchableConfigDirectories (in /usr/lib64/libxdg-basedir.so.1.2.0) ==8658== by 0x401157: main (foo.c:7) ==8658== ==8658== Invalid read of size 1 ==8658== at 0x483BC94: __strlen_sse2 (vg_replace_strmem.c:463) ==8658== by 0x490DB85: puts (in /usr/lib64/libc-2.28.so) ==8658== by 0x401174: main (foo.c:11) ==8658== Address 0x4a63055 is 0 bytes after a block of size 21 alloc'd ==8658== at 0x483880B: malloc (vg_replace_malloc.c:309) ==8658== by 0x489594D: ??? (in /usr/lib64/libxdg-basedir.so.1.2.0) ==8658== by 0x4895F93: xdgSearchableConfigDirectories (in /usr/lib64/libxdg-basedir.so.1.2.0) ==8658== by 0x401157: main (foo.c:7) Expected results: No errors Additional info: /* compile with 'gcc -g -o foo foo.c -lxdg-basedir' */ #include <basedir.h> #include <stdlib.h> #include <stdio.h> int main() { const char * const *config_paths = xdgSearchableConfigDirectories(NULL); const char * const *path; for (path = config_paths ; *path ; path++) { printf("%s\n", *path); } free((const char **)config_paths); return 0; }
Created attachment 1534020 [details] Make sure libtoolized tests be properly checked by valgrind
Created attachment 1534022 [details] Fix bounds error
Created attachment 1534023 [details] Proposed changes to .spec file
The upstream seems to have moved, probably to https://github.com/devnev/libxdg-basedir, where master contains the bug fix, and a pull-request for the valgrind check has been submitted.
Looks like the tests fail on f29 for ppc64 but pass on rawhide. Disable checks or leave it in rawhide only?
Don´t have access to ppc64 system, but failure logs might give some insight?
This is the log. It's actually ppc64le, but no, I don't have one either. :) https://kojipkgs.fedoraproject.org//work/tasks/3884/32763884/build.log
Looks like a bug in libc, triggered by /bin/bash (probably the libtool script that calls the executable in the .libs subdirectory in tests/). To verify this, I think the query-harness could be hacked to call the .libs test directly with LD_LIBRARY_PATH set to the location of the .so file. What do I have to do to run builds in kojipkgs.fedoraproject.org?
You'd need a valid FAS login. If you have what I'd need to run, I can test it.
First try might be to do a export LC_ALL=C in query-harness.sh, and hope that set_locale skips the call to nl_find_locale (or takes a different code path), will try to come up with something tomorrow.
Created attachment 1534336 [details] Make sure libtoolized tests be properly checked by valgrind
Created attachment 1534337 [details] Proposed changes to .spec file
Google is my friend, libtool is now used to avoid checking sanity of libtool generated bash script.
Failed scratch build log: https://kojipkgs.fedoraproject.org//work/tasks/9157/32779157/build.log
Patch 1 & 2 not applied!
Oops. Now more failures: https://koji.fedoraproject.org/koji/taskinfo?taskID=32786195 https://koji.fedoraproject.org/koji/taskinfo?taskID=32786220
Hmm, libtool is used in %build, but comes from ../libtool, so it´s either that or libtool-devel, I guess...
I BuildRequired libtool, and it worked. I'll commit and get builds out. Thanks!
Thank you!
libxdg-basedir-1.2.0-17.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-ccbdc3cb5b
libxdg-basedir-1.2.0-17.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-ccbdc3cb5b
libxdg-basedir-1.2.0-17.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.