Sources Bugzilla – Bug 3253
glob() crashes when trying to match too many files
Last modified: 2006-09-25 15:54:00 UTC
When trying to match really huge amount of files (several hundred of thousands),
glob()'s stack overflows because it uses alloca() to allocate the entry records
temporarily. The attached patch (which is not totally trivial so you might want
to postpone that post glibc-2.5) aims to fix that.
Created attachment 1320 [details]
The proposed patch
That patch is not acceptable. We cannot sacrifize speed just for the sake of
some insane people. Yes, we shouldn't crash but this doesn't mean that
reasonable requests should be slowed down.
The correct solution would use alloca only if the limit determined by
__libc_alloca_cutoff is exceeded.
Should be fixed in cvs with a different patch.