This is the mail archive of the cygwin@cygwin.com 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]

Re: mmap of large amount returns invalid pointer



Corinna:
> Anyway, I've checked in a patch.  It now checks if VirtualProtect
> failed and then mmap() also fails.  Try the next developers snapshot,
> please.

Thanks for the fix.  I tried the 2002-Mar-16 snapshot and the test
program works correctly.  However, a slightly modified program that
munmaps the memory in the parent process and then exits does not work
reliably.  I have included the test case and an strace of a failed run
below.  Because of timing issues, you may have to run the program
several times before you see the failure.  As far as I can tell, the
problem is that the parent unmaps the memory before the child has a
chance to do "fixup_mmaps_after_fork".

--------------------------------------------------------------------------------

#include <stddef.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <unistd.h>

void die (char *s) {
        fprintf(stderr, "%d", s);
        exit(1);
}

int main (int argc, char **argv) {
        pid_t pid;
        size_t length;
        char *buf;

	fprintf(stderr, "starting\n");
        length = getpagesize ();
        buf = (char*) mmap (NULL, length, PROT_READ | PROT_WRITE, 
                                MAP_PRIVATE | MAP_ANON, -1, 0);
        if (buf == (void*)-1) 
                die ("mmap failed");
        strcpy (buf, "hello");
        pid = fork ();
        if (0 == pid) {
                fprintf(stderr, "%s\n", buf);
		munmap (buf, length);
        } else {
                fprintf(stderr, "%s\n", buf);
		munmap (buf, length);
		exit(0);
        }
}

--------------------------------------------------------------------------------

**********************************************
Program name: c:\sweeks\tmp\fork.exe (63)
App version:  1003.10, api: 0.51
DLL version:  1003.11, api: 0.51
DLL build:    20020316 02:33:42SNP
OS version:   Windows NT-4.0
Date/Time:    2002-03-17 10:41:52
**********************************************
 6712   17708 [main] fork 63 environ_init: 0xA010420: !C:=C:\WINNT\Profiles\sweeks\Desktop
 3119   20827 [main] fork 63 environ_init: 0xA010450: !Z:=Z:\cygwin\bin
 2436   23263 [main] fork 63 environ_init: 0xA010468: COMPUTERNAME=WINDOZE
 2324   25587 [main] fork 63 environ_init: 0xA010488: COMSPEC=C:\WINNT\system32\cmd.exe
 2327   27914 [main] fork 63 environ_init: 0xA0104B0: CVSROOT=:pserver:anoncvs@sources.redhat.com:/cvs/src
 2813   30727 [main] fork 63 parse_options: binmode 65536
 2395   33122 [main] fork 63 parse_options: ntsec 1
 2318   35440 [main] fork 63 parse_options: tty 1001
 2314   37754 [main] fork 63 parse_options: returning
 1375   39129 [main] fork 63 environ_init: 0xA0104F0: CYGWIN=binmode ntsec tty 
 2943   42072 [main] fork 63 getwinenv: can't set native for HOME= since no environ yet
 2774   44846 [main] fork 63 mount_info::conv_to_posix_path: conv_to_posix_path (z:\cygwin\home\sweeks, no-keep-rel, no-add-slash)
 1531   46377 [main] fork 63 normalize_win32_path: z:\cygwin\home\sweeks = normalize_win32_path (z:\cygwin\home\sweeks)
 1923   48300 [main] fork 63 mount_info::conv_to_posix_path: /home/sweeks = conv_to_posix_path (z:\cygwin\home\sweeks)
 4062   52362 [main] fork 63 win_env::add_cache: posix /home/sweeks
 1223   53585 [main] fork 63 win_env::add_cache: native HOME=z:\cygwin\home\sweeks
 1217   54802 [main] fork 63 posify: env var converted to HOME=/home/sweeks
 2330   57132 [main] fork 63 environ_init: 0xA010560: HOME=/home/sweeks
 3177   60309 [main] fork 63 environ_init: 0xA010540: HOMEDRIVE=C:
 2429   62738 [main] fork 63 environ_init: 0xA0106A8: HOMEPATH=\
 2314   65052 [main] fork 63 environ_init: 0xA0106B8: LOGNAME=sweeks
 2314   67366 [main] fork 63 environ_init: 0xA0106D0: LOGONSERVER=\\WINDOZE
 2851   70217 [main] fork 63 environ_init: 0xA0106F0: MAIL=/var/spool/mail/sweeks
 2407   72624 [main] fork 63 environ_init: 0xA010710: MAKE_MODE=unix
 2323   74947 [main] fork 63 environ_init: 0xA010728: MANPATH=:/usr/ssl/man:/usr/ssl/man
 2318   77265 [main] fork 63 environ_init: 0xA010750: NUMBER_OF_PROCESSORS=1
 4838   82103 [main] fork 63 environ_init: 0xA010770: OLDPWD=/cygdrive/c/sweeks
 3683   85786 [main] fork 63 environ_init: 0xA010790: OS2LIBPATH=C:\WINNT\system32\os2\dll;
 2469   88255 [main] fork 63 environ_init: 0xA0107C0: OS=Windows_NT
 2803   91058 [main] fork 63 getwinenv: can't set native for PATH= since no environ yet
 2392   93450 [main] fork 63 mount_info::conv_to_posix_path: conv_to_posix_path (z:\cygwin\home\sweeks\bin, keep-rel, no-add-slash)
 1247   94697 [main] fork 63 normalize_win32_path: z:\cygwin\home\sweeks\bin = normalize_win32_path (z:\cygwin\home\sweeks\bin)
 1231   95928 [main] fork 63 mount_info::conv_to_posix_path: /home/sweeks/bin = conv_to_posix_path (z:\cygwin\home\sweeks\bin)
 1210   97138 [main] fork 63 mount_info::conv_to_posix_path: conv_to_posix_path (z:\cygwin\sbin, keep-rel, no-add-slash)
 1355   98493 [main] fork 63 normalize_win32_path: z:\cygwin\sbin = normalize_win32_path (z:\cygwin\sbin)
 1718  100211 [main] fork 63 mount_info::conv_to_posix_path: /sbin = conv_to_posix_path (z:\cygwin\sbin)
 1283  101494 [main] fork 63 mount_info::conv_to_posix_path: conv_to_posix_path (z:\cygwin\usr\sbin, keep-rel, no-add-slash)
 1220  102714 [main] fork 63 normalize_win32_path: z:\cygwin\usr\sbin = normalize_win32_path (z:\cygwin\usr\sbin)
 1205  103919 [main] fork 63 mount_info::conv_to_posix_path: /usr/sbin = conv_to_posix_path (z:\cygwin\usr\sbin)
 1199  105118 [main] fork 63 mount_info::conv_to_posix_path: conv_to_posix_path (z:\cygwin\usr\local\bin, keep-rel, no-add-slash)
 1200  106318 [main] fork 63 normalize_win32_path: z:\cygwin\usr\local\bin = normalize_win32_path (z:\cygwin\usr\local\bin)
 1550  107868 [main] fork 63 mount_info::conv_to_posix_path: /usr/local/bin = conv_to_posix_path (z:\cygwin\usr\local\bin)
 1461  109329 [main] fork 63 mount_info::conv_to_posix_path: conv_to_posix_path (z:\cygwin\bin, keep-rel, no-add-slash)
 1502  110831 [main] fork 63 normalize_win32_path: z:\cygwin\bin = normalize_win32_path (z:\cygwin\bin)
 1273  112104 [main] fork 63 mount_info::conv_to_posix_path: /usr/bin = conv_to_posix_path (z:\cygwin\bin)
 1213  113317 [main] fork 63 mount_info::conv_to_posix_path: conv_to_posix_path (z:\cygwin\bin, keep-rel, no-add-slash)
 1211  114528 [main] fork 63 normalize_win32_path: z:\cygwin\bin = normalize_win32_path (z:\cygwin\bin)
 1202  115730 [main] fork 63 mount_info::conv_to_posix_path: /usr/bin = conv_to_posix_path (z:\cygwin\bin)
 1201  116931 [main] fork 63 mount_info::conv_to_posix_path: conv_to_posix_path (z:\cygwin\home\sweeks\bin, keep-rel, no-add-slash)
 1351  118282 [main] fork 63 normalize_win32_path: z:\cygwin\home\sweeks\bin = normalize_win32_path (z:\cygwin\home\sweeks\bin)
 1740  120022 [main] fork 63 mount_info::conv_to_posix_path: /home/sweeks/bin = conv_to_posix_path (z:\cygwin\home\sweeks\bin)
 1283  121305 [main] fork 63 mount_info::conv_to_posix_path: conv_to_posix_path (z:\cygwin\sbin, keep-rel, no-add-slash)
 1202  122507 [main] fork 63 normalize_win32_path: z:\cygwin\sbin = normalize_win32_path (z:\cygwin\sbin)
 1200  123707 [main] fork 63 mount_info::conv_to_posix_path: /sbin = conv_to_posix_path (z:\cygwin\sbin)
 1195  124902 [main] fork 63 mount_info::conv_to_posix_path: conv_to_posix_path (z:\cygwin\usr\sbin, keep-rel, no-add-slash)
 1197  126099 [main] fork 63 normalize_win32_path: z:\cygwin\usr\sbin = normalize_win32_path (z:\cygwin\usr\sbin)
 1196  127295 [main] fork 63 mount_info::conv_to_posix_path: /usr/sbin = conv_to_posix_path (z:\cygwin\usr\sbin)
 1359  128654 [main] fork 63 mount_info::conv_to_posix_path: conv_to_posix_path (z:\cygwin\usr\local\bin, keep-rel, no-add-slash)
 1497  130151 [main] fork 63 normalize_win32_path: z:\cygwin\usr\local\bin = normalize_win32_path (z:\cygwin\usr\local\bin)
 1269  131420 [main] fork 63 mount_info::conv_to_posix_path: /usr/local/bin = conv_to_posix_path (z:\cygwin\usr\local\bin)
 1216  132636 [main] fork 63 mount_info::conv_to_posix_path: conv_to_posix_path (z:\cygwin\bin, keep-rel, no-add-slash)
 1204  133840 [main] fork 63 normalize_win32_path: z:\cygwin\bin = normalize_win32_path (z:\cygwin\bin)
 1200  135040 [main] fork 63 mount_info::conv_to_posix_path: /usr/bin = conv_to_posix_path (z:\cygwin\bin)
 1199  136239 [main] fork 63 mount_info::conv_to_posix_path: conv_to_posix_path (z:\cygwin\bin, keep-rel, no-add-slash)
 1190  137429 [main] fork 63 normalize_win32_path: z:\cygwin\bin = normalize_win32_path (z:\cygwin\bin)
 1375  138804 [main] fork 63 mount_info::conv_to_posix_path: /usr/bin = conv_to_posix_path (z:\cygwin\bin)
 1669  140473 [main] fork 63 mount_info::conv_to_posix_path: conv_to_posix_path (c:\WINNT\system32, keep-rel, no-add-slash)
 1279  141752 [main] fork 63 normalize_win32_path: c:\WINNT\system32 = normalize_win32_path (c:\WINNT\system32)
 1222  142974 [main] fork 63 mount_info::conv_to_posix_path: /cygdrive/c/WINNT/system32 = conv_to_posix_path (c:\WINNT\system32)
 1212  144186 [main] fork 63 mount_info::conv_to_posix_path: conv_to_posix_path (c:\WINNT, keep-rel, no-add-slash)
 1195  145381 [main] fork 63 normalize_win32_path: c:\WINNT = normalize_win32_path (c:\WINNT)
 1206  146587 [main] fork 63 mount_info::conv_to_posix_path: /cygdrive/c/WINNT = conv_to_posix_path (c:\WINNT)
 3836  150423 [main] fork 63 win_env::add_cache: posix /home/sweeks/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/usr/bin:/home/sweeks/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/usr/bin:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT
 1273  151696 [main] fork 63 win_env::add_cache: native PATH=z:\cygwin\home\sweeks\bin;z:\cygwin\sbin;z:\cygwin\usr\sbin;z:\cygwin\usr\local\bin;z:\cygwin\bin;z:\cygwin\bin;z:\cygwin\home\sweeks\bin;z:\cygwin\sbin;z:\cygwin\usr\sbin;z:\cygwin\usr\local\bin;z:\cygwin\bin;z:\cygwin\bin;c:\WINNT\system32;c:\WINNT
 1448  153144 [main] fork 63 posify: env var converted to PATH=/home/sweeks/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/usr/bin:/home/sweeks/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/usr/bin:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT
 2370  155514 [main] fork 63 environ_init: 0xA0108E0: PATH=/home/sweeks/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/usr/bin:/home/sweeks/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/usr/bin:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT
 2300  157814 [main] fork 63 environ_init: 0xA0107D8: PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
 3189  161003 [main] fork 63 environ_init: 0xA010818: PROCESSOR_ARCHITECTURE=x86
 2401  163404 [main] fork 63 environ_init: 0xA010838: PROCESSOR_IDENTIFIER=x86 Family 15 Model 1 Stepping 2, GenuineIntel
 2295  165699 [main] fork 63 environ_init: 0xA010880: PROCESSOR_LEVEL=15
 2442  168141 [main] fork 63 environ_init: 0xA010898: PROCESSOR_REVISION=0102
 2639  170780 [main] fork 63 environ_init: 0xA0108B8: PROMPT=$P$G
 2372  173152 [main] fork 63 environ_init: 0xA0108C8: PS1=\W% 
 2293  175445 [main] fork 63 environ_init: 0xA010C78: PWD=/cygdrive/c/sweeks/tmp
 2282  177727 [main] fork 63 environ_init: 0xA010C98: SHELL=/bin/bash
 3061  180788 [main] fork 63 environ_init: 0xA010CB0: SHLVL=2
 2381  183169 [main] fork 63 environ_init: 0xA010CC0: SSH_CLIENT=192.168.101.1 56946 22
 2288  185457 [main] fork 63 environ_init: 0xA010CE8: SSH_TTY=/dev/tty1
 2269  187726 [main] fork 63 environ_init: 0xA010D00: SYSTEMDRIVE=C:
 2815  190541 [main] fork 63 environ_init: 0xA010D18: SYSTEMROOT=C:\WINNT
 2384  192925 [main] fork 63 getwinenv: can't set native for TEMP= since no environ yet
 2284  195209 [main] fork 63 mount_info::conv_to_posix_path: conv_to_posix_path (c:\TEMP, no-keep-rel, no-add-slash)
 1189  196398 [main] fork 63 normalize_win32_path: c:\TEMP = normalize_win32_path (c:\TEMP)
 1191  197589 [main] fork 63 mount_info::conv_to_posix_path: /cygdrive/c/TEMP = conv_to_posix_path (c:\TEMP)
 4331  201920 [main] fork 63 win_env::add_cache: posix /cygdrive/c/TEMP
 1205  203125 [main] fork 63 win_env::add_cache: native TEMP=c:\TEMP
 1191  204316 [main] fork 63 posify: env var converted to TEMP=/cygdrive/c/TEMP
 2274  206590 [main] fork 63 environ_init: 0xA010D48: TEMP=/cygdrive/c/TEMP
 2435  209025 [main] fork 63 environ_init: 0xA010D30: TERM=xterm
 2633  211658 [main] fork 63 getwinenv: can't set native for TMP= since no environ yet
 2303  213961 [main] fork 63 mount_info::conv_to_posix_path: conv_to_posix_path (c:\TEMP, no-keep-rel, no-add-slash)
 1181  215142 [main] fork 63 normalize_win32_path: c:\TEMP = normalize_win32_path (c:\TEMP)
 1192  216334 [main] fork 63 mount_info::conv_to_posix_path: /cygdrive/c/TEMP = conv_to_posix_path (c:\TEMP)
 4270  220604 [main] fork 63 win_env::add_cache: posix /cygdrive/c/TEMP
 1279  221883 [main] fork 63 win_env::add_cache: native TMP=c:\TEMP
 1201  223084 [main] fork 63 posify: env var converted to TMP=/cygdrive/c/TEMP
 2277  225361 [main] fork 63 environ_init: 0xA010E98: TMP=/cygdrive/c/TEMP
 2278  227639 [main] fork 63 environ_init: 0xA010FD0: TZ=PST8PDT7,M4.1.0/2,M10.5.0/2
 2756  230395 [main] fork 63 environ_init: 0xA010E88: USER=sweeks
 2742  233137 [main] fork 63 environ_init: 0xA010FF8: USERDOMAIN=WINDOZE
 2319  235456 [main] fork 63 environ_init: 0xA011010: USERNAME=sweeks
 2276  237732 [main] fork 63 environ_init: 0xA011028: USERPROFILE=C:\WINNT\Profiles\sweeks
 3043  240775 [main] fork 63 environ_init: 0xA011058: WINDIR=C:\WINNT
 2380  243155 [main] fork 63 environ_init: 0xA011070: _=/home/sweeks/bin/doit
 5122  248277 [main] fork 63 pinfo_init: pid 63, pgid 63
 2334  250611 [main] fork 63 dtable::extend: size 32, fds 0x615C0128
 7612  258223 [main] fork 63 internal_getlogin: GetUserName() = sweeks
 2277  260500 [main] fork 63 internal_getlogin: User: sweeks, Domain: WINDOZE, Logon Server: WINDOZE
 1326  261826 [main] fork 63 internal_getlogin: Domain: WINDOZE, Logon Server: WINDOZE, Windows Username: sweeks
 1883  263709 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio (0)
 1439  265148 [main] fork 63 _cygwin_istext_for_stdio:  _cifs: fd not open
 1331  266479 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio (1)
 1200  267679 [main] fork 63 _cygwin_istext_for_stdio:  _cifs: fd not open
 1366  269045 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio (2)
 1581  270626 [main] fork 63 _cygwin_istext_for_stdio:  _cifs: fd not open
 1386  272012 [main] fork 63 _open: open (/etc/passwd, 0x20000)
 1621  273633 [main] fork 63 normalize_posix_path: src /etc/passwd
 1544  275177 [main] fork 63 normalize_posix_path: /etc/passwd = normalize_posix_path (/etc/passwd)
 1333  276510 [main] fork 63 mount_info::conv_to_win32_path: conv_to_win32_path (/etc/passwd)
 1387  277897 [main] fork 63 mount_info::conv_to_win32_path: src_path /etc/passwd, dst z:\cygwin\etc\passwd, flags 0xA, rc 0
 8444  286341 [main] fork 63 symlink_info::check: not a symlink
 1579  287920 [main] fork 63 symlink_info::check: 0 = symlink.check (z:\cygwin\etc\passwd, 0x22E7A0) (0xA)
 1293  289213 [main] fork 63 path_conv::check: root_dir(z:\), this->path(z:\cygwin\etc\passwd), set_has_acls(8)
 1588  290801 [main] fork 63 dtable::build_fhandler: fd 3, fh 0x615C02C8
 1686  292487 [main] fork 63 fhandler_base::open: (z:\cygwin\etc\passwd, 0x20000)
 3306  295793 [main] fork 63 fhandler_base::open: 0xE0 = CreateFileA (z:\cygwin\etc\passwd, 0x80000000, 0x7, 0x22EBE0, 0x3, 0x80, 0)
 1336  297129 [main] fork 63 fhandler_base::open: filemode set to text
 1403  298532 [main] fork 63 fhandler_base::open: 1 = fhandler_base::open (z:\cygwin\etc\passwd, 0x20000)
 1356  299888 [main] fork 63 fhandler_disk_file::open: 1 = fhandler_disk_file::open (z:\cygwin\etc\passwd, 0x20000)
 1258  301146 [main] fork 63 _open: 3 = open (/etc/passwd, 0x20000)
 1237  302383 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio (3)
 1216  303599 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio says yes
 5425  309024 [main] fork 63 fhandler_disk_file::fstat_helper: 1 = GetFileInformationByHandle (z:\cygwin\etc\passwd, 224)
 2035  311059 [main] fork 63 get_nt_attribute: file: z:\cygwin\etc\passwd
 1883  312942 [main] fork 63 read_sd: file = z:\cygwin\etc\passwd
11144  324086 [main] fork 63 read_sd: file = z:\cygwin\etc\passwd: len=176
 1755  325841 [main] fork 63 _open: open (/etc/group, 0x20000)
 1694  327535 [main] fork 63 normalize_posix_path: src /etc/group
 1494  329029 [main] fork 63 normalize_posix_path: /etc/group = normalize_posix_path (/etc/group)
 1824  330853 [main] fork 63 mount_info::conv_to_win32_path: conv_to_win32_path (/etc/group)
 1372  332225 [main] fork 63 mount_info::conv_to_win32_path: src_path /etc/group, dst z:\cygwin\etc\group, flags 0xA, rc 0
 4612  336837 [main] fork 63 symlink_info::check: not a symlink
 1447  338284 [main] fork 63 symlink_info::check: 0 = symlink.check (z:\cygwin\etc\group, 0x22CB30) (0xA)
 1411  339695 [main] fork 63 path_conv::check: root_dir(z:\), this->path(z:\cygwin\etc\group), set_has_acls(8)
 1733  341428 [main] fork 63 dtable::build_fhandler: fd 4, fh 0x615C03C0
 1352  342780 [main] fork 63 fhandler_base::open: (z:\cygwin\etc\group, 0x20000)
 2920  345700 [main] fork 63 fhandler_base::open: 0xFC = CreateFileA (z:\cygwin\etc\group, 0x80000000, 0x7, 0x22CF70, 0x3, 0x80, 0)
 1376  347076 [main] fork 63 fhandler_base::open: filemode set to text
 1278  348354 [main] fork 63 fhandler_base::open: 1 = fhandler_base::open (z:\cygwin\etc\group, 0x20000)
 1257  349611 [main] fork 63 fhandler_disk_file::open: 1 = fhandler_disk_file::open (z:\cygwin\etc\group, 0x20000)
 1858  351469 [main] fork 63 _open: 4 = open (/etc/group, 0x20000)
 1304  352773 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio (4)
 1276  354049 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio says yes
 4788  358837 [main] fork 63 fhandler_disk_file::fstat_helper: 1 = GetFileInformationByHandle (z:\cygwin\etc\group, 252)
 2083  360920 [main] fork 63 get_nt_attribute: file: z:\cygwin\etc\group
 1412  362332 [main] fork 63 read_sd: file = z:\cygwin\etc\group
18806  381138 [main] fork 63 read_sd: file = z:\cygwin\etc\group: len=176
 1828  382966 [main] fork 63 get_nt_attribute: file: z:\cygwin\etc\group 1E4, uid 2000, gid 2001
 1479  384445 [main] fork 63 fhandler_disk_file::fstat_helper: 0 = fstat (, 0x22D240) st_atime=3C94E3A1 st_size=277, st_mode=0x81E4, st_ino=325591779, sizeof=88
 1406  385851 [main] fork 63 fstat64: 0 = fstat (4, 0x22D240)
 1335  387186 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio (4)
 1468  388654 [main] fork 63 _cygwin_istext_for_stdio:  _cifs: get_*_binary
 1580  390234 [main] fork 63 setmode_helper: setmode: file was cle now raw
 1331  391565 [main] fork 63 setmode: setmode (4</etc/group>, binary) returns text
 1297  392862 [main] fork 63 _read: read (4, 0xA011200, 1024) blocking, sigcatchers 0
 1286  394148 [main] fork 63 _read: non-interruptible read
 3295  397443 [main] fork 63 fhandler_base::read: returning 277 chars, binary mode
 1609  399052 [main] fork 63 _read: 277 = read (4, 0xA011200, 1024), errno 0
 1369  400421 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio (4)
 1557  401978 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio says yes
 1285  403263 [main] fork 63 setmode_helper: setmode: file was raw now cle
 1267  404530 [main] fork 63 setmode: setmode (4</etc/group>, text) returns binary
24108  428638 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio (4)
 1708  430346 [main] fork 63 _cygwin_istext_for_stdio:  _cifs: get_*_binary
 1323  431669 [main] fork 63 setmode_helper: setmode: file was cle now raw
 1259  432928 [main] fork 63 setmode: setmode (4</etc/group>, binary) returns text
 1272  434200 [main] fork 63 _read: read (4, 0xA011200, 1024) blocking, sigcatchers 0
 1281  435481 [main] fork 63 _read: non-interruptible read
 2793  438274 [main] fork 63 _read: 0 = read (4, 0xA011200, 1024), errno 0
 1542  439816 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio (4)
 1865  441681 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio says yes
 1543  443224 [main] fork 63 setmode_helper: setmode: file was raw now cle
 1258  444482 [main] fork 63 setmode: setmode (4</etc/group>, text) returns binary
 2797  447279 [main] fork 63 _close: close (4)
 1528  448807 [main] fork 63 fhandler_base::close: closing '/etc/group' handle 0xFC
 3334  452141 [main] fork 63 _close: 0 = close (4)
 1558  453699 [main] fork 63 normalize_posix_path: src /etc
 1329  455028 [main] fork 63 normalize_posix_path: /etc = normalize_posix_path (/etc)
 1279  456307 [main] fork 63 mount_info::conv_to_win32_path: conv_to_win32_path (/etc)
 1293  457600 [main] fork 63 mount_info::conv_to_win32_path: src_path /etc, dst z:\cygwin\etc, flags 0xA, rc 0
 5001  462601 [main] fork 63 symlink_info::check: not a symlink
 1394  463995 [main] fork 63 symlink_info::check: 0 = symlink.check (z:\cygwin\etc, 0x22CF60) (0xA)
 1266  465261 [main] fork 63 path_conv::check: root_dir(z:\), this->path(z:\cygwin\etc), set_has_acls(8)
 2939  468200 [main] fork 63 get_nt_attribute: file: z:\cygwin\etc\passwd 1C0, uid 2000, gid 2001
 1416  469616 [main] fork 63 fhandler_disk_file::fstat_helper: 0 = fstat (, 0x22EEB0) st_atime=3C94E3A1 st_size=482, st_mode=0x81C0, st_ino=387896088, sizeof=88
 2504  472120 [main] fork 63 fstat64: 0 = fstat (3, 0x22EEB0)
 1615  473735 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio (3)
 1286  475021 [main] fork 63 _cygwin_istext_for_stdio:  _cifs: get_*_binary
 1256  476277 [main] fork 63 setmode_helper: setmode: file was cle now raw
 1255  477532 [main] fork 63 setmode: setmode (3</etc/passwd>, binary) returns text
 1280  478812 [main] fork 63 _read: read (3, 0xA011200, 1024) blocking, sigcatchers 0
 1581  480393 [main] fork 63 _read: non-interruptible read
 2923  483316 [main] fork 63 fhandler_base::read: returning 482 chars, binary mode
 1371  484687 [main] fork 63 _read: 482 = read (3, 0xA011200, 1024), errno 0
 1558  486245 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio (3)
 1334  487579 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio says yes
 1264  488843 [main] fork 63 setmode_helper: setmode: file was raw now cle
 1314  490157 [main] fork 63 setmode: setmode (3</etc/passwd>, text) returns binary
 9786  499943 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio (3)
 1655  501598 [main] fork 63 _cygwin_istext_for_stdio:  _cifs: get_*_binary
 1506  503104 [main] fork 63 setmode_helper: setmode: file was cle now raw
 1281  504385 [main] fork 63 setmode: setmode (3</etc/passwd>, binary) returns text
 1261  505646 [main] fork 63 _read: read (3, 0xA011200, 1024) blocking, sigcatchers 0
 1259  506905 [main] fork 63 _read: non-interruptible read
 2710  509615 [main] fork 63 _read: 0 = read (3, 0xA011200, 1024), errno 0
 1701  511316 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio (3)
 1314  512630 [main] fork 63 _cygwin_istext_for_stdio: _cygwin_istext_for_stdio says yes
 1408  514038 [main] fork 63 setmode_helper: setmode: file was raw now cle
 1267  515305 [main] fork 63 setmode: setmode (3</etc/passwd>, text) returns binary
 2823  518128 [main] fork 63 _close: close (3)
 1371  519499 [main] fork 63 fhandler_base::close: closing '/etc/passwd' handle 0xE0
 3020  522519 [main] fork 63 _close: 0 = close (3)
 2824  525343 [main] fork 63 internal_getlogin: Cygwins Username: sweeks
 3369  528712 [main] fork 63 sigproc_init: process/signal handling enabled(1001)
 4533  533245 [main] fork 63 transport_layer_pipes::connect: Error opening the pipe (2)
24185  557430 [sig] fork 63 wait_sig: sigcatch_nonmain 0x30, sigcatch_main 0x38
 1580  559010 [sig] fork 63 wait_sig: Ready.  dwProcessid 63
70036  629046 [main] fork 63 tty_list::allocate_tty: console 19F0080 already associated with tty0
 3146  632192 [main] fork 63 build_argv: argv[0] = './fork'
 1130  633322 [main] fork 63 build_argv: argc 1
 2173  635495 [main] fork 63 normalize_posix_path: src /dev/piper
 1914  637409 [main] fork 63 normalize_posix_path: /dev/piper = normalize_posix_path (/dev/piper)
 1325  638734 [main] fork 63 mount_info::conv_to_win32_path: conv_to_win32_path (/dev/piper)
 1811  640545 [main] fork 63 mount_info::conv_to_win32_path: src_path /dev/piper, dst \dev\piper, flags 0x2, rc 0
 1415  641960 [main] fork 63 dtable::build_fhandler: fd 0, fh 0x615C02C8
 1306  643266 [main] fork 63 fhandler_base::init: created new fhandler_base for handle 0x1D4
 1276  644542 [main] fork 63 dtable::init_std_file_from_handle: fd 0, handle 0x1D4
 2240  646782 [main] fork 63 normalize_posix_path: src unknown disk file
 1484  648266 [main] fork 63 mount_info::conv_to_posix_path: conv_to_posix_path (c:\sweeks\tmp, no-keep-rel, no-add-slash)
 1569  649835 [main] fork 63 normalize_win32_path: c:\sweeks\tmp = normalize_win32_path (c:\sweeks\tmp)
 1850  651685 [main] fork 63 mount_info::conv_to_posix_path: /cygdrive/c/sweeks/tmp = conv_to_posix_path (c:\sweeks\tmp)
 1289  652974 [main] fork 63 cwdstuff::get: posix /cygdrive/c/sweeks/tmp
 1210  654184 [main] fork 63 cwdstuff::get: (/cygdrive/c/sweeks/tmp) = cwdstuff::get (0x22F950, 260, 1, 0), errno 0
 1200  655384 [main] fork 63 normalize_posix_path: /cygdrive/c/sweeks/tmp/unknown disk file = normalize_posix_path (unknown disk file)
 1189  656573 [main] fork 63 mount_info::conv_to_win32_path: conv_to_win32_path (/cygdrive/c/sweeks/tmp/unknown disk file)
 1195  657768 [main] fork 63 mount_info::cygdrive_win32_path: src '/cygdrive/c/sweeks/tmp/unknown disk file', dst 'c:\sweeks\tmp\unknown disk file'
 1194  658962 [main] fork 63 mount_info::conv_to_win32_path: src_path /cygdrive/c/sweeks/tmp/unknown disk file, dst c:\sweeks\tmp\unknown disk file, flags 0x22, rc 0
 3292  662254 [main] fork 63 symlink_info::check: GetFileAttributes (c:\sweeks\tmp\unknown disk file) failed
 1383  663637 [main] fork 63 geterrno_from_win_error: windows error 2 == errno 2
 1409  665046 [main] fork 63 symlink_info::check: GetFileAttributes (c:\sweeks\tmp\unknown disk file.lnk) failed
 1499  666545 [main] fork 63 geterrno_from_win_error: windows error 2 == errno 2
 1266  667811 [main] fork 63 symlink_info::check: 0 = symlink.check (c:\sweeks\tmp\unknown disk file, 0x22F610) (0x22)
 1205  669016 [main] fork 63 mount_info::conv_to_win32_path: conv_to_win32_path (/cygdrive/c/sweeks/tmp)
 2297  671313 [main] fork 63 mount_info::cygdrive_win32_path: src '/cygdrive/c/sweeks/tmp', dst 'c:\sweeks\tmp'
 1325  672638 [main] fork 63 mount_info::conv_to_win32_path: src_path /cygdrive/c/sweeks/tmp, dst c:\sweeks\tmp, flags 0x22, rc 0
 1419  674057 [main] fork 63 symlink_info::check: not a symlink
 1272  675329 [main] fork 63 symlink_info::check: 0 = symlink.check (c:\sweeks\tmp, 0x22F610) (0x22)
 1204  676533 [main] fork 63 path_conv::check: root_dir(c:\), this->path(c:\sweeks\tmp\unknown disk file), set_has_acls(8)
 1226  677759 [main] fork 63 dtable::build_fhandler: fd 1, fh 0x615C03C0
 1227  678986 [main] fork 63 fhandler_base::init: created new fhandler_base for handle 0x78
 2273  681259 [main] fork 63 dtable::init_std_file_from_handle: fd 1, handle 0x78
 2128  683387 [main] fork 63 normalize_posix_path: src unknown disk file
 1267  684654 [main] fork 63 cwdstuff::get: posix /cygdrive/c/sweeks/tmp
 1196  685850 [main] fork 63 cwdstuff::get: (/cygdrive/c/sweeks/tmp) = cwdstuff::get (0x22F940, 260, 1, 0), errno 0
 1194  687044 [main] fork 63 normalize_posix_path: /cygdrive/c/sweeks/tmp/unknown disk file = normalize_posix_path (unknown disk file)
 1187  688231 [main] fork 63 mount_info::conv_to_win32_path: conv_to_win32_path (/cygdrive/c/sweeks/tmp/unknown disk file)
 1326  689557 [main] fork 63 mount_info::cygdrive_win32_path: src '/cygdrive/c/sweeks/tmp/unknown disk file', dst 'c:\sweeks\tmp\unknown disk file'
 1748  691305 [main] fork 63 mount_info::conv_to_win32_path: src_path /cygdrive/c/sweeks/tmp/unknown disk file, dst c:\sweeks\tmp\unknown disk file, flags 0x22, rc 0
 1888  693193 [main] fork 63 symlink_info::check: GetFileAttributes (c:\sweeks\tmp\unknown disk file) failed
 1318  694511 [main] fork 63 geterrno_from_win_error: windows error 2 == errno 2
 1397  695908 [main] fork 63 symlink_info::check: GetFileAttributes (c:\sweeks\tmp\unknown disk file.lnk) failed
 1258  697166 [main] fork 63 geterrno_from_win_error: windows error 2 == errno 2
 1196  698362 [main] fork 63 symlink_info::check: 0 = symlink.check (c:\sweeks\tmp\unknown disk file, 0x22F600) (0x22)
 1369  699731 [main] fork 63 mount_info::conv_to_win32_path: conv_to_win32_path (/cygdrive/c/sweeks/tmp)
 1528  701259 [main] fork 63 mount_info::cygdrive_win32_path: src '/cygdrive/c/sweeks/tmp', dst 'c:\sweeks\tmp'
 1265  702524 [main] fork 63 mount_info::conv_to_win32_path: src_path /cygdrive/c/sweeks/tmp, dst c:\sweeks\tmp, flags 0x22, rc 0
 1365  703889 [main] fork 63 symlink_info::check: not a symlink
 1259  705148 [main] fork 63 symlink_info::check: 0 = symlink.check (c:\sweeks\tmp, 0x22F600) (0x22)
 1201  706349 [main] fork 63 path_conv::check: root_dir(c:\), this->path(c:\sweeks\tmp\unknown disk file), set_has_acls(8)
 1209  707558 [main] fork 63 dtable::build_fhandler: fd 2, fh 0x615C0708
 1199  708757 [main] fork 63 fhandler_base::init: created new fhandler_base for handle 0x54
 1350  710107 [main] fork 63 dtable::init_std_file_from_handle: fd 2, handle 0x54
 1792  711899 [main] fork 63 dll_list::init: here
 1480  713379 [main] fork 63 dll_crt0_1: user_data->main 0x401094
 1356  714735 [main] fork 63 sig_send: pid 63, signal -2, its_me 1
 1376  716111 [main] fork 63 sig_send: Waiting for thiscomplete 0x48
 1348  717459 [sig] fork 63 wait_sig: awake
 1221  718680 [sig] fork 63 wait_sig: processing signal -2
 1385  720065 [sig] fork 63 wait_sig: set main thread completion event
 1498  721563 [sig] fork 63 wait_sig: looping
 1299  722862 [main] fork 63 sig_send: returning 0 from sending signal -2
 1330  724192 [main] fork 63 _write: write (2, 0x22F758, 9)
 1260  725452 [main] fork 63 fhandler_base::write: binary write
