[uClinux-dev] Stack overflow in the readdir

Davide Zanni d.zanni at signal-elettronica.it
Mon Feb 9 11:54:35 EST 2009

I tried the patch and work fine on my board.


Il 04/02/2009 14.34, Greg Ungerer ha scritto:
> Hi Davide,
> Davide Zanni wrote:
>> I have an application that display the content of an USB key with the
>> function readdir. This work fine but with an USB key the application
>> crash because in the file uClibc/libc/sysdeps/linux/common/getdents.c
>> the compiler try to allocate about 31K of data with the function
>> "alloca (red_nbytes)" and the default stack size is 12K in the thread
>> that use the function. To solve the problem I have increased the stack
>> size of that thread.
>> For the other program that use uClibc and the function readdir, like
>> busybox, it's possible that the program will crash. It's possible
>> change the allocation of the memory with the malloc to solve the
>> problem for all the application?
> Try the patch attached to:
> http://mailman.uclinux.org/pipermail/uclinux-dev/2008-June/046758.html
> Please report if it works for you. I have it sitting in my
> queue of patches to apply to the uClinux-dist. I was hoping
> to get some wider confirmation of it working as expected...
> Regards
> Greg
> ------------------------------------------------------------------------
> Greg Ungerer -- Principal Engineer EMAIL: gerg at snapgear.com
> SnapGear, a McAfee Company PHONE: +61 7 3435 2888
> 825 Stanley St, FAX: +61 7 3891 3630
> Woolloongabba, QLD, 4102, Australia WEB: http://www.SnapGear.com
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev at uclinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev at uclinux.org
> To unsubscribe see:
> http://mailman.uclinux.org/mailman/options/uclinux-dev

More information about the uClinux-dev mailing list