Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symbol lookup error #46

Closed
Raffadiely opened this issue Oct 1, 2021 · 9 comments
Closed

symbol lookup error #46

Raffadiely opened this issue Oct 1, 2021 · 9 comments

Comments

@Raffadiely
Copy link

Raffadiely commented Oct 1, 2021

when attempting to preload the library with LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify, an error is returned and Spotify does not open.

The error says:
/bin/sh: symbol lookup error: /usr/local/lib/spotify-adblock.so: undefined symbol: cef_string_userfree_utf16_free

This happens regardless of whether I point LD_PRELOAD at the .so created from compiling, or the .so downloaded from the GitHub release page.

This happens regardless of which shell I run the command from (I have tried fish, bash, and sh), though fish reports an exit code of [127] and when using bash the error instead begins with "/bin/bash".

When using a spotify-adblock.desktop file as described in the README and attempting to launch with wofi, Spotify simply does not open. I assume that the same error is occurring invisibly when wofi runs the command.

I am running glibc Void Linux, with xbps updates run this morning, and the Spotify that is available via xbps-src - 1.1.68 as of this writing.

I am lost as to what I could be doing differently and have been unable to find a solution from searching online.
I'm happy to provide any other info that might be helpful.

@abba23
Copy link
Owner

abba23 commented Oct 2, 2021

Sounds like the same problem as #2. The package puts a shell script in your PATH instead of the actual Spotify binary, so it tries to load the adblocking library into /bin/bash first when you execute spotify, which fails. Looking at the script, something like

LD_LIBRARY_PATH=/usr/libexec/spotify LD_PRELOAD=/usr/local/lib/spotify-adblock.so /usr/libexec/spotify/spotify

might work for you.

@Raffadiely
Copy link
Author

This did seem to work, thank you! Spotify launches, and I can see cef_urlrequest_create(s) being logged in the terminal I issued that command in. Ads do not appear.

Now, however, with the library loaded, Spotify seems unable to play any music.
When I select a song, a blue alert appears that says "Spotify can't play this right now. If you have the file on your computer you can import it." and an error appears in the terminal:
GLib-GIO-CRITICAL **:[timestamp]: g_dbus_connection_send_message: assertion 'G_IS_DBUS_CONNECTION (connection)' failed

Should I close this issue and open another to address this?

@Raffadiely
Copy link
Author

Just a brief update, for whatever reason trying again today Spotify has no problems. I've created a .desktop file that preloads the .so and targets the Spotify executable directly instead of the sh file, and while that did not work yesterday it seems to be fine now. I can open up Spotify and play music, and no ads appear in the interface or play between songs, exactly as intended.

No idea what was preventing it from playing before, but I'll close this issue.

Thanks again for all!

@efe3535
Copy link

efe3535 commented Dec 14, 2021

LD_LIBRARY_PATH=/opt/spotify/spotify-client LD_PRELOAD=/usr/local/lib/spotify-adblock.so /opt/spotify/spotify-client/spotify
On Gentoo, Spotify was installed at /opt/spotify/spotify-client, changed accordingly and it works.

@tubbadu
Copy link

tubbadu commented Jun 3, 2022

for me on Fedora 36 spotify is installed is /usr/bin/spotify, and either

LD_LIBRARY_PATH=/usr/bin/spotify LD_PRELOAD=/usr/local/lib/spotify-adblock.so /usr/bin/spotify

or

LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify

still gives me this error

@ghost
Copy link

ghost commented Jul 16, 2022

LD_LIBRARY_PATH=/usr/lib64/spotify-client LC_NUMERIC=en_US.utf8 LD_PRELOAD=/usr/local/lib/spotify-adblock.so /usr/lib64/spotify-client/spotify

for fedora with lpf

@liukliukliuk
Copy link

LD_LIBRARY_PATH=/usr/lib64/spotify-client LC_NUMERIC=en_US.utf8 LD_PRELOAD=/usr/local/lib/spotify-adblock.so /usr/lib64/spotify-client/spotify

for fedora with lpf

it worked for me, but how can i make this the default spotify, so i could open it from the applications menu?

@efe3535
Copy link

efe3535 commented Oct 6, 2022

copy spotify's desktop file (/usr/share/applications/spotify.desktop) and create a new one (/usr/local/share/spotify_adblock.desktop etc.), change Name section to "Spotify (adblock)"
Modify "Exec=LD_LIBRARY_PATH=/usr/lib64/spotify-client LC_NUMERIC=en_US.utf8 LD_PRELOAD=/usr/local/lib/spotify-adblock.so /usr/lib64/spotify-client/spotify"

It should look like this:

[Desktop Entry]
Type=Application
Name=Spotify (adblock)
GenericName=Music Player
Icon=spotify-client
TryExec=spotify
Exec=LD_LIBRARY_PATH=/usr/lib64/spotify-client LC_NUMERIC=en_US.utf8 LD_PRELOAD=/usr/local/lib/spotify-adblock.so /usr/lib64/spotify-client/spotify
Terminal=false
MimeType=x-scheme-handler/spotify;
Categories=Audio;Music;Player;AudioVideo;
StartupWMClass=spotify

I haven't tested but it'll probably work.

@abba23
Copy link
Owner

abba23 commented Apr 2, 2023

With 14a0e8e, this problem is possibly solved and editing of wrapper scripts not necessary anymore.

@abba23 abba23 unpinned this issue May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants