Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^4: Is this absurd, or have I not RTFM?

by morgon (Curate)
on May 19, 2014 at 13:40 UTC ( #1086663=note: print w/replies, xml ) Need Help??

in reply to Re^3: Is this absurd, or have I not RTFM?
in thread Is this absurd, or have I not RTFM?

I've tried it with 5.18.1 on Debian testing and I got a run that looked like this:
2014/05/19-15:32:58 Server closing! ======= BEGIN DESTROY:16356======== ============ END DESTROY:16356======== ======= BEGIN DESTROY:16355======== ============ END DESTROY:16355======== ======= BEGIN DESTROY:16356======== ============ END DESTROY:16356========
So everything is balanced nicely but the destructor for 16366 ran twice.

Could it be that the parent forks, child exits parent forks again, second child gets the same pid than the previously exited child?

So that the identical pids actually refer to different processes? But afik pids simply increase before they wrap around so that should not be possible.

Replies are listed 'Best First'.
Re^5: Is this absurd, or have I not RTFM?
by petermogensen (Sexton) on May 19, 2014 at 13:48 UTC

    I should maybe say that I have seen that happen too... It's not 100% certain that there's an "END" missing. But mostly it is. .. and that could well change with other versions of OS/Perl/Net::Server.

    The main problem is that DESTROY is called twice. Doing an strace of the process reveals that it's called twice in the same trace.

    Also... this can happen in both parent and child (though I've never seen it in more than one process at a time)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1086663]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (12)
As of 2018-05-21 13:29 GMT
Find Nodes?
    Voting Booth?