Beefy Boxes and Bandwidth Generously Provided by pair Networks httptech
Think about Loose Coupling
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
None of that info is particularly helpful to me at least but if you see something I don't, I'm all ears.

What I can see from that info is:

  1. At line 3426:
    RXD+ (982) > Command completed with a return code of 0 RXD+ (0) > _handle() output: 51686792 thread handle:2d00 thread-id: 4240x

    A thread, with a perl thread Id (tid) of 982 completes and Windows thread handle:2d00 has (just prior to joining) a OS thread ID of 4240, and the join completes without error.

  2. Later, at line 3775:
    thread handle:2d00 thread-id: 0x GetLastError() output: '6' Join failed with 'Bad file descriptor' : 'The handle is invalid' at rxd.pl line 1128.

    Just prior to a join attempt, 'another thread' with the same OS thread handle 2d00, this time does not have an OS thread id, which indicates that the thread handle:2d00 is indeed an invalid handle as the system reports.

What that indicates is that either:

  • The OS is reusing the same OS thread handle -- which whilst possible seems unlikely.
  • Or this; threads->list(threads::joinable) is returning the handle of an already joined thread. Which also seems unlikely, but could happen if the (Perl) internal linked list got corrupted some how.

The next thing I would try is adding a similar trace line at the end of S_ithread_create(), something like:

S_ithread_create( ... printf( "ITCREATE: thread handle:%x thread-id: %dx\n", thread->han +dle, GetThreadId( thread->handle ) ); MY_POOL.running_threads++; return (thread); }

And also in

STATIC void S_ithread_free(pTHX_ ithread *thread) { ... #ifdef WIN32 printf( "ITFREE: thread handle:%x thread-id: %dx\n", thread->handl +e, GetThreadId( thread->handle ) ); if (handle) { CloseHandle(handle); } #endif ... }

The idea is to isolate whether -- when the error occurs -- the invalid handle is to a thread that has already been freed -- in which case the bug is in threads::list() -- or to a thread that has not yet been freed -- in which case it would mean an OS error of some kind; perhaps resource constraint;

I breifly looked at trying to run your server here and trying to re-create the failure. Whilst the server runs and accepts connections from a telnet seesion, it won't accept input from it because (my) telnet sends character by character and it is expecting entire commands wrapped in your (incredibly complicated) comms protcol.

There is no way I am going to be able to reverse engineer a client that can talk that protocol.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong


In reply to Re^7: PANIC: underlying join failed threded tcp server by BrowserUk
in thread PANIC: underlying join failed threded tcp server by rmahin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others avoiding work at the Monastery: (7)
    As of 2014-04-21 08:14 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      April first is:







      Results (492 votes), past polls