On Wed, Jan 28, 2004 at 10:53:16AM +0800, pokley <[EMAIL PROTECTED]> wrote: > im using latest cygwin 1.5.6 on windows 2000 server ia32. > doing > $ perl -e 'print "a" x 0xffffffff' will display weird result > > perl will core dump when parsing file contain > printf "%s",'a' x 0xffffffff; > > does anybody got the same problem ?
This is a bug in perl. It's taking the (size_t) length of the string (1) times the (long long) repeat count (2**32-1), adding 1, and casting it to a size_t, resulting in 0, thus bypassing realloc'ing the string buffer for the result of the x. Then it gleefully tromps all over other things in memory. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/