First, thanks to the monks who have tested this program for me! I'm still hoping to find someone who can reproduce my hangs; then we can play Sherlock Holmes to try to figure what is different about the hanging machines versus the non-hanging ones. Oh, and I get the hangs with debug builds too, which is good news.

I'm learning far more about critical sections than I ever wanted to. When I issue the !cs command in WinDbg to display all critical sections, I get this on the offending critical section:

DebugInfo = 0x00043bf0 Critical section = 0x00222d44 (+0x222D44) LOCKED LockCount = 0x0 OwningThread = 0x00000000 RecursionCount = 0x0 LockSemaphore = 0x7B0 SpinCount = 0x00000000

As noted here having an OwningThread of zero is "illogical" with a LockCount of zero:

While examining a deadlocked program, we also found a state for which there seemed to be no logical explanation. The LockCount field for one heavily used critical section contained a value greater than -1; that is, it was owned, but the OwningThread field was zero (which destroyed evidence against the guilty thread). The test program was multithreaded, and the condition arose on both single and multiprocessor machines. Although LockCount and other values differed from run to run, the program always deadlocked on the same critical section. We'd definitely be curious to find out if any other developers out there have seen the API call sequence leading up to this state.

So, maybe I should contact Matt Pietrek to investigate this bug for me. :-)


In reply to Re: Perl threads test intermittently hangs on Windows by eyepopslikeamosquito
in thread Perl threads test intermittently hangs on Windows by eyepopslikeamosquito

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!
  • 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:
    & &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.