Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I took the stacktrace, on linux: Stacktrace starts with:
read(4, "abcdefghijklmnopqrstuvwxyz012345"..., 8192) = 6070 write(1, "01285168: 'abcdefghijklmnopqrstu"..., 7501285168: 'abcdefghi +jklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) = 75 select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout) select(8, [3 4], NULL, [3 4], NULL) = 1 (in [4]) write(1, "01285168: 'abcdefghijklmnopqrstu"..., 7501285168: 'abcdefghi +jklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) = 75 select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout) select(8, [3 4], NULL, [3 4], NULL) = 1 (in [4]) write(1, "01285168: 'abcdefghijklmnopqrstu"..., 7501285168: 'abcdefghi +jklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) = 75 select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout) select(8, [3 4], NULL, [3 4], NULL) = 1 (in [4]) write(1, "01285168: 'abcdefghijklmnopqrstu"..., 7501285168: 'abcdefghi +jklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) = 75
You see that it reads 6070 bytes right in one single read. After that it reads nothing, only writes to the screen. But select indeed returns right filehandle. Okay, end of stacktrace:
select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout) select(8, [3 4], NULL, [3 4], NULL) = 1 (in [4]) write(1, "01285168: 'abcdefghijklmnopqrstu"..., 7501285168: 'abcdefghi +jklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) = 75 select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout) select(8, [3 4], NULL, [3 4], NULL) = 1 (in [4]) write(1, "01285168: 'abcdefghijklmnopqrstu"..., 7501285168: 'abcdefghi +jklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) = 75 select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout) select(8, [3 4], NULL, [3 4], NULL) = 1 (in [4]) write(1, "01285168: 'This is the last line"..., 3401285168: 'This is t +he last line' ) = 34 select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout) select(8, [3 4], NULL, [3 4], NULL) = 1 (in [4]) read(4, "", 8192) = 0 close(3) = 0 close(4) = 0 rt_sigaction(SIG_0, NULL, {0x7fb26fce06b2, ~[RT_1 RT_2 RT_3 RT_4 RT_5 +RT_6 RT_7 RT_8 RT_9 RT_10 RT_11 RT_12 RT_13 RT_14 RT_15 RT_16 RT_17 R +T_18 RT_19 RT_20 RT_21 RT_22 RT_23 RT_24 RT_25 RT_26 RT_27 RT_28 RT_2 +9 RT_30 RT_31], 0}, 8) = -1 EINVAL (Invalid argument) rt_sigaction(SIGHUP, NULL, {SIG_DFL, [], 0}, 8) = 0 rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0 rt_sigaction(SIGQUIT, NULL, {SIG_DFL, [], 0}, 8) = 0 rt_sigaction(SIGILL, NULL, {SIG_DFL, [], 0}, 8) = 0
select returns right filehandle again, and.. read returns EOF. So whole the time select was triggered by eof event (EOF is "can_read" too). Let's check. I added sleep before closing socket in client:
sleep; close $server;
and server hanged in the middle. So, without EOF event it stucks. New stacktrace:
ioctl(4, 0x8004667e, 0x1b77ff0) = -1 ENOTTY (Inappropriate ioc +tl for device) select(8, [3 4], NULL, [3 4], NULL) = 1 (in [4]) read(4, "abcdefghijklmnopqrstuvwxyz012345"..., 8192) = 1071 write(1, "01d4c168: 'abcdefghijklmnopqrstu"..., 7501d4c168: 'abcdefghi +jklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) = 75 select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout) select(8, [3 4], NULL, [3 4], NULL) = 1 (in [4]) write(1, "01d4c168: 'abcdefghijklmnopqrstu"..., 7501d4c168: 'abcdefghi +jklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) = 75 select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout) select(8, [3 4], NULL, [3 4], NULL) = 1 (in [4]) write(1, "01d4c168: 'abcdefghijklmnopqrstu"..., 7501d4c168: 'abcdefghi +jklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) = 75 select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout) select(8, [3 4], NULL, [3 4], NULL) = 1 (in [4]) write(1, "01d4c168: 'abcdefghijklmnopqrstu"..., 7501d4c168: 'abcdefghi +jklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) = 75 select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout) select(8, [3 4], NULL, [3 4], NULL) = 1 (in [4]) write(1, "01d4c168: 'abcdefghijklmnopqrstu"..., 7501d4c168: 'abcdefghi +jklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) = 75 select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout) select(8, [3 4], NULL, [3 4], NULL) = 1 (in [4]) write(1, "01d4c168: 'abcdefghijklmnopqrstu"..., 7501d4c168: 'abcdefghi +jklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) = 75 select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout) select(8, [3 4], NULL, [3 4], NULL) = 1 (in [4]) write(1, "01d4c168: 'abcdefghijklmnopqrstu"..., 7501d4c168: 'abcdefghi +jklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) = 75 select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout) select(8, [3 4], NULL, [3 4], NULL) = 1 (in [4]) write(1, "01d4c168: 'abcdefghijklmnopqrstu"..., 7501d4c168: 'abcdefghi +jklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) = 75 select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout) select(8, [3 4], NULL, [3 4], NULL) = 1 (in [4]) write(1, "01d4c168: 'abcdefghijklmnopqrstu"..., 7501d4c168: 'abcdefghi +jklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) = 75 [cut similar lines] select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout) select(8, [3 4], NULL, [3 4], NULL) = 1 (in [4]) write(1, "01d4c168: 'abcdefghijklmnopqrstu"..., 7501d4c168: 'abcdefghi +jklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) = 75 select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout) select(8, [3 4], NULL, [3 4], NULL) = 1 (in [4]) read(4, "abcdefghijklmnopqrstuvwxyz012345"..., 8192) = 4999 write(1, "01d4c168: 'abcdefghijklmnopqrstu"..., 7501d4c168: 'abcdefghi +jklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) = 75 select(0, NULL, NULL, NULL, {0, 100000}) = 0 (Timeout) select(8, [3 4], NULL, [3 4], NULL
last select is not finished. means process stuck on it.

In reply to Re^12: sysread/syswrite wrappers by vsespb
in thread sysread/syswrite wrappers by vsespb

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, 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
  • 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.
  • 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 rifling through the Monastery: (3)
    As of 2020-12-02 04:06 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      How often do you use taint mode?





      Results (28 votes). Check out past polls.

      Notices?