I make use of the boost libs. Under certain conditions, I get a “Invalid memory API call” trace. Unfortunately, the backtraces are not much help and I’ve been unable to step to the exact spot where it occurs using the debugger.
I’m pretty sure I’m causing it with a pointer I’m passing to boost, but the pointer looks valid when I pass it.
I cannot find any documentation on the error message I receive. Is it produced by the OS? What exactly does mean?
Any help would be greatly appreciated.
Backtrace:
Invalid memory API call
Unknown function (67250)
Unknown function (34387)
Unknown function (3443d)
Unknown function (2fee7)
Unknown function (208d5)
adlint_trcError+1a
adlint_errHalt+44
_sbrk+8
_sbrk_r+10
_malloc_r+28a
_realloc_r+238
realloc+10
d_growable_string_callback_adapter+64
d_demangle_callback+10e
Boost is mostly just header files, and they work pretty well using the gcc EABI toolchain. I added the following compiler flags (Project settings->C/C++ Build->Settings->Miscellaneous):
The only compiled boost lib I use is the serialization, but I built it using the ARM EABI gcc compiler that ships with Developer Studio. I just made sure to mimic the correct compiler flags as per DS. I built the libs as a static lib and then link it into my project like any other one. Boost was pretty easy, as it has a well documented cross-compile method, using the boost.build tool.
I think you should be able to use any third party lib that can be built with gcc/g++.
When porting code to Open AT Framework, you need to replace functions like realloc, alloc, free, strdup, exit, printf.
Open AT OS functions like adl_mem and adl_trc* can be used for that purpose.
Also, functions involving stdio (open, read, write, close, tell, seek) can be replaced using adl_fs* (File System).