stack overflow bug in ofstream::operator<<

Scott McPeak smcpeak@cs.berkeley.edu
Tue Jun 28 12:50:00 GMT 2005


I believe there is a bug in the cygwin DLL that causes a stack overflow
segmentation fault when ofstream::operator<< is used to write a string
that is longer than 2MB.

Attached is a simple program, writen.cc, that will create an ofstream and
write a string of user-specified length to it.  When that length exceeds
about 2MB, it fails:

  $ g++ -o writen -Wall -Wno-deprecated writen.cc
  $ ./writen 2000000
  $ ./writen 3000000
  Segmentation fault (core dumped)

The stack dump and gdb backtrace are attached.  It appears to be the case
that the string is being copied onto the stack via alloca, so when the
string size exceeds the default 2MB stack limit, the program crashes.

I have confirmed that compiling with (e.g.) -Wl,--stack,4000000 causes the
failure limit to increase accordingly.  (ulimit -s 4000 does not work
because cygwin's ulimit implementation is only partially functional.)

To fix this, I think that cygwin should not make a copy of the string; or,
if it must (CR/LF translation?), do the work in smaller chunks.

-Scott
-------------- next part --------------

Cygwin Configuration Diagnostics
Current System Time: Tue Jun 28 02:08:45 2005

Windows 2000 Professional Ver 5.0 Build 2195 Service Pack 2

Path:	J:\cygwin\home\scott\bin
	J:\cygwin\home\scott\scripts
	J:\cygwin\usr\local\bin
	J:\cygwin\bin
	J:\cygwin\bin
	J:\cygwin\usr\X11R6\bin
	j:\texmf\miktex\bin
	d:\WINNT\system32
	d:\WINNT
	d:\WINNT\System32\Wbem
	j:\gs\gs7.04\bin
	J:\cygwin\sbin
	J:\cygwin\usr\sbin
	J:\cygwin\usr\local\sbin
	J:\cygwin\usr\local\jdk\bin

Output from J:\cygwin\bin\id.exe (nontsec)
UID: 1000(Scott)    GID: 513(None)
0(root)             513(None)           544(Administrators) 545(Users)

Output from J:\cygwin\bin\id.exe (ntsec)
UID: 1000(Scott)    GID: 513(None)
0(root)             513(None)           544(Administrators) 545(Users)

SysDir: D:\WINNT\System32
WinDir: D:\WINNT

USER = `Scott'
LD_LIBRARY_PATH = `/home/scott/lib'
PWD = `/home/scott/bld'
HOME = `/home/scott'
MAKE_MODE = `unix'

HOMEPATH = `\'
MANPATH = `/usr/local/man:/usr/man:/usr/share/man:/usr/autotool/devel/man::/usr/ssl/man'
APPDATA = `D:\Documents and Settings\Scott McPeak\Application Data'
!J: = `J:\cygwin\bin'
HOSTNAME = `vmseamonkey'
TERM = `cygwin'
PROCESSOR_IDENTIFIER = `x86 Family 6 Model 4 Stepping 2, AuthenticAMD'
WINDIR = `D:\WINNT'
CVSROOT = `/home/scott/cvsroot'
OLDPWD = `/home/scott'
USERDOMAIN = `VMSEAMONKEY'
OS = `Windows_NT'
ALLUSERSPROFILE = `D:\Documents and Settings\All Users'
XAPPLRESDIR = `/home/scott/.xapplresdir'
OS2LIBPATH = `D:\WINNT\system32\os2\dll;'
TEMP = `/cygdrive/d/DOCUME~1/SCOTTM~1/LOCALS~1/Temp'
COMMONPROGRAMFILES = `D:\Program Files\Common Files'
CXXFLAGS = `-g -Wall'
USERNAME = `Scott'
PAGER = `more'
PROCESSOR_LEVEL = `6'
SYSTEMDRIVE = `D:'
EDITOR = `pico'
USERPROFILE = `D:\Documents and Settings\Scott McPeak'
PS1 = `\n\w\$ '
LOGONSERVER = `\\VMSEAMONKEY'
PROCESSOR_ARCHITECTURE = `x86'
CXX = `g++'
SHLVL = `1'
PATHEXT = `.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
HOMEDRIVE = `D:'
!D: = `D:\Documents and Settings\Scott McPeak\Desktop'
PROMPT = `$P$G'
COMSPEC = `D:\WINNT\system32\cmd.exe'
TMP = `/cygdrive/d/DOCUME~1/SCOTTM~1/LOCALS~1/Temp'
SYSTEMROOT = `D:\WINNT'
CVS_RSH = `ssh'
PROCESSOR_REVISION = `0402'
INFOPATH = `/usr/local/info:/usr/info:/usr/share/info:/usr/autotool/devel/info:/usr/autotool/stable/info:'
PROGRAMFILES = `D:\Program Files'
NUMBER_OF_PROCESSORS = `1'
OCAMLRUNPARAM = `l=256M'
COMPUTERNAME = `VMSEAMONKEY'
_ = `/usr/bin/cygcheck'
POSIXLY_CORRECT = `1'

HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
  (default) = `/cygdrive'
  cygdrive flags = 0x00000020
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/
  (default) = `J:\cygwin'
  flags = 0x00000008
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin
  (default) = `J:\cygwin/bin'
  flags = 0x00000008
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib
  (default) = `J:\cygwin/lib'
  flags = 0x00000008
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options

a:  fd             N/A    N/A                    
c:  hd  FAT        454Mb  85% CP    UN           WIN98
d:  hd  NTFS      5004Mb  46% CP CS UN PA FC     vmwin2k
e:  hd  FAT32     7985Mb  89% CP    UN           GAMES98
g:  hd  NTFS      1906Mb  96% CP CS UN PA FC     native2k
h:  cd             N/A    N/A                    
j:  hd  NTFS     17186Mb  94% CP CS UN PA FC     shared
k:  hd  NTFS      9538Mb  98% CP CS UN PA FC     shared2
z:  net HGFS      3906Mb  10% CP                 Shared Folders

J:\cygwin      /          system  textmode
J:\cygwin/bin  /usr/bin   system  textmode
J:\cygwin/lib  /usr/lib   system  textmode
.              /cygdrive  system  textmode,cygdrive

Found: J:\cygwin\bin\awk.exe
Found: J:\cygwin\bin\bash.exe
Found: J:\cygwin\bin\cat.exe
Found: J:\cygwin\bin\cp.exe
Found: J:\cygwin\bin\cpp.exe
Found: J:\cygwin\bin\find.exe
Found: J:\cygwin\bin\gcc.exe
Found: J:\cygwin\bin\gdb.exe
Found: J:\cygwin\bin\grep.exe
Found: J:\cygwin\bin\ld.exe
Found: J:\cygwin\bin\ls.exe
Found: J:\cygwin\bin\make.exe
Found: J:\cygwin\bin\mv.exe
Found: J:\cygwin\bin\rm.exe
Found: J:\cygwin\bin\sed.exe
Found: J:\cygwin\bin\sh.exe
Found: J:\cygwin\bin\tar.exe

   55k 2004/09/14 J:\cygwin\bin\cygbz2-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygbz2-1.dll" v0.0 ts=2004/9/13 20:16
   18k 2004/07/06 J:\cygwin\bin\cygcharset-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygcharset-1.dll" v0.0 ts=2004/7/6 10:09
    7k 2003/10/19 J:\cygwin\bin\cygcrypt-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygcrypt-0.dll" v0.0 ts=2003/10/18 23:57
  858k 2005/04/11 J:\cygwin\bin\cygcrypto-0.9.7.dll - os=4.0 img=1.0 sys=4.0
                  "cygcrypto-0.9.7.dll" v0.0 ts=2005/4/11 10:21
  831k 2003/09/20 J:\cygwin\bin\cygdb-4.1.dll - os=4.0 img=1.0 sys=4.0
                  "cygdb-4.1.dll" v0.0 ts=2003/9/20 13:51
  895k 2004/04/28 J:\cygwin\bin\cygdb-4.2.dll - os=4.0 img=1.0 sys=4.0
                  "cygdb-4.2.dll" v0.0 ts=2004/4/27 7:31
 1080k 2003/09/20 J:\cygwin\bin\cygdb_cxx-4.1.dll - os=4.0 img=1.0 sys=4.0
                  "cygdb_cxx-4.1.dll" v0.0 ts=2003/9/20 13:53
 1156k 2004/04/28 J:\cygwin\bin\cygdb_cxx-4.2.dll - os=4.0 img=1.0 sys=4.0
                  "cygdb_cxx-4.2.dll" v0.0 ts=2004/4/27 7:35
  174k 2004/10/14 J:\cygwin\bin\cygexpat-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygexpat-0.dll" v0.0 ts=2004/10/14 0:34
   40k 2004/10/10 J:\cygwin\bin\cygform-8.dll - os=4.0 img=1.0 sys=4.0
                  "cygform-8.dll" v0.0 ts=2004/10/10 0:33
   45k 2001/04/25 J:\cygwin\bin\cygform5.dll - os=4.0 img=1.0 sys=4.0
                  "cygform5.dll" v0.0 ts=2001/4/24 21:28
   35k 2002/01/09 J:\cygwin\bin\cygform6.dll - os=4.0 img=1.0 sys=4.0
                  "cygform6.dll" v0.0 ts=2002/1/8 22:03
   48k 2003/08/09 J:\cygwin\bin\cygform7.dll - os=4.0 img=1.0 sys=4.0
                  "cygform7.dll" v0.0 ts=2003/8/9 1:25
   28k 2003/07/20 J:\cygwin\bin\cyggdbm-3.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm-3.dll" v0.0 ts=2003/7/19 23:58
   30k 2003/08/11 J:\cygwin\bin\cyggdbm-4.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm-4.dll" v0.0 ts=2003/8/10 18:12
   19k 2003/03/22 J:\cygwin\bin\cyggdbm.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm.dll" v0.0 ts=2002/2/19 19:05
   15k 2003/07/20 J:\cygwin\bin\cyggdbm_compat-3.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm_compat-3.dll" v0.0 ts=2003/7/20 0:00
   15k 2003/08/11 J:\cygwin\bin\cyggdbm_compat-4.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm_compat-4.dll" v0.0 ts=2003/8/10 18:13
  107k 2004/07/06 J:\cygwin\bin\cyggettextlib-0-14-1.dll - os=4.0 img=1.0 sys=4.0
                  "cyggettextlib-0-14-1.dll" v0.0 ts=2004/7/6 9:56
   17k 2004/07/06 J:\cygwin\bin\cyggettextpo-0.dll - os=4.0 img=1.0 sys=4.0
                  "cyggettextpo-0.dll" v0.0 ts=2004/7/6 9:56
  190k 2004/07/06 J:\cygwin\bin\cyggettextsrc-0-14-1.dll - os=4.0 img=1.0 sys=4.0
                  "cyggettextsrc-0-14-1.dll" v0.0 ts=2004/7/6 9:56
   17k 2001/06/28 J:\cygwin\bin\cyghistory4.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory4.dll" v0.0 ts=2001/1/6 20:34
   29k 2003/08/10 J:\cygwin\bin\cyghistory5.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory5.dll" v0.0 ts=2003/8/10 15:16
   24k 2005/06/26 J:\cygwin\bin\cyghistory6.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory6.dll" v0.0 ts=2005/6/25 20:41
  991k 2004/07/06 J:\cygwin\bin\cygiconv-2.dll - os=4.0 img=1.0 sys=4.0
                  "cygiconv-2.dll" v0.0 ts=2004/7/6 10:10
   22k 2001/12/13 J:\cygwin\bin\cygintl-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl-1.dll" v0.0 ts=2001/12/13 1:28
   37k 2003/08/10 J:\cygwin\bin\cygintl-2.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl-2.dll" v0.0 ts=2003/8/10 13:50
   54k 2004/07/06 J:\cygwin\bin\cygintl-3.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl-3.dll" v0.0 ts=2004/7/6 9:51
   21k 2001/06/20 J:\cygwin\bin\cygintl.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl.dll" v0.0 ts=2001/6/20 9:09
   22k 2004/10/10 J:\cygwin\bin\cygmenu-8.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu-8.dll" v0.0 ts=2004/10/10 0:33
   26k 2001/04/25 J:\cygwin\bin\cygmenu5.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu5.dll" v0.0 ts=2001/4/24 21:27
   20k 2002/01/09 J:\cygwin\bin\cygmenu6.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu6.dll" v0.0 ts=2002/1/8 22:03
   29k 2003/08/09 J:\cygwin\bin\cygmenu7.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu7.dll" v0.0 ts=2003/8/9 1:25
   21k 2004/10/22 J:\cygwin\bin\cygminires.dll - os=4.0 img=1.0 sys=4.0
                  "cygminires.dll" v0.0 ts=2004/10/22 12:28
   74k 2004/10/10 J:\cygwin\bin\cygncurses++-8.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++-8.dll" v0.0 ts=2004/10/10 0:33
  156k 2001/04/25 J:\cygwin\bin\cygncurses++5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++5.dll" v0.0 ts=2001/4/24 21:29
  175k 2002/01/09 J:\cygwin\bin\cygncurses++6.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++6.dll" v0.0 ts=2002/1/8 22:03
  216k 2004/10/10 J:\cygwin\bin\cygncurses-8.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses-8.dll" v0.0 ts=2004/10/10 0:25
  226k 2001/04/25 J:\cygwin\bin\cygncurses5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses5.dll" v0.0 ts=2001/4/24 21:17
  202k 2002/01/09 J:\cygwin\bin\cygncurses6.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses6.dll" v0.0 ts=2002/1/8 22:03
  224k 2003/08/09 J:\cygwin\bin\cygncurses7.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses7.dll" v0.0 ts=2003/8/9 1:24
   13k 2004/10/10 J:\cygwin\bin\cygpanel-8.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel-8.dll" v0.0 ts=2004/10/10 0:32
   15k 2001/04/25 J:\cygwin\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel5.dll" v0.0 ts=2001/4/24 21:27
   12k 2002/01/09 J:\cygwin\bin\cygpanel6.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel6.dll" v0.0 ts=2002/1/8 22:03
   19k 2003/08/09 J:\cygwin\bin\cygpanel7.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel7.dll" v0.0 ts=2003/8/9 1:24
   62k 2003/12/11 J:\cygwin\bin\cygpcre-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygpcre-0.dll" v0.0 ts=2003/12/11 9:01
   63k 2003/04/11 J:\cygwin\bin\cygpcre.dll - os=4.0 img=1.0 sys=4.0
                  "cygpcre.dll" v0.0 ts=2003/4/11 0:31
    9k 2003/12/11 J:\cygwin\bin\cygpcreposix-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygpcreposix-0.dll" v0.0 ts=2003/12/11 9:01
   61k 2003/04/11 J:\cygwin\bin\cygpcreposix.dll - os=4.0 img=1.0 sys=4.0
                  "cygpcreposix.dll" v0.0 ts=2003/4/11 0:31
 1252k 2005/01/27 J:\cygwin\bin\cygperl5_8.dll - os=4.0 img=1.0 sys=4.0
                  "cygperl5_8.dll" v0.0 ts=2005/1/27 2:17
   22k 2002/06/09 J:\cygwin\bin\cygpopt-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygpopt-0.dll" v0.0 ts=2002/6/8 21:45
  108k 2001/06/28 J:\cygwin\bin\cygreadline4.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline4.dll" v0.0 ts=2001/1/6 20:34
  148k 2003/08/10 J:\cygwin\bin\cygreadline5.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline5.dll" v0.0 ts=2003/8/10 15:16
  144k 2005/06/26 J:\cygwin\bin\cygreadline6.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline6.dll" v0.0 ts=2005/6/25 20:41
  171k 2005/04/11 J:\cygwin\bin\cygssl-0.9.7.dll - os=4.0 img=1.0 sys=4.0
                  "cygssl-0.9.7.dll" v0.0 ts=2005/4/11 10:21
   62k 2004/10/10 J:\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0
                  "cygz.dll" v0.0 ts=2004/10/9 20:09
 1227k 2005/05/25 J:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=2005/5/25 15:38
    Cygwin DLL version info:
        DLL version: 1.5.17
        DLL epoch: 19
        DLL bad signal mask: 19005
        DLL old termios: 5
        DLL malloc env: 28
        API major: 0
        API minor: 129
        Shared data: 4
        DLL identifier: cygwin1
        Mount registry: 2
        Cygnus registry name: Cygnus Solutions
        Cygwin registry name: Cygwin
        Program options name: Program Options
        Cygwin mount registry name: mounts v2
        Cygdrive flags: cygdrive flags
        Cygdrive prefix: cygdrive prefix
        Cygdrive default prefix: 
        Build date: Wed May 25 19:38:55 EDT 2005
        Shared id: cygwin1S4


No Cygwin services found.


Cygwin Package Information
Last downloaded files to: J:\dist\cygwin
Last downloaded files from: http://mirrors.kernel.org/sources.redhat.com/cygwin

Package              Version
_update-info-dir     00269-1
alternatives         1.3.20a-1
ash                  20040127-1
autoconf             2.59-2
autoconf-devel       2.59-2
autoconf-stable      2.13-6
autoconf2.1          2.13-1
autoconf2.5          2.59-1
base-files           3.4-2
base-passwd          2.2-1
bash                 2.05b-17
binutils             20050608-2
bison                20030307-1
bzip2                1.0.2-6
coreutils            5.3.0-6
crypt                1.1-1
ctags                5.5-4
cvs                  1.11.17-1
cygrunsrv            1.10-1
cygutils             1.2.8-1
cygwin               1.5.17-1
cygwin-doc           1.4-2
diffutils            2.8.7-1
editrights           1.01-1
expat                1.95.8-1
fileutils            4.1-3
findutils            20041227-1
flex                 2.5.4a-3
gawk                 3.1.4-3
gcc                  3.4.4-1
gcc-core             3.4.4-1
gcc-g++              3.4.4-1
gcc-mingw-core       20050522-1
gcc-mingw-g++        20050522-1
gdb                  20041228-3
gdbm                 1.8.3-7
gperf                2.7.2-1
grep                 2.5.1a-2
groff                1.18.1-2
gzip                 1.3.5-1
less                 381-1
libbz2_1             1.0.2-6
libcharset1          1.9.2-1
libdb4.1             4.1.25-1
libdb4.2             4.2.52-1
libgdbm              1.8.0-5
libgdbm-devel        1.8.3-7
libgdbm3             1.8.3-3
libgdbm4             1.8.3-7
libgettextpo0        0.14.1-1
libiconv             1.9.2-1
libiconv2            1.9.2-1
libintl              0.10.38-3
libintl1             0.10.40-1
libintl2             0.12.1-3
libintl3             0.14.1-1
libncurses5          5.2-1
libncurses6          5.2-8
libncurses7          5.3-4
libncurses8          5.4-1
libpcre              4.1-1
libpcre0             4.5-1
libpopt0             1.6.4-4
libreadline4         4.1-2
libreadline5         4.3-5
libreadline6         5.0-2
login                1.9-7
m4                   1.4.3-1
make                 3.80-1
man                  1.5p-1
mingw-runtime        3.7-1
minires              1.00-1
mktemp               1.5-3
ncurses              5.4-1
openssh              4.1p1-1
openssl              0.9.7g-1
patch                2.5.8-8
patchutils           0.2.30-1
perl                 5.8.6-4
readline             5.0-2
sed                  4.1.4-1
sh-utils             2.0.15-5
tar                  1.13.25-7
tcltk                20030901-1
termcap              20050421-1
terminfo             5.4_20041009-1
texinfo              4.8-1
textutils            2.0.21-2
w32api               3.2-1
which                1.7-1
zip                  2.3-6
zlib                 1.2.2-1
Use -h to see help about each section
-------------- next part --------------
// writen.cc
// write N bytes of 'x' to file "tmp"

#include <iostream.h>       // cerr
#include <fstream.h>        // ofstream
#include <stdlib.h>         // atoi
#include <assert.h>         // assert
#include <string.h>         // memset

int main(int argc, char *argv[])
{
  if (argc != 2) {
    cerr << "usage: " << argv[0] << " <n>\n"
         << "  where <n> is the # of 'x' bytes to write to file \"tmp\"\n";
    return 2;
  }

  int n = atoi(argv[1]);
  assert(n >= 0);

  // make string of length 'n'
  char *p = new char[n+1];
  memset(p, 'x', n);
  p[n] = 0;

  // write it to a file
  {
    ofstream out("tmp");
    out << p;
  }

  delete[] p;
  return 0;
}




-------------- next part --------------
~/bld$ gdb writen
GNU gdb 6.3.50_2004-12-28-cvs (cygwin-special)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...(no debugging symbols found)

(gdb) set args 3000000
(gdb) run
Starting program: /home/scott/bld/writen.exe 3000000

Program received signal SIGSEGV, Segmentation fault.
0x61106323 in cygwin1!_alloca () from /usr/bin/cygwin1.dll
(gdb) bt
#0  0x61106323 in cygwin1!_alloca () from /usr/bin/cygwin1.dll
#1  0x6102bca5 in cygwin_internal () from /usr/bin/cygwin1.dll
#2  0x610ad7db in getppid () from /usr/bin/cygwin1.dll
#3  0x610a087f in cygwin1!aclcheck () from /usr/bin/cygwin1.dll
#4  0x0043307c in std::basic_filebuf<char, std::char_traits<char> >::xsputn ()
#5  0x0043e8b2 in std::operator<< <std::char_traits<char> > ()
#6  0x004012ec in main ()
(gdb)
-------------- next part --------------
Exception: STATUS_STACK_OVERFLOW at eip=61106323
eax=000E16C0 ebx=00000002 ecx=00032C50 edx=002DC6C0 esi=002DC6C0 edi=0022ED10
ebp=0022EC88 esp=0022EC48 program=J:\cygwin\home\scott\bld\writen.exe, pid 1040, thread main
cs=001B ds=0023 es=0023 fs=0038 gs=0000 ss=0023
Stack trace:
Frame     Function  Args
0022EC88  61106323  (61821728, 0022ED10, 00000002, 002DC6C0)
0022ECE8  610AD7DB  (00000003, 0022ED10, 00000002, 002DC6C0)
0022ED38  610A087F  (0022EEA8, 00000000, 00000000, 00450270)
0022ED78  0043307C  (0022EE84, 00450270, 002DC6C0, 00445120)
0022EE08  0043E8B2  (0022EE80, 00450270, 00000030, 00401181)
0022EFA8  004012EC  (00000002, 61822D80, 004500A8, 0022F000)
0022EFE8  61006A1D  (0022F000, 00000000, 00000000, 00000000)
0022FF88  61006E41  (00000000, 00000000, 00000000, 00000000)
End of stack trace
-------------- next part --------------
--
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/


More information about the Cygwin mailing list