Stack overflow in aws_connection_poll_thread during OTA update


When working with AWS and AWS FOTA updates I ran into an issue where the stack would overflow when attempting to download from the AWS bucket. It seems like this is related to the use of pre-signed paths. For example the 'signing' portion of the path that must be attached to the job document in my case is a little over 1500 characters. The library appears to be hard-coded to a stack size of 3072 (or 4096 if QEMU_X86 is defined). 

I changed the value in the library up to 4096 and confirmed that works, but I'm wondering if there's a better way to get around it. Is there a configuration in the config file I could set somewhere (It doesn't seem like it). Is my pre-signed path exceptionally long? Are pre-signed paths necessary?

In the short term I can use the edited library, but I'm wondering if there's any better options.  

  • Hello, 

    If you have configured your AWS S3 bucket to be private, the opposite of what our samples are, then you will see that files have an extra overhead in the file path. 

    Currently the only work-around is to edit the POLL_THREAD_STACK_SIZE defined in the bottom of ncs\v2.2.0\nrf\subsys\net\lib\aws_iot\src\aws_iot.c.

    You could try to move these to their own KConfig file following this documentation. There is some work from our side to improve this, but I have no timeline at the moment. 

    Is my pre-signed path exceptionally long? Are pre-signed paths necessary?

    This is a configuration by AWS, and there might be some configuration you can edit on server side. 

    Kind regards,