Bug 1333333

Summary: Regresion in dynamic loading libraries
Product: [Fedora] Fedora Reporter: Ľuboš Kardoš <lkardos>
Component: fakechrootAssignee: Mosaab Alzoubi <moceap>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: Axel.Thimm, i, jorton, moceap, sergio
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: fakechroot-2.18-1.fc24 fakechroot-2.18-1.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-31 08:13:13 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:
Embargoed:

Description Ľuboš Kardoš 2016-05-05 10:13:18 UTC
Description of problem:
Rpm test suite stopped working with the version fakechroot-2.17.2-1.fc22, it worked fine with the previous released version fakechroot-2.9-32.fc22. The problem is that dlopen() can't open libraries outside of fake root now. Have a look at the minimal reproducer in the steps to reproduce section.


Version-Release number of selected component (if applicable):
fakechroot-2.17.2-1


How reproducible:
always


Steps to Reproduce:
# mkdir -p test`rpm -E %_libdir`
# cd test
# cat <<'EOF' > test.c
> #include <dlfcn.h>
> 
> int main()
> {
>     void *handle;
>     void (*printFoo) (void);
> 
>     handle = dlopen("libtest.so", RTLD_LAZY);
>     printFoo = dlsym(handle, "printFoo");
>     printFoo();
> 
>     return 0;
> }
> EOF
#
# cat <<'EOF' > libtest.c
> #include <stdio.h>
> 
> void printFoo()
> {
>     printf("foo\n");
> }
> EOF
#
# gcc -ldl -o test test.c
# gcc -shared -fPIC -o libtest.so libtest.c
# mv libtest.so `rpm -E %_libdir`
# ldconfig
# export LD_LIBRARY_PATH=`pwd``rpm -E %_libdir`
# export FAKECHROOT_BASE=`pwd`
# 
# # With fakechroot-2.9-32.fc22 you have following output
# fakechroot ./test
foo
#
# # but after update to fakechroot-2.17.2-1.fc22
# fakechroot ./test
/usr/bin/fakechroot: line 213: 18761 Segmentation fault      (core dumped) LD_LIBRARY_PATH="$fakechroot_paths" LD_PRELOAD="$fakechroot_lib" "$fakechroot_cmd" "${@:2}"


Actual results:
It seems that a fakechrooted binary can't dynamically load a library which is outside of a fake root. 


Expected results:
A fakechrooted binary should be able to load a library from outside of a fake root because it was able to do that with previous versions of fakechroot,


Additional info:

Comment 1 Fedora Update System 2016-05-18 13:10:19 UTC
fakechroot-2.18-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-d09ab3d5f3

Comment 2 Fedora Update System 2016-05-18 13:12:29 UTC
fakechroot-2.18-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-cffd6dfbb4

Comment 3 Fedora Update System 2016-05-21 01:34:17 UTC
fakechroot-2.18-1.fc24 has been pushed to the Fedora 24 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-2016-d09ab3d5f3

Comment 4 Fedora Update System 2016-05-21 02:28:10 UTC
fakechroot-2.18-1.fc23 has been pushed to the Fedora 23 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-2016-cffd6dfbb4

Comment 5 Fedora Update System 2016-05-31 08:13:09 UTC
fakechroot-2.18-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2016-05-31 19:57:51 UTC
fakechroot-2.18-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.