LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 09-26-2017, 02:25 PM   #1
TimewarpUK
Member
 
Registered: Dec 2014
Posts: 33

Rep: Reputation: Disabled
'libdlfaker.so' from LD_PRELOAD cannot be preloaded


After setting my Cinnamon to load under Optirun, I now get this error when using sudo:

$ sudo -s
ERROR: ld.so: object 'libdlfaker.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'librrfaker.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
[sudo] password for foo


Sudo seems to work OK, but the error message is annoying and don't know whether I should be concerned.

I've tried installing VirtualGL / VirtualGL Devel and also created a .conf file:

cat /etc/ld.so.conf.d/foo.conf
/usr/lib/VirtualGL
/usr/lib64/VirtualGL


then running ldconfig.

The SO's are there too:

$ ls -l /usr/lib64/VirtualGL
total 440
-rwxr-xr-x 1 root root 6720 Feb 10 2017 libdlfaker.so
-rwxr-xr-x 1 root root 6720 Feb 10 2017 libgefaker.so
-rwxr-xr-x 1 root root 431520 Feb 10 2017 librrfaker.so


What could be the problem?

This is on Fedora 26.
 
Old 09-27-2017, 08:29 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
probably LD_PRELOAD cannot use ldconfig, try to specify full path:
LD_PRELOAD=/usr/lib64/VirtualGL/libdlfaker.so

https://stackoverflow.com/questions/...-preload-trick

Also (if I remember well) LD_PRELOAD can only use certified directories, or directories with correct permissions, otherwise will refuse to do that. But probably that was another OS/version/whatever.
 
Old 10-04-2017, 02:21 PM   #3
TimewarpUK
Member
 
Registered: Dec 2014
Posts: 33

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
probably LD_PRELOAD cannot use ldconfig, try to specify full path:
LD_PRELOAD=/usr/lib64/VirtualGL/libdlfaker.so

https://stackoverflow.com/questions/...-preload-trick

Also (if I remember well) LD_PRELOAD can only use certified directories, or directories with correct permissions, otherwise will refuse to do that. But probably that was another OS/version/whatever.
That does solve it if I set LD_PRELOAD to full path and then try sudo. Now I just need to set it permanently...

What's the best file to stick that in so it works both inside a terminal and when items are loaded from desktop?

Last edited by TimewarpUK; 10-04-2017 at 02:42 PM.
 
Old 10-04-2017, 02:42 PM   #4
TimewarpUK
Member
 
Registered: Dec 2014
Posts: 33

Original Poster
Rep: Reputation: Disabled
I tried adding to /etc/profile and .profile but my var ends up as

$ echo $LD_PRELOAD
libdlfaker.so:librrfaker.so:/usr/lib64/VirtualGL/libdlfaker.so:/usr/lib64/VirtualGL/librrfaker.so
 
Old 10-05-2017, 12:46 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
so would be nice to show us how did you exactly try it
 
Old 10-05-2017, 03:17 AM   #6
TimewarpUK
Member
 
Registered: Dec 2014
Posts: 33

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
so would be nice to show us how did you exactly try it
Sure.

In /etc/profile I added this to the end

export LD_PRELOAD=/usr/lib64/VirtualGL/libdlfaker.so:/usr/lib64/VirtualGL/librrfaker.so

Same problem due to something adding a prefix my env var:

echo $LD_PRELOAD
libdlfaker.so:librrfaker.so:/usr/lib64/VirtualGL/libdlfaker.so:/usr/lib64/VirtualGL/librrfaker.so


And also in ~/.profile I did the same with the same error. Note I rebooted after each change above.

Now if I add this to ~/.bashrc it works, however only for the interactive shell. Anything launched from the desktop (e.g. click Fedora menu then Wireshark) does not have the variable set. In the case of Wireshark it refuses to work because of this. Workaround is to run wireshark from a terminal, but that's not ideal.
 
Old 10-05-2017, 06:02 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
you need to check where it was modified
 
Old 10-05-2017, 06:48 AM   #8
TimewarpUK
Member
 
Registered: Dec 2014
Posts: 33

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
you need to check where it was modified
That's what I'm having trouble with.

I tried this https://unix.stackexchange.com/a/154971 but to no avail. Any tips?
 
Old 10-05-2017, 06:59 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
basically here are the list files to check: https://unix.stackexchange.com/a/249922.
 
Old 10-05-2017, 08:04 AM   #10
TimewarpUK
Member
 
Registered: Dec 2014
Posts: 33

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
basically here are the list files to check: https://unix.stackexchange.com/a/249922.
The only one set in there is the one I set:

$ cat ~/.bashrc|grep -i librrfaker
export LD_PRELOAD=/usr/lib64/VirtualGL/libdlfaker.so:/usr/lib64/VirtualGL/librrfaker.so


Any other ideas?

Update: I think optirun is adding the variable. Just need to work out how to stop it.

optirun -h
Usage: optirun [OPTION]... command [command options...]
Run an application using the discrete video card.

