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]

Re: sockets and fork() under b18 coolview




Craig Nelson wrote:

> I am having trouble with a socket request server under win95.
>
> If I write a program to handle incoming socket requests, one at a time, the
> program runs beautiful.  however, if I modify the program to use fork() to
> process each socket request, the program dumps, reporting that the stack is
> probably corrupted.
>
> I've tried to narrow the problem down using a small test case program, and that
> also runs fine with, or without fork().  But using the original program under
> every other unix works flawlessly as well (even purified).
>
> My theory is this:
>
>         -Because the original program runs fine with unix, i will assume its ok.
>
>         -Because the original program runs fine when used on gnu-win32 without
>          fork(), i will continue to assume that it's ok.
>
>         -The smaller test program only worked because it did not "do enough"
>          other processing for the system to realize that the stack had been
>          corrupted.
>
> And so I conclude that the problem is with fork() under gnu-win32.
>
> Has anyone else experienced this scenario with fork?
>
> I've checked all the archives, FAQs and everything, so this is my last resort.
>
> I would certainly appreciate any help anyone has to offer..
>





 I have had your same problem with the fork() on NT server 4.0
 with the version b17 and b18 of the GCC.
 In my program the fork() gave back -1 every time that I called the chdir(),
 otherwise it worked!!



+----------------------------------------------------------------------+
| D'Altoe' Riccardo                                                    |
+---------------------------------+------------------------------------+
| Politecnico di Torino           | phone:  +39-(0)11-5647090          |
| Dip. Automatica e Informatica   |                                    |
| corso Duca degli Abruzzi, 24    | e-mail: daltoe@athena.polito.it    |
| 10129 Torino                    |                                    |
| ITALY                           | fido  : riccardo daltoe 2:334/203  |
+---------------------------------+------------------------------------+

S/MIME Cryptographic Signature


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