Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Win10 x64] Assertion failed: Successful WSASTARTUP not yet performed #1751

Closed
myd7349 opened this issue Aug 31, 2017 · 2 comments
Closed

[Win10 x64] Assertion failed: Successful WSASTARTUP not yet performed #1751

myd7349 opened this issue Aug 31, 2017 · 2 comments

Comments

@myd7349
Copy link
Contributor

myd7349 commented Aug 31, 2017

I encountered an Assertion failed error on exit while czmq is doing clean internally.

Environment:
OS: Windows 10 Home Edition(version 10.0.15063) 64bit
Visual Studio: vs2010 and vs2017
libzmq: v4.2.2(7283574c)
czmq: v4.0.2( c545b4f)
platform.h for czmq:

#define CZMQ_HAVE_WINDOWS 
#define HAVE_LIBZMQ 
#undef HAVE_UUID
#undef HAVE_SYSTEMD
#undef HAVE_LZ4
//  Provide draft classes and methods
#define CZMQ_BUILD_DRAFT_API 

Both libzmq and czmq are built in Win32, Debug mode.

Code snippet for reproduce this issue:

#include <czmq.h>

int main()
{
    zsock_t *sock = zsock_new(ZMQ_REQ);
    zsock_destroy(&sock);

    return 0;
}

Code above does nothing but creates a czmq 4.x socket and then closes it. I tested it in vs2010 and vs2017. When this program exits, the program crashes:

Unhandled exception at 0x7507b802 in test.exe: 0x40000015: %hs.

and I saw an Assertion error in the console:

Assertion failed: Successful WSASTARTUP not yet performed (E:\dev\ZeroMQ\build\libzmq\src\signaler.cpp:192)

Any advice? Thanks!

@bluca
Copy link
Member

bluca commented Aug 31, 2017

Is the library built as a dll?
If so due to Windows limitations you need to call zsys_shutdown manually before exiting. See:

#989
#1608

@myd7349
Copy link
Contributor Author

myd7349 commented Sep 1, 2017

Yes, I build both libzmq and czmq as dll.

Thanks! @bluca It works. I should search the issue much more carefully.
Nice day! :)

@myd7349 myd7349 closed this as completed Sep 1, 2017
thalman added a commit to thalman/zproto that referenced this issue Oct 30, 2017
Solution: Call zsys_shutdown expicitely on windows platform
See also zeromq/czmq#1751
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants