I tried commenting out that line, and I get:
... ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbf99e438) = -1 EINVAL (Inval +id argument) fstat64(0, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, + 0) = 0xb7b62000 read(0, "load(\'jslint.js\');\nfoo=0;\nEND\nqu"..., 1024) = 38 read(0,

So, it's not even to the point where it's processing the information coming from perl. It hasn't even loaded jslint.js yet. I think I get it. So let's see if I'm understanding this properly:

While perl may be properly autoflushing, the interpreter is still buffering its read. Since the socket(?) is still open, it doesn't know to close it and flush.

When it does close it and flush, it is acutally waiting to make use of the rest of the string ("foo=0;\nEND\n") AFTER the readline loop. So it would be as if I had done something like this (which also freezes):

$ echo -e "load('jslint.js');\nfoo=0;\nEND\n" |/usr/bin/js

Hence, the rock and hard place are that, if I don't close $JSWRITE in a timely manner, the interpreter won't know to flush its read buffer and continue, but if I do close $JSWRITE, there's nothing for the readline() loop to read from anymore.

So it's not so much that my Perl code isn't outputting correctly, it's that the interpreter is accepting/buffering input in an incompatible way?


In reply to Re^2: Calling strace -f by Socrates
in thread Diagnosing blocking io (or: finding the WHY of my Open2 woes). by Socrates

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.