delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/02/25/16:59:40

From: sylvestre AT world-company DOT com (Commandant Sylvestre)
Subject: b17.1: exception STATUS_ACCESS_VIOLATION after fork()
25 Feb 1997 16:59:40 -0800 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199702252320.AAA02584.cygnus.gnu-win32@luberon.eurecom.fr>
Reply-To: Laurent Montaron <meow AT pobox DOT com>
Mime-Version: 1.0
Original-To: gnu-win32 AT cygnus DOT com (GNU-WIN32 Mailing List)
X-Mailer: ELM [version 2.4ME+ PL19 (25)]
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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 AT world-company DOT com
75005 Paris, France, Europe                         meow AT pobox DOT 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 AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019