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

Supplied libzkgroup.so does not work #413

Closed
FransVeldman opened this issue Jan 12, 2021 · 13 comments
Closed

Supplied libzkgroup.so does not work #413

FransVeldman opened this issue Jan 12, 2021 · 13 comments

Comments

@FransVeldman
Copy link

The supplied libzkgroup.so file does not seem to work.
The output of uname --m is x86_64, so it should be the correct version.
If I extract this libzkgroup.so from the supplied jar and put it in the java lib path, it still doesn't work.
No matter what I do, I still get the following message:
WARN org.asamk.signal.Main - WARNING: Support for new group V2 is disabled, because the required native library dependency is missing: libzkgroup
java --version says:
openjdk 11.0.9.1 2020-11-04 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.9.1+1-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.9.1+1-LTS, mixed mode, sharing)

@Atomic-Bean
Copy link
Contributor

It might be worth re-building the lib file from source then. I made a wiki page detailing how to deal with this library file. If you have any questions or feel it could be improved, please let me know.

@FransVeldman
Copy link
Author

Thanks for your answer. However, I do not really understand how that should make a difference. Your wiki-page says "Do note that signal-cli already comes pre-bundled with the linux x86_64 version of zkgroup so if you are on that platform then you should be able to use signal-cli with no issues."
According to "uname --m" I have exactly that platform, so I will likely end up with the same file. Or am I missing something?
Also, I try to run signal-cli on a webserver. I guess to compile the new file, I will have to do it on that webserver, which is not really configured as a development machine. I'm somewhat reluctant to set up the required compilers and all that stuff on a busy production webserver. Is there another solution? And no, I don't have a second machine from the same type. So it seems I'm stuck here...
Any suggestions?

@Atomic-Bean
Copy link
Contributor

To be clear, what OS are you using? If its not linux, then any .so file won't work and you'll have to build the right library file.

I'm still new to the zkgroup stuff aswell, the wiki page is what worked for me and some other people. As a last option I think its worth a shot manually building the x86_64 library.

However AsamK knows more about this than I do, he'll probably be online in half a day's time from now if you're willing to wait.

@FransVeldman
Copy link
Author

This is the OS I'm using: CentOS Linux release 7.5.1804 (Core)

@FransVeldman
Copy link
Author

If I try to update the profile (updateProfile) I get another error, which also mentions "zkgroup".
Sending and receiving messages work though. I just seems something related to "zkgroup" is missing.

Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.signal.zkgroup.internal.Native
at org.signal.zkgroup.profiles.ProfileKey.getProfileKeyVersion(ProfileKey.java:47)
at org.whispersystems.signalservice.api.SignalServiceAccountManager.setVersionedProfile(SignalServiceAccountManager.java:730)
at org.asamk.signal.manager.Manager.setProfile(Manager.java:420)
at org.asamk.signal.commands.UpdateProfileCommand.handleCommand(UpdateProfileCommand.java:39)
at org.asamk.signal.Main.handleCommands(Main.java:196)
at org.asamk.signal.Main.init(Main.java:127)
at org.asamk.signal.Main.main(Main.java:67)

@Atomic-Bean
Copy link
Contributor

Atomic-Bean commented Jan 13, 2021

If I try to update the profile (updateProfile) I get another error, which also mentions "zkgroup".
Sending and receiving messages work though. I just seems something related to "zkgroup" is missing.

Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.signal.zkgroup.internal.Native
at org.signal.zkgroup.profiles.ProfileKey.getProfileKeyVersion(ProfileKey.java:47)
at org.whispersystems.signalservice.api.SignalServiceAccountManager.setVersionedProfile(SignalServiceAccountManager.java:730)
at org.asamk.signal.manager.Manager.setProfile(Manager.java:420)
at org.asamk.signal.commands.UpdateProfileCommand.handleCommand(UpdateProfileCommand.java:39)
at org.asamk.signal.Main.handleCommands(Main.java:196)
at org.asamk.signal.Main.init(Main.java:127)
at org.asamk.signal.Main.main(Main.java:67)

Yeah I recall a number of things depend on the zkgroup stuff despite not being "group" related. I had one of these too and when I got zkgroup working it disappeared, so don't worry too much about it.

Your OS is linux so I think it would be fine. I guess you can either wait for AsamK or you can try compile a new library file in the meantime.

@AsamK
Copy link
Owner

AsamK commented Jan 13, 2021

Looks like the bundled zkgroup lib was built with glibc 2.18 or newer (it requires a symbol with version GLIBC_2.18).
If I'm not mistaking CentOS 7.5.1804 comes with glibc 2.17 ...

@FransVeldman
Copy link
Author

ldd --version says 2.17
I have to admit that I'm not a high level language developer. I program micro-processors and I build websites. I'm not really into this java and glibc stuff, so I don't know how this zkgroup relates with all this.
If I somehow upgrade glibc to 2.18, will signal-cli then work as intended?
Or do I need to recompile libzkgroup.so anyway?
I have just installed JDK, gradle and rust on another webserver which can afford some down time if things go sour, this one runs on a i686 platform, I will try to get a working libzkgroup.so out of it.

@FransVeldman
Copy link
Author

Ok, I managed to compile a new libzkgroup.so for i686, and... IT WORKS!

@DangerD1024
Copy link

Ok, I managed to compile a new libzkgroup.so for i686, and... IT WORKS!

any manual how you did that? (Cargo build, and than what the next action, copy something conpiled to some directory?)

@exquo
Copy link
Contributor

exquo commented Sep 17, 2021

This repo has pre-compiled libraries: https://github.com/exquo/signal-libs-build. See the commands in the instructions section for adding them to signal-cli.

@DangerD1024
Copy link

DangerD1024 commented Sep 18, 2021

[root@srv2 signal]# zip -uj signal-cli-0.9.0/lib/signal-client-java-0.9.0.jar  libsignal_jni.so
[root@srv2 signal]# zip -uj signal-cli-0.9.0/lib/zkgroup-java-0.7.0.jar  libzkgroup.so
[root@srv2 signal]# cd signal-cli-0.9.0/bin
[root@srv2 bin]# ./signal-cli -u +1234567890 register
WARN ServiceConfig - Failed to call libzkgroup: /tmp/resource7660306545459190857.so: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /tmp/resource7660306545459190857.so)
WARN App - WARNING: Support for new group V2 is disabled, because the required native library dependency is missing: libzkgroup
WARN ServiceConfig - Failed to call libsignal-client: /tmp/resource16962320130307096700.so: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /tmp/resource16962320130307096700.so)
Missing required native library dependency: libsignal-client

Same here...

Tried to specify glibc 2.18 path:

[root@srv2 bin]# LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/glibc-2.18/lib ./signal-cli -u +1234567890 register
Segmentation fault

@exquo
Copy link
Contributor

exquo commented Sep 19, 2021

Sounds like your OS has an even earlier version of glibc (<=2.18). I don't think you can practicably specify or install a newer glibc version manually.

To use the libraries on that system, you'll need to compile them on it. See instructions in the wiki

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