Linking against libgrpc.so fails

Bug #1727528 reported by Thomas Voß
78
This bug affects 17 people
Affects Status Importance Assigned to Milestone
grpc (Ubuntu)
Confirmed
Undecided
Gianfranco Costamagna

Bug Description

When trying to build against the grpc packages in Artful, linking fails with:

  /usr/lib/libgrpc.so: undefined reference to `RSA_set0_key'

The package build logs for grpc contain two related warnings:

  dpkg-shlibdeps: warning: symbol RSA_set0_key used by debian/libgrpc3/usr/lib/libgrpc.so.3.0.0 found in none of the libraries
  dpkg-shlibdeps: warning: symbol RSA_set0_key used by debian/libgrpc3/usr/lib/libgrpc_cronet.so.3.0.0 found in none of the libraries

Tags: patch artful
Revision history for this message
Thomas Voß (thomas-voss) wrote :

I generated this debdiff, hope it is helpful:

diff -Nru grpc-1.3.2/debian/changelog grpc-1.3.2/debian/changelog
--- grpc-1.3.2/debian/changelog 2017-08-14 12:44:38.000000000 +0200
+++ grpc-1.3.2/debian/changelog 2017-10-25 23:36:46.000000000 +0200
@@ -1,3 +1,9 @@
+grpc (1.3.2-1ubuntu1) bionic; urgency=medium
+
+ * Revert patch openssl-1.1.0 (Closes: #1727528)
+
+ -- Thomas Voß <email address hidden> Wed, 25 Oct 2017 23:36:46 +0200
+
 grpc (1.3.2-1) unstable; urgency=medium

   [ Pirate Praveen <email address hidden> ]
diff -Nru grpc-1.3.2/debian/patches/openssl-1.1.0.diff grpc-1.3.2/debian/patches/openssl-1.1.0.diff
--- grpc-1.3.2/debian/patches/openssl-1.1.0.diff 2017-04-26 20:21:19.000000000 +0200
+++ grpc-1.3.2/debian/patches/openssl-1.1.0.diff 1970-01-01 01:00:00.000000000 +0100
@@ -1,49 +0,0 @@
-Description: Fix compilation of gRPC with OpenSSL 1.1.0.
-Author: Steinar H. Gunderson <email address hidden>
-
-Index: grpc-1.2.5/src/core/lib/security/credentials/jwt/jwt_verifier.c
-===================================================================
---- grpc-1.2.5.orig/src/core/lib/security/credentials/jwt/jwt_verifier.c
-+++ grpc-1.2.5/src/core/lib/security/credentials/jwt/jwt_verifier.c
-@@ -481,6 +481,7 @@ static EVP_PKEY *pkey_from_jwk(grpc_exec
- const char *kty) {
- const grpc_json *key_prop;
- RSA *rsa = NULL;
-+ BIGNUM *n = NULL, *e = NULL;
- EVP_PKEY *result = NULL;
-
- GPR_ASSERT(kty != NULL && json != NULL);
-@@ -495,24 +496,26 @@ static EVP_PKEY *pkey_from_jwk(grpc_exec
- }
- for (key_prop = json->child; key_prop != NULL; key_prop = key_prop->next) {
- if (strcmp(key_prop->key, "n") == 0) {
-- rsa->n =
-- bignum_from_base64(exec_ctx, validate_string_field(key_prop, "n"));
-- if (rsa->n == NULL) goto end;
-+ n = bignum_from_base64(exec_ctx, validate_string_field(key_prop, "n"));
-+ if (n == NULL) goto end;
- } else if (strcmp(key_prop->key, "e") == 0) {
-- rsa->e =
-- bignum_from_base64(exec_ctx, validate_string_field(key_prop, "e"));
-- if (rsa->e == NULL) goto end;
-+ e = bignum_from_base64(exec_ctx, validate_string_field(key_prop, "e"));
-+ if (e == NULL) goto end;
- }
- }
-- if (rsa->e == NULL || rsa->n == NULL) {
-+ if (e == NULL || n == NULL) {
- gpr_log(GPR_ERROR, "Missing RSA public key field.");
- goto end;
- }
-+ RSA_set0_key(rsa, n, e, NULL);
-+ n = e = NULL;
- result = EVP_PKEY_new();
- EVP_PKEY_set1_RSA(result, rsa); /* uprefs rsa. */
-
- end:
- if (rsa != NULL) RSA_free(rsa);
-+ if (n != NULL) BN_free(n);
-+ if (e != NULL) BN_free(e);
- return result;
- }
-
diff -Nru grpc-1.3.2/debian/patches/series grpc-1.3.2/debian/patches/series
--- grpc-1.3.2/debian/patches/series 2017-08-14 12:44:38.000000000 +0200
+++ grpc-1.3.2/debian/patches/series 2017-10-25 23:31:41.000000000 +0200
@@ -1,4 +1,3 @@
-openssl-1.1.0.diff
 no-werror.diff
 unvendor-zlib.diff
 fix-libgrpc++-soname.diff

Revision history for this message
Thomas Voß (thomas-voss) wrote :

We also want the fix in:

  https://github.com/grpc/grpc/issues/11195

tags: added: artful patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grpc (Ubuntu):
status: New → Confirmed
Revision history for this message
rojer (rojer9) wrote :

hello? anyone?

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

1) artful is EOL and unsupported, please reopen and update information in case this is an issue with cosmic, bionic or xenial.

For Bionic I don't think there is a problem, because openssl1.1 defaulted, and as you can see in the build log, the shlibdeps is not giving warnings anymore.

2) this is an underlinking, so manually adding ssl to the linker library should make the linker succeed and find the symbol even with artful.

So, closing as no-bug for now.

Changed in grpc (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

Also, if you want the bug eventually fixed (I don't think there is a bug here, but I might be wrong), answering to the questions in: https://github.com/grpc/grpc/issues/11195 and provide step-by-step instruction about how to reproduce the issue will help me in fixing it.

Changed in grpc (Ubuntu):
assignee: nobody → Gianfranco Costamagna (costamagnagianfranco)
Revision history for this message
Michael Grupp (michaelgrupp) wrote :

I made a small example to reproduce the bug with Bionic: https://github.com/MichaelGrupp/grpc_test_bionic

Re-building the Ubuntu package without -Wl,-Bsymbolic-functions in the LDFLAGS (as mentioned in https://github.com/grpc/grpc/issues/11195) fixes it.

As an experiment we also replaced the Ubuntu package with an equivalent version from Debian, which doesn't show the bug: https://snapshot.debian.org/package/grpc/1.3.2-1/
Again, this is probably because of the different flags.

Changed in grpc (Ubuntu):
status: Incomplete → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.