starting
 1560  727012 [main] fork 63 fhandler_base::write: 9 = write (0x22F758, 9)
 1251  728263 [main] fork 63 _write: 9 = write (2, 0x22F758, 9)
 1620  729883 [main] fork 63 mmap64: addr 0, len 4096, prot 3, flags 22, fd -1, off 0
 4448  734331 [main] fork 63 fhandler_disk_file::mmap: 2A230000 = MapViewOfFileEx (h:88, access:1, 0, off:0, len:65536, addr:0)
 4635  738966 [main] fork 63 mmap64: 2A230000 = mmap() succeeded
 2102  741068 [main] fork 63 fork: entering
 3084  744152 [main] fork 63 subproc_init: started wait_subproc thread 0x74
 3404  747556 [main] fork 63 stack_base: bottom 0x230000, top 0x30000, stack 0x22F808, size 2040, reserve 2097152
 1584  749140 [main] fork 63 fork_parent: CreateProcess (c:\sweeks\tmp\fork.exe, c:\sweeks\tmp\fork.exe, 0, 0, 1, 20, 0, 0, 0x22FC78, 0x22FCC8)
 8211  757351 [main] fork 63 proc_subproc: args: 1, 2291816
 1886  759237 [main] fork 63 proc_subproc: added pid 138 to wait list, slot 0, winpid 0x8A, handle 0x198
 3194  762431 [proc] fork 63 wait_subproc: starting
 1377  763808 [proc] fork 63 wait_subproc: looping
14670  778478 [main] fork 63 proc_subproc: returning 1
 1383  779861 [main] fork 63 sync_with_child: waiting for child.  reason: waiting for longjmp, hang_child 1
**********************************************
Program name: c:\sweeks\tmp\fork.exe (138)
App version:  1003.10, api: 0.51
DLL version:  1003.11, api: 0.51
DLL build:    20020316 02:33:42SNP
OS version:   Windows NT-4.0
Date/Time:    2002-03-17 10:41:53
**********************************************
 1460   10272 [main] fork 138 open_shared: name shared, shared 0xA000000 (wanted 0xA000000), h 0x148
10409   20681 [main] fork 138 heap_init: heap base 0xA010000, heap top 0xA012000
 1818   22499 [main] fork 138 open_shared: name sweeks, shared 0x890000 (wanted 0x0), h 0x1C
 1301   23800 [main] fork 138 memory_init: opening mount table for 'sweeks' at 0xA010000
 1285   25085 [main] fork 138 memory_init: mount table version 41FB at 0x890000
 1745   26830 [main] fork 138 events_init: windows_system_directory 'C:\WINNT\System32\', windows_system_directory_length 18
 1785   28615 [main] fork 138 events_init: cygwin_hmodule 0x61000000
 3384   31999 [main] fork 138 fork_child: child is running.  pid 138, ppid 63, stack here 0x22FCE8
 1604   33603 [main] fork 138 fork_child: Impersonation of child, token: -1
 1462   35065 [main] fork 138 sync_with_parent: signalling parent: after longjmp.
