You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Dave Cottlehuber (JIRA)" <ji...@apache.org> on 2012/05/22 17:28:42 UTC

[jira] [Created] (COUCHDB-1482) Snappy NIF cannot be loaded on Windows 2008 R2 x64 Server

Dave Cottlehuber created COUCHDB-1482:
-----------------------------------------

             Summary: Snappy NIF cannot be loaded on Windows 2008 R2 x64 Server
                 Key: COUCHDB-1482
                 URL: https://issues.apache.org/jira/browse/COUCHDB-1482
             Project: CouchDB
          Issue Type: Bug
          Components: Build System
    Affects Versions: 1.2
         Environment: Windows 2008 R2 x64 Server but *not* any other Windows platform
            Reporter: Dave Cottlehuber
             Fix For: 1.2.1


Initially it looks like there is a difference in how Windows resolves DLL dependencies for the required C++ runtimes. The snappy NIF is the only one with included C++ code, and it depends on both debug & release DLLs. On W2008R2 server this prevents loading, but on Windows 7 it does not. 

My eternal thanks go to Nick North for uncovering this gem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (COUCHDB-1482) Snappy NIF cannot be loaded on Windows 2008 R2 x64 Server

Posted by "Dave Cottlehuber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13284646#comment-13284646 ] 

Dave Cottlehuber commented on COUCHDB-1482:
-------------------------------------------

-Ox is sufficient to force expected behaviour. Fixed on master and 1.2.x.  Generated DLLs can be checked using depends in future.
                
> Snappy NIF cannot be loaded on Windows 2008 R2 x64 Server
> ---------------------------------------------------------
>
>                 Key: COUCHDB-1482
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1482
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Build System
>    Affects Versions: 1.2
>         Environment: Windows 2008 R2 x64 Server but *not* any other Windows platform
>            Reporter: Dave Cottlehuber
>              Labels: windows
>             Fix For: 1.2.1
>
>
> Initially it looks like there is a difference in how Windows resolves DLL dependencies for the required C++ runtimes. The snappy NIF is the only one with included C++ code, and it depends on both debug & release DLLs. On W2008R2 server this prevents loading, but on Windows 7 it does not. 
> My eternal thanks go to Nick North for uncovering this gem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (COUCHDB-1482) Snappy NIF cannot be loaded on Windows 2008 R2 x64 Server

Posted by "Dave Cottlehuber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13281301#comment-13281301 ] 

Dave Cottlehuber commented on COUCHDB-1482:
-------------------------------------------

This is a more appropriate solution:
 +snappy_nif_la_CXXFLAGS += -EHsc - -Ox -Zi

                
> Snappy NIF cannot be loaded on Windows 2008 R2 x64 Server
> ---------------------------------------------------------
>
>                 Key: COUCHDB-1482
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1482
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Build System
>    Affects Versions: 1.2
>         Environment: Windows 2008 R2 x64 Server but *not* any other Windows platform
>            Reporter: Dave Cottlehuber
>              Labels: windows
>             Fix For: 1.2.1
>
>
> Initially it looks like there is a difference in how Windows resolves DLL dependencies for the required C++ runtimes. The snappy NIF is the only one with included C++ code, and it depends on both debug & release DLLs. On W2008R2 server this prevents loading, but on Windows 7 it does not. 
> My eternal thanks go to Nick North for uncovering this gem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (COUCHDB-1482) Snappy NIF cannot be loaded on Windows 2008 R2 x64 Server

Posted by "Dave Cottlehuber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13281279#comment-13281279 ] 

Dave Cottlehuber commented on COUCHDB-1482:
-------------------------------------------

It looks like the OTP build scripts are adding an unwanted helping hand again:

https://github.com/erlang/otp/blob/cfea5eea406ba3af96588ff458e55de9a149d9c5/erts/etc/win32/cygwin_tools/vc/cc.sh#L87-114

Interestingly the subsequent #L115-133 provide switches to undo *exactly* this issue. Clearly this is not the first time....

A fix for this is to add some OTP-specific directives into snappy/Makefile.am to undo the optimisations that cc.sh and ld.sh apply:

diff --git a/src/snappy/Makefile.am b/src/snappy/Makefile.am
index bca103b..18f47ec 100644
--- a/src/snappy/Makefile.am
+++ b/src/snappy/Makefile.am
@@ -56,7 +56,7 @@ snappy_nif_la_LDFLAGS = -module -avoid-version
 
 if WINDOWS
 snappy_nif_la_LDFLAGS += -no-undefined
-snappy_nif_la_CXXFLAGS += -EHsc
+snappy_nif_la_CXXFLAGS += -EHsc -mt -md -ml
 SNAPPY_SO_NAME = snappy_nif.dll
 else
 SNAPPY_SO_NAME = snappy_nif.so

Increasing the optimisation level might also work. More testing reqd, &
hopefully get this down to just 1 additional flag here.
                
> Snappy NIF cannot be loaded on Windows 2008 R2 x64 Server
> ---------------------------------------------------------
>
>                 Key: COUCHDB-1482
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1482
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Build System
>    Affects Versions: 1.2
>         Environment: Windows 2008 R2 x64 Server but *not* any other Windows platform
>            Reporter: Dave Cottlehuber
>              Labels: windows
>             Fix For: 1.2.1
>
>
> Initially it looks like there is a difference in how Windows resolves DLL dependencies for the required C++ runtimes. The snappy NIF is the only one with included C++ code, and it depends on both debug & release DLLs. On W2008R2 server this prevents loading, but on Windows 7 it does not. 
> My eternal thanks go to Nick North for uncovering this gem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (COUCHDB-1482) Snappy NIF cannot be loaded on Windows 2008 R2 x64 Server

Posted by "Dave Cottlehuber (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-1482?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dave Cottlehuber closed COUCHDB-1482.
-------------------------------------

    Resolution: Fixed
      Assignee: Dave Cottlehuber
    
> Snappy NIF cannot be loaded on Windows 2008 R2 x64 Server
> ---------------------------------------------------------
>
>                 Key: COUCHDB-1482
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1482
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Build System
>    Affects Versions: 1.2
>         Environment: Windows 2008 R2 x64 Server but *not* any other Windows platform
>            Reporter: Dave Cottlehuber
>            Assignee: Dave Cottlehuber
>              Labels: windows
>             Fix For: 1.2.1
>
>
> Initially it looks like there is a difference in how Windows resolves DLL dependencies for the required C++ runtimes. The snappy NIF is the only one with included C++ code, and it depends on both debug & release DLLs. On W2008R2 server this prevents loading, but on Windows 7 it does not. 
> My eternal thanks go to Nick North for uncovering this gem.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira