Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upUse of __pthread_get_minstack leads to unnecessarily strict libc6 versioned dependency on Debian #23628
Comments
huonw
added
the
A-infrastructure
label
Mar 23, 2015
This comment has been minimized.
This comment has been minimized.
|
Ah, this is annoying. Do you happen to know of a way that we can avoid the strict dependency while still calling (It is used as a weak symbol atm.) |
This comment has been minimized.
This comment has been minimized.
|
triage: I-nominated |
This comment has been minimized.
This comment has been minimized.
|
I guess one horrible solution would be to look up the symbol with #include <dlfcn.h>
#include <pthread.h>
#include <stdio.h>
#include <string.h>
int main()
{
pthread_attr_t attr;
pthread_attr_init(&attr);
memset(&attr, 0, sizeof(attr));
void *handle = dlopen(NULL, RTLD_LAZY);
size_t (*__pthread_get_minstack)(const pthread_attr_t *attr) =
dlsym(handle, "__pthread_get_minstack");
if (__pthread_get_minstack != NULL)
printf("%zd\n", __pthread_get_minstack(&attr));
dlclose(handle);
pthread_attr_destroy(&attr);
return 0;
}$ gcc -Wall minstack.c -ldl -lpthread -o minstack
$ ./minstack
24640
$ dpkg-shlibdeps minstack
dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory
$ cat debian/substvars
shlibs:Depends=libc6 (>= 2.4) |
rust-highfive
added
the
I-nominated
label
Mar 23, 2015
andersk
added a commit
to andersk/rust
that referenced
this issue
Mar 23, 2015
andersk
added a commit
to andersk/rust
that referenced
this issue
Mar 23, 2015
andersk
referenced this issue
Mar 23, 2015
Merged
Get __pthread_get_minstack at runtime with dlsym #23631
This comment has been minimized.
This comment has been minimized.
|
BTW, |
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Mar 23, 2015
bors
closed this
in
#23631
Mar 24, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
andersk commentedMar 23, 2015
The Rust libraries gained a dependency on the private glibc symbol
__pthread_get_minstackin #6233; it was reverted in #11331 and reinstated in #11885 (“Alright, let's merge this and then we can see how big the impact is.”). Here’s part of the impact that may not have been considered:The Debian package build system includes a tool
dpkg-shlibdepsthat scans all binaries and libraries to be included in a package to infer dependency information for shared libraries. Based on the symbol information in/var/lib/dpkg/info/libc6:amd64.symbols, the use of__pthread_get_minstack@GLIBC_PRIVATEis translated into a strict versioned dependency on the exact version of libc6 that the package was built against:What this means in practice is that a Debian package containing threaded Rust code built on one release of Debian or Ubuntu will not be installable on any other release. Trying to upgrade to a new release while such a package is installed will cause dependency errors.
(What caused me to notice this problem is that the
rust-nightlypackage for Ubuntu 14.10 in ppa:hansjorg/rust is no longer installable on Ubuntu 15.04 after a libc6 upgrade.)