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

Assertion Failed: Permission Denied #160

Open
wenjians opened this issue Sep 23, 2016 · 2 comments
Open

Assertion Failed: Permission Denied #160

wenjians opened this issue Sep 23, 2016 · 2 comments

Comments

@wenjians
Copy link

wenjians commented Sep 23, 2016

I'm developing an application on Windows 10 with ZeroMQ for some background connection. I'm using Visual Studio 2008 C++ and ZeroMQ version 4.0.4.

When ZeroMQ connection and send the data, Windows will popup an exception with message box "Unhandled exception at ...". When I built a simple console application, in console output, there was a message "Assertion failed: Permission denied (......\src\tcp_connecter.cpp:284)".

There is no exception if I choose no-blocking the connection.

I tried to catch the error, while there was no exception captured, so I understand it might because of ZeroMQ background task. This style of error pop up is not friend to customer and I'm wondering whether there is a gentle way let application get the error and remind customer kindly.

the following is the sample code.

int main()
{
zmq::context_t zmq_ctx(1);
zmq::socket_t zmq_socket(zmq_ctx, ZMQ_REQ);

try {
    zmq_socket.connect("tcp://192.168.1.160:5000"); 

    std::string message = "Hello, World";
    zmq::message_t sock_msg(message.length());
    memcpy(sock_msg.data(), message.c_str(), message.length());

    zmq_socket.send(sock_msg);  // error happens 
}
catch (zmq::error_t e)
{
    printf("error happens in ZeroMQ: %s\n", e.what());
}

}

@bluca
Copy link
Member

bluca commented Sep 23, 2016

I'm not a Windows expert but it's the TCP connect system call that is failing with permission denied, so you'll want to check your environment (and the windows docs to see what that means)

@wenjians
Copy link
Author

thanks a lot for your reply.

I wrote a simple TCP client and block in firewall as well, WinSocket can return error and application can report error accordingly, which is synchronous.

It might not easy for ZeroMQ since ZeroMQ does those in background thread and is asynchronous, but I'm wondering is it possible provide an option to monitor via zeromonitoring, application then can provide some customized friend error report to final user (most of them are nervous about such exception, which looks like application are crash.

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