我有仅在Release中崩溃的这段代码:
aggregate(Location ~ Month, df2, function(j) sum(abs(diff(sapply(j, function(i) grep(i, letters))))))
Month Location
1 1 6
2 11 5
3 12 11
我设法像这样修复它:
int main()
{
MyStruct s;
s.field = bla;
xTaskCreate(TestTask, "TestTask", 2000, &s, 1, 0);
// other tasks creation
vTaskStartScheduler();
}
void TestTask(void *p)
{
// some delay
MyStruct* s = (MyStruct*)p;
another_func(s->field); // hard fault
}
我不明白为什么。我修复了它还是解决了仍然存在的内存损坏?
谢谢。