Bug 1467717 - NSISdl.dll is not loadable (LIBWINPTHREAD-1.DLL)
NSISdl.dll is not loadable (LIBWINPTHREAD-1.DLL)
Status: NEW
Product: Fedora
Classification: Fedora
Component: mingw-nsis (Show other bugs)
26
x86_64 Linux
unspecified Severity high
: ---
: ---
Assigned To: Richard W.M. Jones
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-04 15:34 EDT by Xavier BRUGGHEMAN
Modified: 2017-08-24 14:42 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 734905
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Xavier BRUGGHEMAN 2017-07-04 15:34:25 EDT
+++ This bug was initially created as a clone of Bug #734905 +++

The NSISdl plugin built for Fedora and RedHat fails to load for NSIS installers which call NSISdl::download or NSISdl::download_quiet when the installer is generated by the makensis command of the mingw-nsis component.

I've used the Dependency Walker (http://www.dependencywalker.com/) to verify that the bug has the same kind of root cause as the original bug (https://bugzilla.redhat.com/show_bug.cgi?id=734905), except that the NSISdl.dll now depends on libwinpthread-1.dll instead of libstdc++-6.dll in the original bug.

The tool shows the following functions from libwinpthread-1.dll being referenced: pthread_getspecific, pthread_key_create, pthread_key_delete, pthread_mutex_lock, pthread_mutex_unlock, pthread_once, pthread_setspecific.


As mentioned by Kevin Kofler in the first comment of the original bug, "NSIS plugins may not depend on any additional DLLs, we have to link them statically.".


I've downloaded and tested some RPMs from https://kojipkgs.fedoraproject.org/packages/mingw-nsis/ to try and see when the regression occurred.

The NSISdl.dll files in /usr/share/nsis/Plugins/x86-ansi/ and /usr/share/nsis/Plugins/x86-unicode/ are both affected in following versions:
- mingw32-nsis-3.01-2.fc26.i686.rpm
- mingw32-nsis-3.01-2.fc26.x86_64.rpm
- mingw32-nsis-3.01-1.el7.x86_64.rpm

The NSISdl.dll file in /usr/share/nsis/Plugins/ is also affected in the following versions:
- mingw32-nsis-2.50-1.fc24.x86_64.rpm
- mingw32-nsis-2.46-17.fc24.i686.rpm
- mingw32-nsis-2.46-16.fc23.x86_64.rpm
- mingw32-nsis-2.46-13.fc21.x86_64.rpm


The last good version I could find is mingw32-nsis-2.46-12.fc21.x86_64.rpm so the regression should be around that time.


Comparing the build logs for NSISdl.dll between the -12 and -13 versions doesn't seem to show any changes to the linker command for that DLL.
- Logs for ..-12 at https://kojipkgs.fedoraproject.org/packages/mingw-nsis/2.46/12.fc21/data/logs/x86_64/build.log
- Logs for ..-13 at https://kojipkgs.fedoraproject.org/packages/mingw-nsis/2.46/13.fc21/data/logs/x86_64/build.log

In both cases it seems to be linked with:
i686-w64-mingw32-g++ -s -mwindows -Wl,--file-alignment,512 -Wl,-Map,build/release/NSISdl/NSISdl.map -static-libgcc -static-libstdc++ -Wl,-e_DllMain@12 -shared -o build/release/NSISdl/NSISdl.dll build/release/NSISdl/asyncdns.o build/release/NSISdl/connection.o build/release/NSISdl/httpget.o build/release/NSISdl/nsisdl.o build/release/NSISdl/util.o -Lbuild/release/api/nsis -lpluginapi -lkernel32 -luser32 -ladvapi32 -lws2_32 -Wl,--out-implib,build/release/NSISdl/libNSISdl.a -Wl,--output-def,build/release/NSISdl/NSISdl.def


I am a bit rusty with GCC, but maybe the situation could be improved by adding -static in there somewhere.

Note You need to log in before you can comment on or make changes to this bug.