This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

find(1) memory leak in cygheap


I found this problem when running updatedb, the find will print

      2 [main] find 2592 C:\cygwin\bin\find.exe: *** fatal error -
cmalloc would have returned NULL

I have dumped the cygheap using gdb to see what's in it, the size is
about 25M, and I use strings.exe to examine the strings
in it, all the folder names that find has looked into is in it, both
native format and cygwin format of the folders names.

And there are lot's of folders in my android source folder, so the
cygheap is filled up. I think maybe this is a memory leak?

Please use the following script to test:

#!/bin/bash
set -e
set -o pipefail

mkdir /xxx -p
cd /xxx

#make sure the folder is long enough so that the memory fill easily.
LONG_FOLDER=`/bin/python -c 'print ("./" + "x"*200)*35'`
mkdir -p ${LONG_FOLDER}
cd ${LONG_FOLDER}

for ((x=0; x<1000; x++)); do echo $x; done|xargs mkdir -p

cd /xxx
find .|wc -l

echo OK
cd /
rm xxx -rf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]