Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2022-12-01 05:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?