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

Channel::OpenOpts::FromUri results in Access violation reading location 0x0000000000000000. #320

Open
TheYoungBeast opened this issue Jun 5, 2023 · 3 comments

Comments

@TheYoungBeast
Copy link

TheYoungBeast commented Jun 5, 2023

 try
    {
        Channel::OpenOpts ret = Channel::OpenOpts::FromUri("amqp://guest:guest@localhost:5672/");
        auto channel = Channel::Open(ret);
    }
    catch (exception e) {
        std::wcout << e.what() << std::endl;
    }

I use the RabbitMQ server on docker.
It works fine with other clients e.g. C# RabbitMq.Client.
It is painful to make this client work...
Above code results in the exception 'Access violation reading location 0x0000000000000000.'

// Windows 10, VS 2022 (mvsc 19)

@alanxz
Copy link
Owner

alanxz commented Jun 21, 2023

Could you provide a stacktrace at the point where it crashes?

As an observation: auto channel is a shared_ptr<> meaning when it goes out of scope, it is destructed. As such, if you want to use it outside of the try block, you'll need to declare it before you enter that try block.

@TheYoungBeast
Copy link
Author

TheYoungBeast commented Jun 24, 2023

As an observation: auto channel is a shared_ptr<> meaning when it goes out of scope, it is destructed. As such, if you want to use it outside of the try block, you'll need to declare it before you enter that try block.

That is correct. However, as you can see channel is declared inside the try block and would not be accessible outside of that block.

@alanxz The exception occurs at:
ucrtbased.dll in function strncmp()
obraz

strncmp() line 97:
obraz

@alanxz
Copy link
Owner

alanxz commented Jun 24, 2023 via email

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