79233  859094 [main] fork 63 sync_with_child: child signalled me
 1257  860351 [main] fork 63 fork_parent: child is alive (but stopped)
 2001  862352 [main] fork 63 fork_copy: child handle 0x198, low 0x402000, high 0x402014, res 1
 1629  863981 [main] fork 63 fork_copy: child handle 0x198, low 0x403000, high 0x40300C, res 1
 2023  866004 [main] fork 63 fork_copy: child handle 0x198, low 0xA010000, high 0xA012000, res 1
 1781  867785 [main] fork 63 fork_copy: child handle 0x198, low 0x22FD00, high 0x230000, res 1
 2299  870084 [main] fork 63 fork_copy: child handle 0x198, low 0x610A3000, high 0x610A75E0, res 1
 8445  878529 [main] fork 63 fork_copy: child handle 0x198, low 0x610C3000, high 0x610F9410, res 1
 1439  879968 [main] fork 63 fork_copy: done
 1788  881756 [main] fork 63 resume_child: signalled child
 1295  883051 [main] fork 63 sync_with_child: waiting for child.  reason: child loading dlls, hang_child 0
849575  884640 [main] fork 138 sync_with_parent: awake
 1332  885972 [main] fork 138 sync_with_parent: no problems
 1212  887184 [main] fork 138 fork_child: hParent 0xF4, child 1 first_dll 0x0, load_dlls 0
 1241  888425 [main] fork 138 set_file_api_mode: File APIs set to ANSI
 1295  889720 [main] fork 138 sync_with_parent: signalling parent: performed fork fixup.
 8410  891461 [main] fork 63 sync_with_child: child signalled me
 1346  892807 [main] fork 63 fork: 138 = fork()
 1547  894354 [main] fork 63 _write: write (2, 0x22F758, 6)
 1413  895767 [main] fork 63 fhandler_base::write: binary write
hello
 1403  897170 [main] fork 63 fhandler_base::write: 6 = write (0x22F758, 6)
 1483  898653 [main] fork 63 _write: 6 = write (2, 0x22F758, 6)
 1313  899966 [main] fork 63 munmap: munmap (addr 2A230000, len 4096)
 3091  903057 [main] fork 63 munmap: 0 = munmap(): 2A230000
 1437  904494 [main] fork 63 do_exit: do_exit (0)
 1324  905818 [main] fork 63 void: 0x0 = signal (20, 0x1)
 1347  907165 [main] fork 63 void: 0x0 = signal (1, 0x1)
 1304  908469 [main] fork 63 void: 0x0 = signal (2, 0x1)
 1204  909673 [main] fork 63 void: 0x0 = signal (3, 0x1)
21544  911264 [main] fork 138 fixup_mmaps_after_fork: recreate_mmaps_after_fork, mmapped_areas 0xA011BF0
 1304  912568 [main] fork 138 fixup_mmaps_after_fork: fd -1, h 88, access 1, offset 0, size 65536, address 0x2A230000
 914381 [main] fork 138 fixup_mmaps_after_fork: ReadProcessMemory failed for MAP_PRIVATE address 0x2A230000, Win32 error 998
11402  921075 [main] fork 63 fhandler_base::close: closing '/dev/piper' handle 0x1D4
 1813  914381 [main] fork 138 fixup_mmaps_after_fork: ReadProcessMemory failed for MAP_PRIVATE address 0x2A230000, Win32 error 998
c:\sweeks\tmp\fork.exe: *** recreate_mmaps_after_fork_failed
156122 1070503 [main] fork 138 proc_terminate: nchildren 0, nzombies 0
 2029 1072532 [main] fork 138 proc_terminate: leaving
 1536 1074068 [main] fork 138 sigproc_terminate: entering
 1239 1075307 [main] fork 138 sigproc_terminate: done
 1360 1076667 [main] fork 138 __to_clock_t: dwHighDateTime 0, dwLowDateTime 801152
 1368 1078035 [main] fork 138 __to_clock_t: total 00000000 00000050
 1321 1079356 [main] fork 138 __to_clock_t: dwHighDateTime 0, dwLowDateTime 100144
 1222 1080578 [main] fork 138 __to_clock_t: total 00000000 0000000A
164782 1085857 [main] fork 63 fhandler_base::close: closing 'unknown disk file' handle 0x78
 1573 1087430 [main] fork 63 fhandler_base::close: closing 'unknown disk file' handle 0x54
 1391 1088821 [main] fork 63 proc_terminate: nchildren 1, nzombies 0
 2483 1091304 [proc] fork 63 wait_subproc: looping
 2939 1094243 [proc] fork 63 wait_subproc: done
 3571 1097814 [main] fork 63 proc_subproc: args: 3, 1
 1299 1099113 [main] fork 63 proc_subproc: clear waiting threads
 1207 1100320 [main] fork 63 proc_subproc: finished clearing
 3189 1103509 [main] fork 63 proc_subproc: returning 1
 1417 1104926 [main] fork 63 proc_terminate: 138(138) closed child handle
 1372 1106298 [main] fork 63 proc_terminate: leaving
 1263 1107561 [main] fork 63 sigproc_terminate: entering
 1205 1108766 [main] fork 63 sigproc_terminate: done
 1205 1109971 [main] fork 63 do_exit: 63 == pgrp 63, send SIG{HUP,CONT} to stopped children
 1603 1111574 [main] fork 63 kill_pgrp: pid 63, signal -1
13056 1124630 [main] fork 63 pinfo::init: execed process windows pid 191, cygwin pid 117
 1750 1126380 [main] fork 63 pinfo::init: execed process windows pid 196, cygwin pid 238
 1772 1128152 [main] fork 63 kill_pgrp: -1 = kill (63, -1)
 6432 1134584 [main] fork 63 do_exit: 63 == sid 63, send SIGHUP to children
 2814 1137398 [main] fork 63 __to_clock_t: dwHighDateTime 0, dwLowDateTime 7310512
 1258 1138656 [main] fork 63 __to_clock_t: total 00000000 000002DB
 1227 1139883 [main] fork 63 __to_clock_t: dwHighDateTime 0, dwLowDateTime 200288
 1733 1141616 [main] fork 63 __to_clock_t: total 00000000 00000014
86887 1167465 [main] fork 138 _pinfo::exit: Calling ExitProcess 1
47644 1189260 [main] fork 63 _pinfo::exit: Calling ExitProcess 0

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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