You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What follows has been verified on Fedora (F20, rawhide) and Ubuntu (12.04 - 14.04).
cups_globals_init() (through _cupsGlobals ()) in cups/globals.c registers thread data with destructor cups_globals_free. If the cups shared object is dlclosed before the thread ends, __nptl_deallocate_tsd will attempt to call the destructor which is not a valid address anymore, and causes the application to crash.
To reproduce, make sure libsane-hpaio is installed and run the follwing sample program:
g++ -g -std=c++11 -o test test.cpp $(pkg-config --cflags --libs sane-backends)
Like most shared libraries, the CUPS library cannot be safely dynamically unloaded. What you are doing is importable and unsupported. And note that libraries like OpenSSL that libcups links to are also not dlopen/close safe.
Version: 1.7-current
CUPS.org User: smani
What follows has been verified on Fedora (F20, rawhide) and Ubuntu (12.04 - 14.04).
cups_globals_init() (through _cupsGlobals ()) in cups/globals.c registers thread data with destructor cups_globals_free. If the cups shared object is dlclosed before the thread ends, __nptl_deallocate_tsd will attempt to call the destructor which is not a valid address anymore, and causes the application to crash.
To reproduce, make sure libsane-hpaio is installed and run the follwing sample program:
g++ -g -std=c++11 -o test test.cpp $(pkg-config --cflags --libs sane-backends)
include
include
include
include <sane/sane.h>
void scan_thread() {
SANE_Status status;
}
int main() {
std::thread t(scan_thread);
t.join();
return 0;
}
See also https://bugzilla.redhat.com/show_bug.cgi?id=1065695
The attached patch fixes the issue, though likely not very portable.
The text was updated successfully, but these errors were encountered: