b21: running on background bug?

creative1 creative1@bigfoot.com
Mon Dec 7 03:19:00 GMT 1998


Using windows 98...

I must admit that i am not very experience with this topic, but I am
having a problem
with something that works prety well on unix.

Ok, I am trying to compile a program that runs and then stays on the
the partial code that I use is this...

   /* move into background? */
   if (backgrd) {
      xx = fork();
      if (xx == -1)
  fatal("CANNOT FORK PROCESS.", 0);
      if (xx != 0) {
         FILE *fp;
         /* need to attempt to write pid now, not later */
         fp = fopen(pid_file, "w");
         if (fp != NULL) {
            fprintf(fp, "%u\n", xx);
            if (fflush(fp)) {
               /* kill bot incase a botchk is run from crond */
               printf("* Warning!  Could not write %s file!\n",
               printf("  Try freeing some disk space\n");
         } else
            printf("* Warning!  Could not write %s file!\n", pid_file);
         printf("Launched into the background  (pid: %d)\n\n", xx);
  setpgid(xx, xx);

It compiles perfect, but at the end, when running, at the last

It seems to run, but about 1 second later it crash with this error:

KAOSBOT caused an invalid page fault in
module KERNEL32.DLL at 015f:bff77146.
EAX=00000058 CS=015f EIP=bff77146 EFLGS=00010246
EBX=025dec9c SS=0167 ESP=025deadc EBP=025deb20
ECX=00010000 DS=0167 ESI=025deccc FS=0000
EDX=00000000 ES=0167 EDI=00000001 GS=0000
Bytes at CS:EIP:
64 ff 32 64 89 22 8b 4c 24 14 e3 03 83 01 00 64
Stack dump:
bffa18dd 6100dca7 00000058 00000000 00000000 00000000 025dec9c 00000020
025dee34 025dec9c 00000000 00000000 00000003 02687b25 025deb30 6100d95d

I tryed to log after that line, but it seems all the activity stop after
that exit(0);
which would be normal in normal code, but using fork should continue
running on the background...

Any idea how to work around this?
maybe it is my mistake :??

Again, works perfect on unix systems.

Thank You
Joaquin Grech

!     C r e a t i v i t y     M u s t    S u r v i v e        !
!  Fido: 2:341/19.67                 Euronet: 25:928/100.67   !
!  Internet: creative1@bigfoot.com                            !
!  Http://surf.to/creative                  Ya me direis :)   !

For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

More information about the Cygwin mailing list