check for overflow in HW CI (#3313)

This commit is contained in:
Matthew Kennedy 2021-10-04 05:19:58 -07:00 committed by GitHub
parent 39e2cf11ef
commit 26d9f004c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -166,6 +166,10 @@ static void cmd_threads(void) {
int freeBytes = CountFreeStackSpace(tp->wabase);
efiPrintf("%s\t%08x\t%lu\t%d", tp->name, tp->wabase, tp->time, freeBytes);
if (freeBytes < 100) {
firmwareError(OBD_PCM_Processor_Fault, "Ran out of stack on thread %s, %d bytes remain", tp->name, freeBytes);
}
tp = chRegNextThread(tp);
}

View File

@ -458,6 +458,12 @@ public class CommonFunctionalTest extends RusefiTestBase {
assertWaveNull("hard limit check", chart, EngineChart.INJECTOR_1);
}
@Test
public void testStackOverflow() {
// This ECU command has a built in check to make sure no threads are near overflow
ecu.sendCommand("threadsinfo");
}
/**
* This method waits for longer then usual.
* todo: inline this method? complex and less complex seem to have same timeout these days?