public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Cygwin64: allocating too much memory causes a crash (corrected)
@ 2013-09-10 16:09 Bengt Larsson
  2013-10-15  8:18 ` Corinna Vinschen
  0 siblings, 1 reply; 6+ messages in thread
From: Bengt Larsson @ 2013-09-10 16:09 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 188 bytes --]

(I'm sorry I attached the wrong file. This should be right.)

On Cygwin64, if I malloc too much memory I get a stackdump, instead of a
NULL in return (for example testmalloc 5000000000).


[-- Attachment #2: testmalloc.c --]
[-- Type: application/octet-stream, Size: 339 bytes --]

#include <stdlib.h>
#include <stdio.h>

int
main(int argc, char *argv[])
{
	size_t size = 1000000;

	if (argc > 1) {
		if (sscanf(argv[1], "%zu", &size) != 1) {
			printf("Not a number\n");
			return 1;
		}
	}

	printf("size = %zu\n", size);

	if (malloc(size) != NULL) {
		printf("OK!\n");
	} else {
		printf("NULL!\n");
	}

	return 0;
}

[-- Attachment #3: testmalloc.exe.stackdump --]
[-- Type: application/octet-stream, Size: 1286 bytes --]

Exception: STATUS_ACCESS_VIOLATION at rip=00180144795
rax=000006FFD5FA0000 rbx=000000012A060000 rcx=000000012A060000
rdx=000006FFD5FA0000 rsi=000000012A05F210 rdi=000000000022AB26
r8 =000000012A05FFE2 r9 =0000000000000001 r10=0000000000000000
r11=0000000000000206 r12=0000000000000001 r13=0000000000000000
r14=0000000000000000 r15=000000000022AB26
rbp=000000000022AB80 rsp=000000000022A990
program=C:\Eget\src\mysrc\testmalloc.exe, pid 4236, thread main
cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame        Function    Args
0000022AB80  00180144795 (00000000000, 0000022AB26, 0018017F9EC, 00180173AE0)
0000022AB80  001800C0169 (0012A05F200, 00100403033, 00000000001, 0000022AB80)
0000022AB80  001801130AB (00100403033, 00000000001, 0000022AB80, 0012A05F200)
0000022AB80  00600039F80 (00000000001, 0000022AB80, 0012A05F200, 00000000000)
0000022AB80  0012A05F200 (0000022AB80, 0012A05F200, 00000000000, 0000022AAF0)
0000022AB80  00100403033 (0012A05F200, 00000000000, 0000022AAF0, 00600039F80)
0000022AB80  00000000001 (00000000000, 0000022AAF0, 00600039F80, 0018004835B)
0000022AB80  0000022AB80 (0000022AAF0, 00600039F80, 0018004835B, 00000000000)
0000022AB80  0012A05F200 (0000022AAF0, 00600039F80, 0018004835B, 00000000000)
End of stack trace

[-- Attachment #4: cygcheck.out --]
[-- Type: application/octet-stream, Size: 15804 bytes --]


Cygwin Configuration Diagnostics
Current System Time: Tue Sep 10 17:56:11 2013

Windows 7 Home Premium Ver 6.1 Build 7601 Service Pack 1

Path:	C:\Users\Bengt\Documents\Command
	C:\Eget\Command
	C:\Eget\Perl64\bin
	C:\Eget\cygwin64\bin
	C:\Windows\system32
	C:\Windows
	C:\Windows\System32\Wbem
	C:\Windows\System32\WindowsPowerShell\v1.0\

Output from C:\Eget\cygwin64\bin\id.exe
UID: 1001(Bengt) GID: 545(Users)
545(Users)       513(None)

SysDir: C:\Windows\system32
WinDir: C:\Windows

CYGWIN = 'glob:ignorecase'
HOME = 'C:\Eget\Home\Bengt'
Path = 'C:\Users\Bengt\Documents\Command;C:\Eget\Command;C:\Eget\Perl64\bin;C:\Eget\cygwin64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\'

ALLUSERSPROFILE = 'C:\ProgramData'
APPDATA = 'C:\Users\Bengt\AppData\Roaming'
BINDDIR = 'C:\Eget\bind'
CommonProgramFiles = 'C:\Program Files\Common Files'
CommonProgramFiles(x86) = 'C:\Program Files (x86)\Common Files'
CommonProgramW6432 = 'C:\Program Files\Common Files'
COMPUTERNAME = 'LAPTOP2'
ComSpec = 'C:\Windows\system32\cmd.exe'
CYGBIN = 'C:\Eget\cygwin64\bin'
CYGBIN32 = 'C:\Eget\cygwin\bin'
FP_NO_HOST_CHECK = 'NO'
GZIP = '-9'
HOMEDRIVE = 'C:'
HOMEPATH = '\Users\Bengt'
INFOPATH = '/usr/local/info:/usr/share/info:/usr/info'
LANG = 'C.UTF-8'
LESS = '-eMc -j.5'
LOCALAPPDATA = 'C:\Users\Bengt\AppData\Local'
LOGONSERVER = '\\LAPTOP2'
MANPATH = '/c/Eget/man:/usr/local/man:/usr/share/man:/usr/man:/usr/ssl/man'
MYCOMMAND = 'C:\Users\Bengt\Documents\Command'
MYDESKTOP = 'C:\Users\Bengt\Desktop'
MYDOCUMENTS = 'C:\Users\Bengt\Documents'
NUMBER_OF_PROCESSORS = '2'
OS = 'Windows_NT'
PATHEXT = '.COM;.EXE;.BAT;.CMD;.PCMD;.SHCMD;.BASHCMD'
PROCESSOR_ARCHITECTURE = 'AMD64'
PROCESSOR_IDENTIFIER = 'Intel64 Family 6 Model 42 Stepping 7, GenuineIntel'
PROCESSOR_LEVEL = '6'
PROCESSOR_REVISION = '2a07'
ProgramData = 'C:\ProgramData'
ProgramFiles = 'C:\Program Files'
ProgramFiles(x86) = 'C:\Program Files (x86)'
ProgramW6432 = 'C:\Program Files'
PROMPT = '$P$G'
PSModulePath = 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\'
PUBLIC = 'C:\Users\Public'
SESSIONNAME = 'Console'
SHELL = '/bin/bash'
SystemDrive = 'C:'
SystemRoot = 'C:\Windows'
TEMP = 'C:\Users\Bengt\AppData\Local\Temp'
TMP = 'C:\Users\Bengt\AppData\Local\Temp'
UNZIP = '-C'
USERDOMAIN = 'Laptop2'
USERNAME = 'Bengt'
USERPROFILE = 'C:\Users\Bengt'
windir = 'C:\Windows'
windows_tracing_flags = '3'
windows_tracing_logfile = 'C:\BVTBin\Tests\installpackage\csilogfile.log'

HKEY_CURRENT_USER\Software\Cygwin
HKEY_CURRENT_USER\Software\Cygwin\Installations
  (default) = '\??\C:\Eget\cygwin'
  f65bc92163f7c37a = '\??\C:\Eget\cygwin64'
HKEY_CURRENT_USER\Software\Cygwin\Program Options
HKEY_CURRENT_USER\Software\Cygwin\setup
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mg-cygwin
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mg-cygwin\OpenWithList
  (default) = 'win32pad.exe'
  MRUList = 'a'
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mg-cygwin\OpenWithProgids
  (default) = (unsupported type)
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mg-cygwin-alt
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mg-cygwin-alt\OpenWithList
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.mg-cygwin
  (default) = (unsupported type)
  MRUListEx = (unsupported type)
HKEY_CURRENT_USER\Software\Classes\.mg-cygwin
  (default) = 'mg-cygwin_auto_file'
HKEY_CURRENT_USER\Software\Classes\mg-cygwin_auto_file
  (default) = 'Mg Cygwin init file'
HKEY_CURRENT_USER\Software\Classes\mg-cygwin_auto_file\shell
HKEY_CURRENT_USER\Software\Classes\mg-cygwin_auto_file\shell\open
HKEY_CURRENT_USER\Software\Classes\mg-cygwin_auto_file\shell\open\command
  (default) = '"C:\Eget\Win32Pad\win32pad.exe" "%1"'
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\Installations
  (default) = '\??\C:\Eget\cygwin64'
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\Program Options
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\setup
  (default) = 'C:\Eget\cygwin64'
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Cygwin\Installations
  (default) = '\??\C:\Eget\cygwin'
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Cygwin\Program Options
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Cygwin\setup
  (default) = 'C:\Eget\cygwin'

obcaseinsensitive set to 1

Cygwin installations found in the registry:
  System: Key: f65bc92163f7c37a Path: C:\Eget\cygwin64
  User:   Key: 7957b66a3659267c Path: C:\Eget\cygwin
  User:   Key: f65bc92163f7c37a Path: C:\Eget\cygwin64

c:  hd  NTFS    288758Mb  49% CP CS UN PA FC     Acer

C:\Users\Bengt\Documents  /docs      user    binary,notexec,noacl
C:\Eget\cygwin64          /          system  binary,auto
C:                        /c         system  binary,notexec,noacl
D:                        /d         system  binary,notexec,noacl
C:\Eget\Home              /home      system  binary,noacl
C:\Users                  /users     system  binary,notexec,noacl
C:\Eget\cygwin64\bin      /usr/bin   system  binary,auto
C:\Eget\cygwin64\lib      /usr/lib   system  binary,auto
cygdrive prefix           /cygdrive  user    binary,posix=0,auto

Found: C:\Eget\cygwin64\bin\awk
 -> C:\Eget\cygwin64\bin\gawk.exe
Found: C:\Eget\cygwin64\bin\bash.exe
Found: C:\Eget\cygwin64\bin\cat.exe
Found: C:\Eget\cygwin64\bin\cp.exe
Found: C:\Eget\cygwin64\bin\cpp.exe
Not Found: crontab
Found: C:\Eget\cygwin64\bin\find.exe
Found: C:\Windows\system32\find.exe
Warning: C:\Eget\cygwin64\bin\find.exe hides C:\Windows\system32\find.exe
Found: C:\Eget\cygwin64\bin\gcc.exe
Not Found: gdb
Found: C:\Eget\cygwin64\bin\grep.exe
Found: C:\Eget\cygwin64\bin\kill.exe
Found: C:\Eget\cygwin64\bin\ld.exe
Found: C:\Eget\cygwin64\bin\ls.exe
Found: C:\Eget\cygwin64\bin\make.exe
Found: C:\Eget\cygwin64\bin\mv.exe
Not Found: patch
Found: C:\Eget\Perl64\bin\perl.exe
Found: C:\Eget\cygwin64\bin\perl.exe
Warning: C:\Eget\Perl64\bin\perl.exe hides C:\Eget\cygwin64\bin\perl.exe
Found: C:\Eget\cygwin64\bin\rm.exe
Found: C:\Eget\cygwin64\bin\sed.exe
Not Found: ssh
Found: C:\Eget\cygwin64\bin\sh.exe
Found: C:\Eget\cygwin64\bin\tar.exe
Found: C:\Eget\cygwin64\bin\test.exe
Found: C:\Eget\cygwin64\bin\vi.exe
Not Found: vim

   87k 2013/07/27 C:\Eget\cygwin64\bin\cygatomic-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygatomic-1.dll" v0.0 ts=2013-07-27 13:20
   16k 2013/03/26 C:\Eget\cygwin64\bin\cygattr-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygattr-1.dll" v0.0 ts=2013-03-26 18:26
   64k 2013/03/07 C:\Eget\cygwin64\bin\cygbz2-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygbz2-1.dll" v0.0 ts=2013-03-07 03:54
  117k 2013/05/05 C:\Eget\cygwin64\bin\cygcloog-isl-4.dll - os=4.0 img=0.0 sys=5.2
                  "cygcloog-isl-4.dll" v0.0 ts=2013-05-05 17:41
    9k 2013/03/07 C:\Eget\cygwin64\bin\cygcrypt-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygcrypt-0.dll" v0.0 ts=2013-03-07 10:29
 1526k 2013/03/08 C:\Eget\cygwin64\bin\cygdb-5.3.dll - os=4.0 img=0.0 sys=5.2
                  "cygdb-5.3.dll" v0.0 ts=2013-03-08 08:55
  111k 2013/03/08 C:\Eget\cygwin64\bin\cygdb_cxx-5.3.dll - os=4.0 img=0.0 sys=5.2
                  "cygdb_cxx-5.3.dll" v0.0 ts=2013-03-08 08:56
  472k 2013/03/08 C:\Eget\cygwin64\bin\cygdb_sql-5.3.dll - os=4.0 img=0.0 sys=5.2
                  "cygdb_sql-5.3.dll" v0.0 ts=2013-03-08 08:58
  147k 2013/07/31 C:\Eget\cygwin64\bin\cygexpat-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygexpat-1.dll" v0.0 ts=2013-07-31 23:53
   53k 2013/05/06 C:\Eget\cygwin64\bin\cygformw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygformw-10.dll" v0.0 ts=2013-05-06 09:10
   67k 2013/07/27 C:\Eget\cygwin64\bin\cyggcc_s-seh-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyggcc_s-seh-1.dll" v0.0 ts=2013-07-27 12:45
   29k 2013/03/11 C:\Eget\cygwin64\bin\cyggdbm-4.dll - os=4.0 img=0.0 sys=5.2
                  "cyggdbm-4.dll" v0.0 ts=2013-03-11 05:00
   12k 2013/03/11 C:\Eget\cygwin64\bin\cyggdbm_compat-4.dll - os=4.0 img=0.0 sys=5.2
                  "cyggdbm_compat-4.dll" v0.0 ts=2013-03-11 05:01
  443k 2013/08/04 C:\Eget\cygwin64\bin\cyggmp-10.dll - os=4.0 img=0.0 sys=5.2
                  "cyggmp-10.dll" v0.0 ts=2013-08-04 21:58
   46k 2013/07/27 C:\Eget\cygwin64\bin\cyggomp-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyggomp-1.dll" v0.0 ts=2013-07-27 12:48
   29k 2013/03/14 C:\Eget\cygwin64\bin\cyghistory7.dll - os=4.0 img=0.0 sys=5.2
                  "cyghistory7.dll" v0.0 ts=2013-03-14 11:14
  998k 2013/03/07 C:\Eget\cygwin64\bin\cygiconv-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygiconv-2.dll" v0.0 ts=2013-03-07 04:03
   38k 2013/06/24 C:\Eget\cygwin64\bin\cygintl-8.dll - os=4.0 img=0.0 sys=5.2
                  "cygintl-8.dll" v0.0 ts=2013-06-24 05:36
  888k 2013/05/05 C:\Eget\cygwin64\bin\cygisl-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygisl-10.dll" v0.0 ts=2013-05-05 17:36
    6k 2013/08/31 C:\Eget\cygwin64\bin\cyglsa64.dll - os=4.0 img=0.0 sys=5.2
                  "cyglsa64.dll" v0.0 ts=2013-08-31 20:36
  129k 2013/03/07 C:\Eget\cygwin64\bin\cyglzma-5.dll - os=4.0 img=0.0 sys=5.2
                  "cyglzma-5.dll" v0.0 ts=2013-03-07 11:20
  102k 2013/03/19 C:\Eget\cygwin64\bin\cygmagic-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygmagic-1.dll" v0.0 ts=2013-03-19 14:27
   28k 2013/05/06 C:\Eget\cygwin64\bin\cygmenuw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygmenuw-10.dll" v0.0 ts=2013-05-06 09:10
   85k 2013/05/05 C:\Eget\cygwin64\bin\cygmpc-3.dll - os=4.0 img=0.0 sys=5.2
                  "cygmpc-3.dll" v0.0 ts=2013-05-05 14:46
  319k 2013/05/05 C:\Eget\cygwin64\bin\cygmpfr-4.dll - os=4.0 img=0.0 sys=5.2
                  "cygmpfr-4.dll" v0.0 ts=2013-05-05 14:40
   52k 2013/05/06 C:\Eget\cygwin64\bin\cygncurses++w-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygncurses++w-10.dll" v0.0 ts=2013-05-06 09:14
  295k 2013/05/06 C:\Eget\cygwin64\bin\cygncursesw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygncursesw-10.dll" v0.0 ts=2013-05-06 09:08
   13k 2013/05/06 C:\Eget\cygwin64\bin\cygpanelw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygpanelw-10.dll" v0.0 ts=2013-05-06 09:09
  289k 2013/08/04 C:\Eget\cygwin64\bin\cygpcre-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygpcre-1.dll" v0.0 ts=2013-08-05 00:51
 1580k 2013/03/11 C:\Eget\cygwin64\bin\cygperl5_14.dll - os=4.0 img=0.0 sys=5.2
                  "cygperl5_14.dll" v0.0 ts=2013-03-12 00:25
   40k 2013/03/07 C:\Eget\cygwin64\bin\cygpopt-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygpopt-0.dll" v0.0 ts=2013-03-07 13:01
  302k 2013/07/27 C:\Eget\cygwin64\bin\cygquadmath-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygquadmath-0.dll" v0.0 ts=2013-07-27 13:20
  193k 2013/03/14 C:\Eget\cygwin64\bin\cygreadline7.dll - os=4.0 img=0.0 sys=5.2
                  "cygreadline7.dll" v0.0 ts=2013-03-14 11:14
   11k 2013/07/27 C:\Eget\cygwin64\bin\cygssp-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygssp-0.dll" v0.0 ts=2013-07-27 13:18
  892k 2013/07/27 C:\Eget\cygwin64\bin\cygstdc++-6.dll - os=4.0 img=0.0 sys=5.2
                  "cygstdc++-6.dll" v0.0 ts=2013-07-27 13:02
   51k 2013/05/06 C:\Eget\cygwin64\bin\cygticw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygticw-10.dll" v0.0 ts=2013-05-06 09:08
   79k 2013/05/09 C:\Eget\cygwin64\bin\cygz.dll - os=4.0 img=0.0 sys=5.2
                  "cygz.dll" v0.0 ts=2013-05-09 23:20
 3071k 2013/08/31 C:\Eget\cygwin64\bin\cygwin1.dll - os=4.0 img=0.0 sys=5.2
                  "cygwin1.dll" v0.0 ts=2013-08-31 20:37
    Cygwin DLL version info:
        DLL version: 1.7.25
        DLL epoch: 19
        DLL old termios: 5
        DLL malloc env: 28
        Cygwin conv: 181
        API major: 0
        API minor: 270
        Shared data: 5
        DLL identifier: cygwin1
        Mount registry: 3
        Cygwin registry name: Cygwin
        Program options name: Program Options
        Installations name: Installations
        Cygdrive default prefix: 
        Build date: 
        Shared id: cygwin1S5


Can't find the cygrunsrv utility, skipping services check.


Cygwin Package Information
Last downloaded files to: C:\Eget\cygwin-package
Last downloaded files from: http://ftp.heanet.ie/pub/cygwin/

Package              Version            Status
alternatives         1.3.30c-10         OK
base-cygwin          3.3-1              OK
base-files           4.1-1              OK
bash                 4.1.11-2           OK
binutils             2.23.52-5          OK
bzip2                1.0.6-2            OK
coreutils            8.15-3             OK
cygutils             1.4.14-1           OK
cygwin               1.7.25-1           OK
dash                 0.5.7-4            OK
diffutils            3.3-1              OK
editrights           1.02-1             OK
file                 5.13-1             OK
findutils            4.5.11-1           OK
gawk                 4.1.0-1            OK
gcc-core             4.8.1-3            OK
grep                 2.14-2             OK
groff                1.22.2-1           OK
gzip                 1.4-1              OK
hostname             3.13-1             OK
ipc-utils            1.0-2              OK
less                 458-1              OK
libatomic1           4.8.1-3            OK
libattr1             2.4.46-1           OK
libbz2_1             1.0.6-2            OK
libcloog-isl4        0.18.0-2           OK
libcrypt0            1.1-1              OK
libdb5.3             5.3.21-1           OK
libexpat-devel       2.1.0-3            OK
libexpat1            2.1.0-3            OK
Empty package libexpat1-devel
libexpat1-devel      2.1.0-3            OK
libgcc1              4.8.1-3            OK
libgdbm4             1.10-2             OK
libgmp10             5.1.2-1            OK
libgomp1             4.8.1-3            OK
libiconv2            1.14-1             OK
libintl8             0.18.1.1-3         OK
libisl10             0.11.1-2           OK
liblzma5             5.0.4-1            OK
libmpc3              1.0.1-2            OK
libmpfr4             3.1.2-1            OK
libncursesw-devel    5.9-4              OK
libncursesw10        5.9-4              OK
libpcre1             8.33-1             OK
libpopt0             1.16-1             OK
libquadmath0         4.8.1-3            OK
libreadline-devel    6.2-1              OK
libreadline7         6.2-1              OK
libssp0              4.8.1-3            OK
libstdc++6           4.8.1-3            OK
login                1.10-10            OK
make                 3.82.90-1          OK
man                  1.6g-2             OK
mintty               1.2-beta1-1        OK
ncurses              5.9-4              OK
perl                 5.14.4-1           OK
rebase               4.4.0.1-1          OK
run                  1.3.0-1            OK
sed                  4.2.2-3            OK
tar                  1.26-1             OK
terminfo             5.9-4              OK
texinfo              4.13-1             OK
tzcode               2013c-1            OK
unzip                6.0-1              OK
vim-minimal          7.3.1152-1         OK
w32api-headers       3.0b_svn5962-1     OK
w32api-runtime       3.0b_svn5962-2     OK
which                2.20-2             OK
xz                   5.0.4-1            OK
zlib0                1.2.8-1            OK
Use -h to see help about each section

[-- Attachment #5: Type: text/plain, Size: 218 bytes --]

--
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cygwin64: allocating too much memory causes a crash (corrected)
  2013-09-10 16:09 Cygwin64: allocating too much memory causes a crash (corrected) Bengt Larsson
@ 2013-10-15  8:18 ` Corinna Vinschen
  2013-10-15 13:53   ` Ryan Johnson
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Corinna Vinschen @ 2013-10-15  8:18 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1109 bytes --]

On Sep 10 18:02, Bengt Larsson wrote:
> (I'm sorry I attached the wrong file. This should be right.)
> 
> On Cygwin64, if I malloc too much memory I get a stackdump, instead of a
> NULL in return (for example testmalloc 5000000000).

Sorry for the late reply, I was abroad for a couple of weeks.

I just tried it myself and could easily reproduce the problem.
I found the culprit in mmap.  It was using DWORD instead of size_t
for a variable which was used for rounding purposes.  This accidentally
restricted the length of any allocation to < 4 Gigs(*).  When called
from malloc, malloc would get a valid pointer, pointing to a too small
memory block.  Writing the malloc fencepost then crashed.

Thanks for the report and especially the testcase!  I applied a fix
and will provide a new developer snapshot with this fix on
http://cygwin.com/snapshots/ soon.


Corinna

(*) Naturally the 32 bit version would never see this problem...

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cygwin64: allocating too much memory causes a crash (corrected)
  2013-10-15  8:18 ` Corinna Vinschen
@ 2013-10-15 13:53   ` Ryan Johnson
  2013-10-16 12:12   ` Bengt Larsson
  2013-10-16 20:28   ` Bengt Larsson
  2 siblings, 0 replies; 6+ messages in thread
From: Ryan Johnson @ 2013-10-15 13:53 UTC (permalink / raw)
  To: cygwin

On 15/10/2013 4:18 AM, Corinna Vinschen wrote:
> On Sep 10 18:02, Bengt Larsson wrote:
>> (I'm sorry I attached the wrong file. This should be right.)
>>
>> On Cygwin64, if I malloc too much memory I get a stackdump, instead of a
>> NULL in return (for example testmalloc 5000000000).
> Sorry for the late reply, I was abroad for a couple of weeks.
>
> I just tried it myself and could easily reproduce the problem.
> I found the culprit in mmap.  It was using DWORD instead of size_t
> for a variable which was used for rounding purposes.
You know, this might be only the second 32->64 migration hiccup I've 
seen since the dust settled (the other being in gettimeofday or some such).

That's really impressive, given the number of places in the code where a 
DWORD (or other 32-bit value) could make things go really wrong...

Ryan


--
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cygwin64: allocating too much memory causes a crash (corrected)
  2013-10-15  8:18 ` Corinna Vinschen
  2013-10-15 13:53   ` Ryan Johnson
@ 2013-10-16 12:12   ` Bengt Larsson
  2013-10-16 20:28   ` Bengt Larsson
  2 siblings, 0 replies; 6+ messages in thread
From: Bengt Larsson @ 2013-10-16 12:12 UTC (permalink / raw)
  To: cygwin

Corinna Vinschen wrote:

>Thanks for the report and especially the testcase!  I applied a fix
>and will provide a new developer snapshot with this fix on
>http://cygwin.com/snapshots/ soon.

Thank you Corinna.

--
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cygwin64: allocating too much memory causes a crash (corrected)
  2013-10-15  8:18 ` Corinna Vinschen
  2013-10-15 13:53   ` Ryan Johnson
  2013-10-16 12:12   ` Bengt Larsson
