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

b17.1: exception STATUS_ACCESS_VIOLATION after fork()


Sorry if this is already covered... I didn't find an archive of the mailing
list.

I'm trying to use the b17.1 on Win95 v4.00.950a (DELL Latitude XPI+ P133ST).
Any C code executed after a fork() triggers an exception and the process
immediately aborts.

The following code makes a fork. The child execs ls and the father just exits:

main() {
        int r ;
        r=fork() ;
        if (-1 == r) {
                perror("fork") ;
                exit(1) ;
        }
        if (0 == r) {
                execlp("ls","ls",0) ;
                perror("execlp") ;
                exit(1) ;
        }
        exit(0) ;
}

When executing that I have:
(a.exe 1012) In cygwin_except_handler
(a.exe 1012) Exception trapped!
(a.exe 1012) exception C0000005 at 10001083
(a.exe 1012) exception: ax FFFF1167 bx 286 cx C30AE3C4 dx 0
(a.exe 1012) exception: si 2578408 di 257F490 bp 257F560 sp 257F484
(a.exe 1012) exception is: STATUS_ACCESS_VIOLATION
(a.exe 1012) Stack trace:
(a.exe 1012) frame 0: sp = 0x257F29C, pc = 0x1001282A
(a.exe 1012) frame 1: sp = 0x257F2B8, pc = 0xBFF7663C
(a.exe 1012) frame 2: sp = 0x257F2DC, pc = 0xBFF859D9
(a.exe 1012) frame 3: sp = 0x257F374, pc = 0xFFECBAD7
(a.exe 1012) frame 4: sp = 0x257F560, pc = 0x10018743
(a.exe 1012) frame 5: sp = 0x257F5CC, pc = 0x401034
(a.exe 1012) frame 6: sp = 0x257F5D8, pc = 0x10011BEB
(a.exe 1012) frame 7: sp = 0x257FE14, pc = 0x10011BFF
(a.exe 1012) frame 8: sp = 0x257FE20, pc = 0x4011E4
(a.exe 1012) frame 9: sp = 0x257FE30, pc = 0x401012
(a.exe 1012) frame 10: sp = 0x257FE38, pc = 0xBFF88F75
(a.exe 1012) frame 11: sp = 0x257FF78, pc = 0xBFF88E23
(a.exe 1012) frame 12: sp = 0x257FFF4, pc = 0xBFF8783F
(a.exe 1012) frame 13: sp = 0x815914FC, pc = 0x3
(a.exe 1012) In cygwin_except_handler
(a.exe 1012) Error while dumping state (probably corrupted stack)

Note that the ls is executed properly if I add a sleep(1) ; just after
the fork().


-- 
Laurent Montaron                                    sylvestre@world-company.com
75005 Paris, France, Europe                         meow@pobox.com
Planet Earth, Sol III, South-West Milky Way         Le_Chat on IRC/EFnet
Universe E45-A North, Continuum 28                  PGP key available
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


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