Skip to content

Ongoing Schedule work: crashes in use case: nested schedule_recurrent_function_us() #6235

Closed
@dok-net

Description

@dok-net

@d-a-v As discussed - I hope I understood you right and this is indeed supposed to work, otherwise forget about it - here's runnable code. Works out-of-the-box in #6139, crashes in master HEAD. Playing with different values for repeat_us, either crashes later, or goes it WDT reset.

Sketch:

#include <Schedule.h>
void setup()
{
	Serial.begin(115200);
	delay(500);
	Serial.println("Scheduler test");
	schedule_recurrent_function_us([]()
		{
			Serial.println("First function");
			schedule_recurrent_function_us([]()
				{
					Serial.println("Nested in first function");
					return false;
				}, 1);
			return false;
		}, 1);
}

void loop()
{
}

Stack decode:

   :Error:3 -> LoadStoreError: Attempt to read/write memory in a manner not supported by the hardware (for example, trying to read/write a byte to a memory area that only supports word accesses)
   0x401004b1 umm_assimilate_up
   : ?? ??:0
   0x401005a0 _umm_free
   0x401009ec free
   0x4020a64d operator delete(void*)
   0x402010a0 std
   0x40203068 std
   0x402017a6 delay
   0x402020d1 run_scheduled_recurrent_functions()
   0x40201156 setup
   0x40201038 std
   0x402012aa loop_wrapper()
   0x40100a49 cont_wrapper
   : ?? ??:0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions