Mailing List Archive

Strange fork() behaviour
Hi,

There are some strange things with fork() and python 1.5.2 going
on here.

I do have some main program which is basically

while 1:
fork()

The program forks under certain conditions and works as expected
but somewhen the main process dies even though it is in the
while 1: loop ... there's no error message ... did anyone
see anything similar ? the program worked fine with 1.5.1
(this is all on a linux box running rh 5.2 and kernel 2.2.6-ac1)

Martin

--
Martin Preishuber - Student, ECLiPt Core Member, SysAdmin
http://eclipt.uni-klu.ac.at,
mailto:Martin.Preishuber@stuco.uni-klu.ac.at

Quigley's Law:
Whoever has any authority over you, no matter how small, will
atttempt to use it.
Strange fork() behaviour [ In reply to ]
+ Martin Preishuber <Martin.Preishuber@stuco.uni-klu.ac.at>:

| There are some strange things with fork() and python 1.5.2 going
| on here.
|
| I do have some main program which is basically
|
| while 1:
| fork()
|
| The program forks under certain conditions and works as expected
| but somewhen the main process dies even though it is in the
| while 1: loop ... there's no error message ... did anyone
| see anything similar ? the program worked fine with 1.5.1
| (this is all on a linux box running rh 5.2 and kernel 2.2.6-ac1)

This is a joke, right? What I would expect the above program to do is
to fork processes until the process table is full or you hit the
per-user process limit, at which point fork() will begin to fail,
which will then most likely terminate the calling process (unless you
trap the error).

I'd be curious to know how this could have worked earlier, or how you
could expect it to behave differently.

or-maybe-basically-really-means-basically-not-ly y'rs,
--
* Harald Hanche-Olsen <URL:http://www.math.ntnu.no/~hanche/>
- "There arises from a bad and unapt formation of words
a wonderful obstruction to the mind." - Francis Bacon
Strange fork() behaviour [ In reply to ]
Harald Hanche-Olsen wrote:

> | There are some strange things with fork() and python 1.5.2 going
> | on here.
> |
> | I do have some main program which is basically
> |
> | while 1:
> | fork()
> |
> | The program forks under certain conditions and works as expected
> | but somewhen the main process dies even though it is in the
> | while 1: loop ... there's no error message ... did anyone
> | see anything similar ? the program worked fine with 1.5.1
> | (this is all on a linux box running rh 5.2 and kernel 2.2.6-ac1)

> This is a joke, right? What I would expect the above program to do is
> to fork processes until the process table is full or you hit the
> per-user process limit, at which point fork() will begin to fail,
> which will then most likely terminate the calling process (unless you
> trap the error).

No sorry, this is definitely not the _full_ code ... it just forks
under some condition (usually, there are never more than 3 or 4
children) ... the point is that the father should never die, but it
does !

> I'd be curious to know how this could have worked earlier, or how you
> could expect it to behave differently.

It does, believe me ;-)

Martin

--
Martin Preishuber - Student, ECLiPt Core Member, SysAdmin
http://eclipt.uni-klu.ac.at,
mailto:Martin.Preishuber@stuco.uni-klu.ac.at

I respect faith, but doubt is what gives you an education.
-- Wilson Mizner