reo7sp / tgbot-cpp

C++ library for Telegram bot API
http://reo7sp.github.io/tgbot-cpp
MIT License
995 stars 238 forks source link

MSVC Read access violation #273

Open Vitaliy320 opened 1 year ago

Vitaliy320 commented 1 year ago

I was trying to run examples at tgbot-cpp/samples/echobot/src/main.cpp and tgbot-cpp/samples/echobot-curl-client/src/main.cpp. In both cases i got an exception "read access violation. this was 0xFFFFFFFFFFFFFFBF." in a file "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\xhash". The exception is triggered by bot.getEvents().onCommand. Has anyone encountered this issue? Thank you. screen1

carlosfvp commented 7 months ago

This happened to me on debug mode x64.

I installed the package using vcpkg and using the debug .lib file also.

This was solved when I changed to release mode, but I am losing all debug capabilities.

Looks like x64 Debug mode has the initializacion of all classes broken or it's more of an issue with the way it's compiled.

image

Using C++17 standard on the compiler.

I'll rollback to C++14 and post results.

carlosfvp commented 7 months ago

Same results with C++14

Any class constructor of the TgBot library returns a pointer to a invalid region.