Bug 1382162

Summary: abipkgdiff crashes with SIGABRT if XDG_CACHE_HOME does not exist
Product: [Fedora] Fedora Reporter: Orion Poplawski <orion>
Component: libabigailAssignee: Sinny Kumari <ksinny>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 26CC: dodji, dodji, ksinny
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-01 09:20:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Orion Poplawski 2016-10-05 22:27:36 UTC
Description of problem:

XDG_CACHE_HOME=/var/cache/user/root
# ls /var/cache/user/root
ls: cannot access '/var/cache/user/root': No such file or directory

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
58      }
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
#1  0x00007ffff630756a in __GI_abort () at abort.c:89
#2  0x000055555555bf28 in package::extracted_packages_parent_dir[abi:cxx11]() ()
    at abipkgdiff.cc:574
#3  0x0000555555561887 in package::package (this=0x55555577d010,
    path="/data/repos/fedora/development/rawhide/Everything/x86_64/os/Packages/f/fftw-libs-double-3.3.4-7.fc24.x86_64.rpm", dir="package1", pkg_kind=package::KIND_MAIN) at abipkgdiff.cc:314
#4  0x000055555555935e in main (argc=<optimized out>, argv=<optimized out>)
    at abipkgdiff.cc:2003
(gdb) up
#1  0x00007ffff630756a in __GI_abort () at abort.c:89
89            raise (SIGABRT);
(gdb) up
#2  0x000055555555bf28 in package::extracted_packages_parent_dir[abi:cxx11]() ()
    at abipkgdiff.cc:574
574             abort();
(gdb) list
569
570           string libabigail_tmp_dir_template = p;
571           libabigail_tmp_dir_template += "/abipkgdiff-tmp-dir-XXXXXX";
572
573           if (!mkdtemp(const_cast<char*>(libabigail_tmp_dir_template.c_str())))
574             abort();
575
576           p = libabigail_tmp_dir_template;
577         }
578
(gdb) print libabigail_tmp_dir_template
$1 = "/var/cache/user/root/abipkgdiff-tmp-dir-35vxEo"

Version-Release number of selected component (if applicable):
libabigail-1.0-0.8.rc5.5.fc26.x86_64

It's hard to tell from https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html but if the directory doesn't exist I believe programs should create it with 0700 permissions.

Comment 1 Dodji Seketeli 2016-10-06 08:10:19 UTC
Right, I confirm this.  This is a real bug.

I have filed it upstream at https://sourceware.org/bugzilla/show_bug.cgi?id=20670.

Thank you for taking time to file this problem!

Comment 2 Dodji Seketeli 2016-11-30 09:45:31 UTC
This bug was fixed upstream.  Details are at https://sourceware.org/bugzilla/show_bug.cgi?id=20670.

The fix should be available in the 1.0.rc7 tarball.

Comment 3 Fedora End Of Life 2017-02-28 10:25:03 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.