2023-02-28 10:03 PM - edited 2023-03-01 12:54 PM
Hi!
I'm getting an Archicad breakpoint exception that closes the program when using libcpr library.
In my plugin example, I have the following simple HTTP GET request:
cpr::Response r = cpr::Get(cpr::Url{ "http://www.httpbin.org/get" });
This code works in a plain C++ project in Visual Studio.
I get an exception that breaks at GSNew.hpp in the operator delete:
inline void CCALL operator delete (void* p, size_t) throw ()
{
GS::MemoryManager::Free (p);
}
This break occurs inside libcpr at session.h in line 51, in destructor:
~Session() = default;
Is there anything I can do to fix this? Apprently the same happens here.
2023-12-12 12:55 AM - last edited on 2023-12-17 10:52 PM by Laszlo Nagy
Hi,
Could you find any solution to this problem? I am facing an almost similar problem when using the libcpr library with Archicad. (The error is different, but Archicad crashes). Iam using libcpr 1.10.5
cpr::Response r = cpr::Get(cpr::Url{ "http://www.httpbin.org/get" });
As you have also mentioned, this(and the POST request) works perfectly on a stand-alone C++ project for me as well.
However, when I use it with Archicad 27, it crashes and gives me an access violation error, like so, and then a stack-based cookie overrun.
I am suspecting this could be a clash with libcurl dlls (since my application already uses libcurl and libcpr is a wrapper around libcurl). Not sure, though.
Error details:
============================================================
Exception thrown at 0x00007FF99C111BB5 (Addon.apx) in Archicad.exe: 0xC0000005: Access violation reading location 0x0000108A3D944CF0.
The thread 0x734 has exited with code 0 (0x0).
Unhandled exception at 0x00007FF99C14B1D1 (Addon.apx) in Archicad.exe: Stack cookie instrumentation code detected a stack-based buffer overrun.
The program '[48704] Archicad.exe' has exited with code 0 (0x0).
============================================================
Any help will be greatly appreciated.
2023-12-13 10:13 AM
Hi,
Have you specified DEBUVERS somewhere in your project settings or code? That might have a side effect.
Also, try to put the include for cpr before any of the GSRoot includes.
Best, Akos
2023-12-20 01:18 AM
Hi Akos,
Thanks for the response. I tried both the fixes you suggested, but unfortunately that did not fix the issue.
I get the same errors I reported above.
Do you have any alternate/additional solutions that I could try to address this issue?
Thanks again.
Regards,
Rajani