Channel::OpenOpts::FromUri results in Access violation reading location 0x0000000000000000.
TheYoungBeast opened this issue · 3 comments
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)
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.
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()