
Typically, one can then increase the stack to a larger than needed allocation size and then run the app for a while and see how much stack it actually needed. Mirroring to ESP-IDF, one can ask a FreeRTOS task for its high-water marks for stack usage. As such, I'm afraid I don't know how tasks are created in an Arduino framework. I personally have low skills in Arduino ESP32 programming and do most of my work in ESP-IDF exclusively. Kolban wrote:If the problem is reproducible, I'd first examine the amount of stack space on the task that is running the Arduino WiFi classes. The stack protector "canary" is a random 32-bit value (unique each time the ESP32 resets) so it's hard to tell what it was without a longer stack dump. (Look at the putEntry() function in panic.c to see how this is done to print the backtrace.) Also, they point to the address *after* the calling address (ie the address to return to), so you need to subtract 3. Replace any leading 0x8 with 0x4 to see them. The return addresses are there, but they've had the high bits manipulated by the Xtensa calling convention. I would have thought that I would see the address of the instruction it's returning to, then some values, then the canary bytes but I'm stuck interpreting this. I'm stuck - now I don't know what to do with that. In any case, the stack for that function starts at 0x3ffc29a0 and moves downward. If my understanding is correct, with "strong" stack smashing it places canaries at the end of each function's stack space and upon return checks to make sure the canary value is not overwritten, and the trace is showing that WiFiGenericClass::getMode() is somehow overwriting the bounds of its stack (which I find hard to believe). This GDB was configured as "-host=x86_64-build_apple-darwin16.3.0 -target=xtensa-esp32-elf". There is NO WARRANTY, to the extent permitted by law.
#Stack guard stack smashing detected free
This is free software: you are free to change and redistribute it. License GPLv3+: GNU GPL version 3 or later I (2760) wifi: Init dynamic rx buffer num: 0 I (2756) wifi: Init static rx buffer num: 5 I (2745) wifi: Init management frame dynamic rx buffer num: 64 I (2742) wifi: Init data frame dynamic rx buffer num: 64 Code: Select all I (2742) wifi: Init dynamic tx buffer num: 32
