Streamline your workflows and master BIM coordination! Program starts April 28!

Archicad C++ API
About Archicad add-on development using the C++ API.

Archicad 28 crashes when change material/composite properties

kolioi
Booster

Hello everybody,

My plugin crashes at random places on AC28 but the same code works fine on AC27 and AC26.

Here is briefly what I am doing: I have a function that creates composite structures in a loop (Walls/Slabs/Roofs). Some of the materials already exist (created by the previous composite) and their properties are overwritten. The same apply and for all composites - their properties are overwritten if a composite has already been created. The first time I call the function all composites are created successfully. If I call the function again, some composites and materials are overwritten and then AC crashes.

Again, this happens on AC28 only.

 

Here is a screenshot of a typical crash

 

kolioi_0-1743604465110.jpeg

and the corresponding call stack

 

 	tbbmalloc.dll!00007ffdf5fa806e()	Unknown
 	tbbmalloc.dll!00007ffdf5fa87ab()	Unknown
 	GSRoot.dll!00007ffddb686e63()	Unknown
>	MyPlugin.apx!operator new(unsigned __int64 nBytes) Line 86	C++
 	MyPlugin.apx!std::_Default_allocate_traits::_Allocate(const unsigned __int64 _Bytes) Line 137	C++
 	MyPlugin.apx!std::_Allocate<16,std::_Default_allocate_traits>(const unsigned __int64 _Bytes) Line 258	C++
 	MyPlugin.apx!std::allocator<std::_Container_proxy>::allocate(const unsigned __int64 _Count) Line 987	C++
......
Exception thrown at 0x00007FFDC9CD2E0C (ObjectDatabase.dll) in Archicad.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.

This looks like dereferencing a null pointer or trying to release memory that has already been released.

 

Also, I noticed AC28 use a whole lot of RAM compared to AC26 (and AC27)

 

kolioi_1-1743605256067.jpeg

 

kolioi_2-1743605306516.jpeg

 

Any ideas what might be wrong and how to fix it?

I am compiling w/ Visual Studio 2022 platform toolset v143 C++ 17 on Windows 10
The same crash happens on Mac as well

1 REPLY 1
kolioi
Booster

Fixed

 

Based on the info in this article

New memory allocator in Archicad 28