Bug 27880

Summary: select fails to return incoming connect
Product: Base System Reporter: proett <proett>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.3-STABLE   
Hardware: Any   
OS: Any   

Description proett 2001-06-04 23:00:13 UTC
A program sets up a socket to listen to and waits for incoming
connections in select.  A second program calls connect which is
fairly often not detected.

How-To-Repeat: Run these two programs on the same 4.3 machine.

begin 644 two.tgz
M'XL(`"<"'#L``^U7?T_C1A#E7_M3#*E([5,`._Q2+U`I*CDU*@VG!*[J<2?+
MV!MB7;*.O&LHK?CNG=FUDS@$N-,=M%7WG<YV9F??SHQGUP^11I\2OA6M/2-\
MS]O?W84U`/]@SZ<[PBON`#M-WP,XV/'V]GS?:_KHYN\T]]?`>\Z@2N1"AAG`
MVC1+F90/^]V,&!N_1$`OB^\2'HWSF%F'0L9)NC7ZT9Z;<IZ@M6KC3,:7:((%
MF[@5V_)VRD3559F3";MO%=AU3-XC3O#_-G9CQ1YFTW";1LAL3\*$.V%V%34`
MK]>NG7!IT>^6'8W"S'I%UHN/+?LOVZ*A8=P`3I<QXPU(\$<#IFDF6[:E_"_S
MX<6N]\,^SK"$S/)(6A1<&,=9D'!+T`,.#>-`,!QB8[PU(&-AC`_S.93F=3A6
M]S3'`5Q]""I06#^"I@L8CS6<9AC3T,&BLBQK0"T7X15[#1M"Q<3SR0=>TXE=
M>!]=I+?8'XET?'J\*SB=80Q'H"OHM-\$W5[GK`&#TY]^"09G_4[[UP9XK@N'
M>%6+3G&I-'-J>D9M%2OR^90+D^243J5#%1N<G@1$J^F#?N=\T&D?'_<;X%#I
MX)5;QWJ*Y$^6#IW$=2EI2@/90IDFCDK#5VFH,FZ)A`?D<`0CF7+A.#D7R15G
M,8@1FET:JWKK!W5#UFZ/E@_:O=\K3L-PDHQO<;PH1DO7Z3+AL<K#T>\(RO=*
M@:O9L^#5KU4U(PZLF(6F:)P*AGP/O)4Q[A3&U7J[+AP=P:9?I=(.NOR/<!4-
MM"6O@URP"+/R6A6K-OH>5?O-<?"^TS]UZD4_$@G:!ITS%<B"&3LXS<!IM710
MNH^19][(%J>N8F,624=S#+KO.TA2]GSO_.2DO-:+@%0"E#Y?3'G><HI.YVQ%
M*<<-GC/Z<;<XS2MGZ<U1*[@_\$<FKF.(W<$L41VCNT2D.QYX*HO$6+S^`"M>
M\("@"BQVA"J+VFYA%+%B6SS23G7DF)>$)JXHBJ9Z(+<R]`U!I\+B:8"'%YZ!
M`9=IZ%0WB-YY:DUZG8XZ[O!<F[4W/KNSGEP,A=QU(.6ZJC/+&A&C&.4R3F^X
M9AW\?'X6](]_ZY=TE;==N,XGZS['F:O<U6!-]_V=_4]_!_^O4`<^GBS/*0"?
MT'_-`])\6O]Y!]X^Z;^]7:/_7@3?1/_ACN;I"NWW[Y6$7RX!_TN";L(F^#ET
MRL^2MRQTOH7&FFF][MNWIWW\*G0&G?Z[SC%L:BU947SPA.2SK9M1,F9?)]I4
M+54KTAM24K7;0\WJ0KT.2P.]T[/VNW;WQ%WZ."\(/NLJE2G$*9]]G$ED`*VR
MN:F2.H3E=)RE8FPWES5)%G+`\Q;2H>H0,=,C]U;[L@K2E'(-I%+DL!&K]IL5
M^3/ZXK,$_)/!/-1=2L+0LU/SFP=;'O[S:^X3G::E1,HY2=.O%/0%C:[Y8LG+
MS7B3)9(Y,P75Q/FTW9=HE-<JDKD*6RW"UDGN+NBM.(GY]Q*N4*:BDVX&6]&]
MMA<D5$5!W1=0&9-YQNDO!2.D#`P,#`P,#`P,#`P,#`P,#`P,#`P,%/X&P];[
%#``H``!!
`
end
Comment 1 assar freebsd_committer freebsd_triage 2001-06-16 04:13:46 UTC
I'm not able to reproduce your problem on either 4.3 RELEASE or
current 4.3-STABLE.  On both of these I get:

$ ./sockin 4711
./sockin: 127.0.0.1
close

(which I assume is the correct behaviour).

Could you give me more information to allow me to debug your problem?
Thanks.

/assar
Comment 2 assar freebsd_committer freebsd_triage 2001-06-16 04:22:24 UTC
State Changed
From-To: open->feedback

tried on 4.3 and 4.3-stable and send back mail to submitter for more details
Comment 3 proett 2001-06-19 20:30:52 UTC
On 16 Jun 2001, Assar Westerlund wrote:

> I'm not able to reproduce your problem on either 4.3 RELEASE or
> current 4.3-STABLE.  On both of these I get:
> 
> $ ./sockin 4711
> ./sockin: 127.0.0.1
> close
> 
> (which I assume is the correct behaviour).
> 
> Could you give me more information to allow me to debug your problem?
> Thanks.
> 
> /assar

Hi,

The problem occurs after some number of calls to sockout.  Here is
an example done on my machine.  The output of uname -a is:

FreeBSD mongo.pbspro.com 4.3-STABLE FreeBSD 4.3-STABLE #3: Thu May 10 16:27:47 PDT 2001     proett@mongo.pbspro.com:/usr/src/sys/compile/BONGO i386 

--- window 1 ---
mongo# ./sockout 4711
got port 1023
mongo# ./sockout 4711
got port 1023
mongo# ./sockout 4711
got port 1023
connect: Operation timed out
mongo# 
--- window 1 ---

--- window 2 ---
proett 1> ./sockin 4711
timeout
./sockin: 127.0.0.1
close
./sockin: 127.0.0.1
close
timeout
timeout
timeout
...
^C
proett 2> 
--- window 2 ---

The third call to sockout was not detected by sockin which continued
to periodicaly timeout until I hit ^C.  I ran netstat while it was in
this state and got:

tcp4       0      0  localhost.1023         localhost.4711         SYN_SENT
tcp4       0      0  localhost.4711         localhost.1023         TIME_WAIT


Tom Proett
Veridian Systems
PBSPro Development
650-967-4675 x233
Comment 4 Sheldon Hearn freebsd_committer freebsd_triage 2002-01-17 16:12:05 UTC
State Changed
From-To: feedback->closed

Automatic feedback timeout.  If additional feedback that warrants 
the re-opening of this PR is available but not included in the 
audit trail, please include the feedback in a reply to this message 
(preserving the Subject line) and ask that the PR be re-opened.