Other Parts Discussed in Thread: TM4C1294NCPDT, EK-TM4C1294XL
Tool/software: TI C/C++ Compiler
I am using c++ compiler TI v18.1.5.LTS with TM4C1294NCPDT compiling with c++14 mode. Stack size set to 16384, heap set to 120000.
It appears any 2nd attempt to add a structure of size > 64 bytes will cause a FaultISR
Relevant code example:
#include <deque> struct s { char d[65]; }; int main() { int size = sizeof(s); std::deque<s> test; test.push_back(s()); test.push_back(s()); // will crash here while (1){} }
Structures of 64 bytes or less appears to work properly.
Digging in to it a bit more... looks like the problem stems in the push_back function.
Inside the push_back function is:
if (__back_spare() == 0) __add_back_capacity(); // __back_spare() >= 1 __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), __v);
On the 2nd push_back attempt, the if condition is not satisifed so it does not call __add_back_capacity()
Then, addressof() function returns an invalid memory address... which ends up calling placement new at an invalid memory address causing the crash.
If this is not the correct forum for this issue, please direct me to the proper place.
Thank you.