X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Wed, 17 Feb 2010 18:04:29 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: a bug in a week old mmap Message-ID: <20100217170429.GL5683@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <354754 DOT 66525 DOT qm AT web88302 DOT mail DOT re4 DOT yahoo DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <354754.66525.qm@web88302.mail.re4.yahoo.com> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Feb 17 07:51, Ilguiz Latypov wrote: > > $ gdb --args perl -i -pe 's/\r//g' f.txt > GNU gdb 6.8.0.20080328-cvs (cygwin-special) > Copyright (C) 2008 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. Type "show copying" > and "show warranty" for details. > This GDB was configured as "i686-pc-cygwin"... > (gdb) file /usr/bin/perl > Load new symbol table from "/usr/bin/perl"? (y or n) y > Reading symbols from /usr/bin/perl...done. > (gdb) run > Starting program: /usr/bin/perl -i -pe s/\\r//g f.txt > [New thread 4136.0x1514] > [New thread 4136.0x1214] > > Program received signal SIGSEGV, Segmentation fault. > mmap_is_attached_or_noreserve (addr=0x4, len=1) at /c/work/cygwin/src/winsup/cygwin/mmap.cc:691 > 691 LIST_LOCK (); > Current language: auto; currently c++ > (gdb) bt > #0 mmap_is_attached_or_noreserve (addr=0x4, len=1) at /c/work/cygwin/src/winsup/cygwin/mmap.cc:691 > #1 0x610296dc in _cygtls::handle_exceptions (e=0x33208, frame=0x82ce68, in=0x33224) at /c/work/cygwin/src/winsup/cygwin/exceptions.cc:559 > #2 0x7c9032a8 in ntdll!RtlCopyOutOfProcessMemoryStreamTo () from /c/WINDOWS/system32/ntdll.dll > #3 0x00033208 in ?? () > #4 0x0082ce68 in ?? () > #5 0x00033224 in ?? () > #6 0x000331dc in ?? () > #7 0x0082ce68 in ?? () > #8 0x7c9032bc in ntdll!RtlCopyOutOfProcessMemoryStreamTo () from /c/WINDOWS/system32/ntdll.dll > #9 0x0082ce68 in ?? () > #10 0x000331f0 in ?? () > #11 0x7c90327a in ntdll!RtlCopyOutOfProcessMemoryStreamTo () from /c/WINDOWS/system32/ntdll.dll > #12 0x00033208 in ?? () > #13 0x0082ce68 in ?? () > #14 0x00033224 in ?? () > #15 0x000331dc in ?? () > #16 0x61028d70 in sigignore () at /c/work/cygwin/src/winsup/cygwin/exceptions.cc:1114 > Backtrace stopped: previous frame inner to this frame (corrupt stack?) > (gdb) I tested this on a 500K file input file with DOS line endings and it works fine for me. In the above case, mmap_is_attached_or_noreserve() gets already called as result of a previous SEGV, but it's not possible to see the cause in the above backtrace. The fact that it eventually crashes in mmap_is_attached_or_noreserve, line 691 points to overwritten memory due to some unknown reason. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- 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