BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
Archicad C++ API
About Archicad add-on development using the C++ API.

Exception when using libcpr library

BrunoValads
Contributor

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.

3 REPLIES 3
rajani
Participant

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.

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

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

Learn and get certified!

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!