[#6031] uclibc: readdir() is exhausting the stack because of alloca()

Document created by Aaronwu Employee on Oct 17, 2013
Version 1Show Document
  • View in full screen mode

[#6031] uclibc: readdir() is exhausting the stack because of alloca()

Submitted By: Wolfgang Muees

Open Date

2010-05-17 04:12:40     Close Date

2010-12-20 13:54:36

Priority:

Medium High     Assignee:

Mike Frysinger

Board:

N/A     Silicon Revision:

n.a.

Resolution:

Fixed     Fixed In Release:

N/A

Processor:

ALL     

Host Operating System:

n.a.

toolchain rev.:

all     kernel rev.:

n.a.

State:

Closed     Found In Release:

2009R1_RC10

Is this bug repeatable?:

yes     

Summary: uclibc: readdir() is exhausting the stack because of alloca()

Details:

 

See

 

http://blackfin.uclinux.org/gf/forummessage/86389

 

This item should be fixed, because it is a continious source of problems.

 

regards

 

Wolfgang

 

Follow-ups

 

--- Sonic Zhang                                              2010-05-20 05:43:28

Wolfgang,

I remember we have already fixed this bug in uClibc.

 

--- Wolfgang Muees                                           2010-05-20 06:12:30

No Sonic,

this is not fixed. I have checked in trunc SVN: this bug is still present.

This is the original uclibc code.

 

If you think you have fixed this bug, point me to the change/diff.

 

--- Sonic Zhang                                              2010-05-20 23:14:17

OK. let me check the svn log.

 

--- Ian Jeffray                                              2010-05-24 08:16:20

It's definitely still a problem Sonic:

http://blackfin.uclinux.org/gf/project/toolchain/forum/?_forum_action=ForumMessageBrowse&thread_id=40872&action=ForumBrowse&forum_id=44

 

A sloppy/poor workaround would be to limit the buffer size to 2KB (that's still

a lot of stack IMHO).  A better solution would be heap allocation surely.

 

--- Robin Getz                                               2010-06-10 11:00:13

Bump up the priority, so this gets fixed for the next release.

 

-Robin

 

--- Mike Frysinger                                           2010-07-26 23:48:32

ive added code to use malloc() for nommu systems and keep alloca() for mmu

systems.  seems to work with ftpd + stack checking + ls on a dir with ~10k

entries.

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

No Files Were Found

Attachments

    Outcomes