Replies: 3 comments 11 replies
-
You should surround all your code in triple backticks to make it readable. The problem is most likely memory corruption in |
Beta Was this translation helpful? Give feedback.
-
Thanks for your replay I will try your advices and will replay result But std::scoped_lock doesnt iplemented in ESP32 look like it doesnt have it in std name space.
Did I understand that trick right ? With reserve()
Point of that was to avoid copying data in tiny mem space of ESP i want return pool_of_messages_history reference not copy when i have to return whole vector. And temp_history.push_back(std::make_pair(it->first, std::make_shared<msg_history>(it->second))); was nail to make temp reference value for make right return value maybe i didnt do it right ... First attemt was to make big historry array for example 1000-1500 records of console messages ... but it was to many issues and random crashes so i have to make it smaller up to 75 records and at that size ESP works some time 24h some times crashes in few hours ... |
Beta Was this translation helpful? Give feedback.
-
After some code updates i got that backtrace .... I cant figurate whats going there before that crash i've several exception catached std::bad_alloc than crash
|
Beta Was this translation helpful? Give feedback.
-
I've issue with using library at ESP32 hardware ... code can works for hours then randomly crash with that backtrace related to json library.
httpServer::getHistory() at src/web2.cpp:714 is
to_json coversion
std::vector<std::pair<int, msg_history>> pool_of_messages_history; // MESSAGES HISTORY
about sizes this->pool_of_messages_history can contains up to 75 records (vector)
that issue blows my brain for one week without any movment (((
I think there is some memory issue but i dont understand how to fix it ...
Thanks for any help.
Beta Was this translation helpful? Give feedback.
All reactions