Home/Support/Support Forum/Using FSProperties to fix FEAT stack overflow in ftp server
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Using FSProperties to fix FEAT stack overflow in ftp server

0 votes
With NETOS 6.3 on ME I am getting what I believe is a stack overflow
when I use an ftp client the sends the FEAT command (BSD ftp client)
I noticed this because the the array of FlashSectors returned from NAFlashSectors in ftp_init_flash_download() would get corrupted only for clients that use the FEAT command.

If I malloc some space right after the call to NAFlashSectors then the corruption shows up in the malloced buffer space. Its usually around 120 bytes of corruption. I surmized that its the ftp server stack size that is too small. So I want to increase the stack sise.

The docs say use FSProperties() for this.
The docs for FSProperties are incomplete.
I would like to use the defaults for the "name" and "priority" parameters but I can't find out what those are.

Also the docs for the ftp server state that the default stack size is 4096 so I know what do there and I can use NAFTPS_NO_COMMAND to get it it ignore the argument parameter and use 0 for the arg1 parameter.

The other question is when do I call FSProperties? Is is just before or just after FSInitialize(). I would have guessed just before but the FTPServer docs say this without any elaboration.
"All calls must be made after FSInitialize." but calls to what?
So maybe this means FSProperties comes after FSInitialize?
asked Mar 3, 2011 in NET+OS by smithsm New to the Community (8 points)
recategorized Dec 5, 2013 by tuxembb

Please log in or register to answer this question.

3 Answers

0 votes
Is there no one out there that knows how to use FSProperties?
answered Mar 23, 2011 by smithsm New to the Community (8 points)
0 votes
I can only give a partial answer in respect of NetOS 7.5, but doubt much has changed.
Default name is "ftpd"
Default priority is BSP_MEDIUM_PRIORITY (16, according to my comments)
Default stack is now 8192 (suggesting your theory could be correct)
I am calling FSProperties() after FSInitialize()
answered Mar 24, 2011 by steved2 Seasoned Professional (151 points)
0 votes
Thank you so much. Saves me a lot of trial and error. I will update with results.
answered Mar 24, 2011 by smithsm New to the Community (8 points)
...