Hi everyone,

I am working on a project where i have a teensy 4.1 recording audio and then uploading to an ftp server on a Raspberry Pi. I think i have a memory leak somewhere because after 20 minutes or so the teensy just hangs on uploading the file (specially always after the PASV portion of FTP). Running tcpdump on the pi, the teensy sent a fin ack (screenshots attached) where it should of sent a SYN. Some times it runs for 20 minutes before crashing, others 5+ hours. Goal is to be able to record for ten days, in the mean time I have added a watchdog timer to hopefully kick the teensy if it fails but I am afraid of this method and want to know why the thing is crashing.

Putting in debug lines, i traced it down to this function where it appears to be hanging in int EthernetClient::available() from Native Ethernet. Increasing the stack heap (setStackHeap) seemed to help make it run longer but i havent been able to get it to run longer than 12 hours thus far.

More specifically, I am using teensy audio to interface with the Cirrus cs42448 and record 6 channels to an SD card, then I stop recording, and push the recorded raw data across the network to ftp server raspi pi (directly connected via ethernet and static IPs), sleep for X seconds and then repeat.

Any ideas or pointers to keep troubleshooting?

Click image for larger version. 

Name:	Screen Shot 2021-06-23 at 1.40.39 AM.jpg 
Views:	36 
Size:	52.4 KB 
ID:	25117Click image for larger version. 

Name:	Screen Shot 2021-06-23 at 1.41.40 AM.jpg 
Views:	32 
Size:	62.7 KB 
ID:	25118