@ 2013-10-16 20:28   ` Bengt Larsson
  2013-10-17  8:39     ` Corinna Vinschen
  2 siblings, 1 reply; 6+ messages in thread
From: Bengt Larsson @ 2013-10-16 20:28 UTC (permalink / raw)
  To: cygwin

Corinna Vinschen wrote:

>Thanks for the report and especially the testcase!  I applied a fix
>and will provide a new developer snapshot with this fix on
>http://cygwin.com/snapshots/ soon.

I tested the snapshot and it works with my testprogram. It also works
with my other program where I detected it.

--
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cygwin64: allocating too much memory causes a crash (corrected)
  2013-10-16 20:28   ` Bengt Larsson
@ 2013-10-17  8:39     ` Corinna Vinschen
  0 siblings, 0 replies; 6+ messages in thread
From: Corinna Vinschen @ 2013-10-17  8:39 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 559 bytes --]

On Oct 16 22:28, Bengt Larsson wrote:
> Corinna Vinschen wrote:
> 
> >Thanks for the report and especially the testcase!  I applied a fix
> >and will provide a new developer snapshot with this fix on
> >http://cygwin.com/snapshots/ soon.
> 
> I tested the snapshot and it works with my testprogram. It also works
> with my other program where I detected it.

Thanks for your feedback!


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-10-17  8:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-10 16:09 Cygwin64: allocating too much memory causes a crash (corrected) Bengt Larsson
2013-10-15  8:18 ` Corinna Vinschen
2013-10-15 13:53   ` Ryan Johnson
2013-10-16 12:12   ` Bengt Larsson
2013-10-16 20:28   ` Bengt Larsson
2013-10-17  8:39     ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).