Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-ID: <3733199C.F6AF88CB@swi.com> Date: Fri, 07 May 1999 12:49:33 -0400 From: Paul Berrevoets Organization: SWI Systemware/Halcyon Inc. X-Mailer: Mozilla 4.51 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: cygwin-list Subject: child of fork() in TCL package DLL dumps core Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit WinNT Ver 4.0 build 1381 Service Pack 3 I have a TCL package that fork()s a child process, but the child process dumps core immediately: $ cygtclsh80 pkgfork.tcl 0 0 [main] E:\cygnus\cygwin-b20\H-i586-cygwin32\bin\cygtclsh80.exe 9712 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION 0 5521 [main] cygtclsh80 9712 handle_exceptions: Dumping stack trace to cygtclsh80.exe.core This seems to be a DLL issue because if I build the whole TCL app staticly, everything works fine. Sample code follows: # Makefile CC = gcc LDFLAGS = -ltcl80 all: pkgfork.dll %.dll: %.o dllwrap --dllname $@ --def $*.def $*.o $(LDFLAGS) # pkgfork.tcl load pkgfork fork fork ; pkgfork.def EXPORTS Fork_Init ; /* pkgtest.c */ #include #include static int cmdFork(ClientData unused, Tcl_Interp* interp, int argc, char** argv) { pid_t pid; char buf[21]; if (argc != 1) { Tcl_AppendResult(interp, "usage: ", argv[0], (char*)NULL); return TCL_ERROR; } switch (pid=fork()) { case -1: Tcl_SetResult(interp, "fork() failed", TCL_STATIC); return TCL_ERROR; case 0: exit(0); default: sprintf(buf, "%ld", pid); Tcl_SetResult(interp, buf, TCL_VOLATILE); } return TCL_OK; } int Fork_Init(Tcl_Interp *interp) { int rc = Tcl_PkgProvide(interp, "fork", "1.0"); Tcl_CreateCommand(interp, "fork", cmdFork, NULL, NULL); return rc; } -- Paul -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com