I've got a perl script running on Win32 using the
Event module that uses
Net::SSH::W32Perl to execute commands on remote machines.
It has an io watcher looking for client's input (the commands to be executed on the remote hosts) and when it gets a command, creates another watcher of type timer (because the commands may be scheduled to be executed later). When the time comes, the watcher is invoked and it creates a
thread to execute the remote commands (so the server doesn't freeze).
The thread executes ok but, when the server tries to join the thread, it segfaults. Same happens using fork but this is not a surprise because on Win32 its implemented using threads.
The problem seems to be related to spawning a thread while inside a watcher, because if I call fork outside a watcher, works ok and if I use fork inside any watcher (e.g. the io watcher) it segfaults.
Any help would be greatly appreciated.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.