--failsafe run a program even if the nvidia card is unavailable
--no-failsafe do not run a program if the nvidia card is unavailable
--no-xorg do not start secondary X server (implies -b none)
-b, --bridge METHOD acceleration/displaying bridge to use. Valid values
are auto, virtualgl and primus. The --vgl-* options
only make sense when using the virtualgl bridge,
while the --primus-* options apply only when using
the primus bridge.
Additionally, value none is recognized, and its effect
is to add paths to driver libraries to LD_LIBRARY_PATH
(useful for nvidia-settings and CUDA applications)
-c, --vgl-compress METHOD image compression or transport to use with
VirtualGL. Valid values for METHOD are proxy,
jpeg, rgb, xv and yuv. Changing this setting
may affect performance, CPU usage and image
quality
--vgl-options OPTS a space-separated list of command options to be
passed to vglrun. Useful for debugging virtualgl
by passing options to it like +tr. These OPTS
override the settings from optirun so be careful
with setting it
--primus-ldpath PATH a colon-separated list of paths which are searched
for the primus libGL.so.1
-q, --quiet, --silent supresses all logging messages
-v, --verbose increase the verbosity level of log messages. It
can be specified up to two times (or five if
--quiet is used)
--debug show all logging messsages by setting the verbosity
level to the maximum
-C, --config FILE retrieve settings for Bumblebee from FILE
-d, --display VDISPLAY find the Bumblebee X server on VDISPLAY. Do not
confuse this option with the DISPLAY environment
variable. By default, PATH is queried from the
daemon
-l, --ldpath PATH libraries like libGL.so are searched in PATH
(useful for the nvidia driver). By default, PATH
is queried from the
-s, --socket FILENAME use FILENAME for communication with the daemon
-h, --help display this help and exit
--version output version information and exit

Examples:
optirun glxspheres Runs the graphics demo supplied with Virtual GL.
optirun -c yuv glxspheres Runs a program with the yuv transport method for
better performance.
optirun firefox http://example.com Run a program with arguments.

Report bugs on <http://Bumblebee-Project.org/issues>
Bumblebee homepage: <http://Bumblebee-Project.org/>

Last edited by TimewarpUK; 10-05-2017 at 08:08 AM.
 
Old 10-05-2017, 05:27 PM   #11
TimewarpUK
Member
 
Registered: Dec 2014
Posts: 33

Original Poster
Rep: Reputation: Disabled
How can I prevent Optirun from breaking my $LD_PRELOAD?

Confirmation:

$ echo $LD_PRELOAD
/usr/lib64/VirtualGL/libdlfaker.so:/usr/lib64/VirtualGL/librrfaker.so
[foo@bar ~]$ optirun /bin/bash --norc
bash-4.4$ echo $LD_PRELOAD
libdlfaker.so:librrfaker.so:/usr/lib64/VirtualGL/libdlfaker.so:/usr/lib64/VirtualGL/librrfaker.so
bash-4.4$


Optirun prepending the two SO's without paths causes the original error.
 
Old 10-06-2017, 12:39 AM   #12
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
so probably here:
https://github.com/Bumblebee-Project.../Configuration

by the way you may try to find it by:
Code:
grep -r librrfaker.so /etc

Last edited by pan64; 10-06-2017 at 12:41 AM.
 
Old 10-06-2017, 03:12 AM   #13
TimewarpUK
Member
 
Registered: Dec 2014
Posts: 33

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post

Wonder if you can configure it not to set env vars? Can't see any extensive information on how to do this.

I think the chain is
Code:
/etc/environment, /etc/profile (and other startup scripts) --> optirun cinnamon
therefore anything set in system files is overridden by Optirun. Another solution would be if cinnamon can pick up env vars or run scripts, and I could do my overriding there.

Quote:
Originally Posted by pan64 View Post
so probably here:
by the way you may try to find it by:
Code:
grep -r librrfaker.so /etc
Just here:

Code:
grep -r librrfaker.so /etc
Binary file /etc/ld.so.cache matches
 
Old 10-06-2017, 03:29 AM   #14
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
optirun opens a new shell and this shell is preconfigured by optirun itself. This can be configured in bumblebee.conf (at least I think).
 
Old 10-07-2017, 06:59 AM   #15
TimewarpUK
Member
 
Registered: Dec 2014
Posts: 33

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
optirun opens a new shell and this shell is preconfigured by optirun itself. This can be configured in bumblebee.conf (at least I think).
Hmm - I think you can only set in there what you can in command line (i.e. optirun -h above). I could be wrong (hopefully)...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How can I solve Proxychains error "LD_PRELOAD cannot be preloaded" ? hack3rcon Debian 5 04-21-2020 06:19 AM
ERROR: ld.so: object 'libhugetlbfs.so' from LD_PRELOAD cannot be preloaded: ignored rsgsrinivasan Linux - Software 1 11-24-2015 07:16 AM
How to avoid LD_PRELOAD ? APLinux Linux - Newbie 12 11-27-2014 03:19 PM
ERROR: ld.so: LD_PRELOAD cannot be preloaded xombboxer Linux - Newbie 2 05-12-2011 11:16 AM
What dERROR: ld.so: object 'libavfs.so' from LD_PRELOAD cannot be preloaded: ignored. arubin Slackware 1 05-01-2006 09:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 03:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration