Skip to content
Tcl Source Code Artifact [85f464e311]
Login

Artifact [85f464e311]

Artifact 85f464e311d32ca5be6d12a992985b0c0e5c951a:

Ticket change [85f464e311] - New ticket [1618235fffffffff|1618235fff] <i>http.test-4.15 http::Event FAILED</i>. by nobody on 2006-12-18 16:41:14.
D 2006-12-18T16:41:14
J assignee hobbs
J cmimetype text/plain
J comment Tcl\s8.4.14\n\nSuse\sLinux\s9.2\s(running\sas\sa\sVMware\sWorkstation\s5.5.3\sguest\sOS\son\sa\sWindows\sXP\sService\sPack\s2\shost\sOS).\n\n>\s./configure\s--enable-threads\n>\smake\n>\smake\stest\n...\n====\shttp-4.15\shttp::Event\sFAILED\n...\n----\sResult\swas:\n1\s0\n----\sResult\sshould\shave\sbeen\s(exact\smatching):\n11\n\nWhen\srunning\s"make\stest"\swith\sthreads\senabled\s(i.e.\scompiled\swith\s"-DTCL_THREADS=1\s-DHAVE_GETHOSTBYNAME_R_6=1"),\sI\sget\sthe\sabove\stest\sfailure.\s\sThis\sdoes\snot\shappen\swith\sTcl\s8.5a6,\sas\sI'll\sexplain\slater.\n\nThe\sproblem\sappears\sto\sstem\sfrom\sthe\sbehavior\sof\sgethostbyname_r()\s(see\stcl/unix/tclUnixCompat.c\sline\s589).\s\sFor\smy\sversion\sof\sLinux\s(Suse\s9.2),\sgethostbyname_r()\sreturns\s0\sfor\sboth\svalid\sand\sinvalid\sURL's.\s\sHowever,\sthe\sfifth\sparameter\s(struct\shostent\s**RESULT)\sreturns\sa\sNULL\sfor\sinvalid\sURL's.\s\sTherefore,\sa\spotential\sfix\swould\sbe\sto\schange\s"&tsdPtr->hent"\son\sline\s591\sto\suse\sthe\svalue\sreturned\sby\sthe\sfifth\sparameter\s"hePtr",\se.g.:\n\nreturn\s(gethostbyname_r(name,\s&tsdPtr->hent,\ststPtr->hbuf,\n\s\s\s\s\s\ssizeof(tsdPtr->hbuf),\s&hePtr,\s&h_errno)\s==\s0)\s?\n\s\s\s\s&tsdPtr->hent\s:\sNULL;\n\nshould\sbe:\n\nreturn\s(gethostbyname_r(name,\s&tsdPtr->hent,\ststPtr->hbuf,\n\s\s\s\s\s\ssizeof(tsdPtr->hbuf),\s&hePtr,\s&h_errno)\s==\s0)\s?\n\s\s\s\shePtr\s:\sNULL;\n\nThis\sproblem\soccurs\sin\sTcl\s8.4.14\swhen\sthreads\sare\senabled\sbecause\stcl/unix/tclUnixChan.c:CreateSocketAddress()\sinvokes\sthe\ssupposedly\sthread-safe\sfunction\stcl/unix/tclUnixCompat.c:TclpGetHostByName(),\swhich\sthen\sinvokes\sgethostbyname_r()\sif\sHAVE_GETHOSTBYNAME_R_6\sis\sdefined.\n\nThis\sproblem\sdoes\snot\soccur\sin\sTcl\s8.5a6\sbecause\stclUnixChan.c:CreateSocketAddress()\swas\smodified\sto\scall\sthe\spotentially\sthread-unsafe\sgethostbyname()\sfunction,\swhich\smay\sbe\sanother\sproblem.\n\nLarry\sWright\[email protected]\n
J foundin obsolete:\s8.4.14
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 29.\shttp\sPackage
J title http.test-4.15\shttp::Event\sFAILED
J type Bug
K 1618235fffffffffffffffffffffffffffffffff
U nobody
Z 4016fbae9237af4555a8109161942f6f