uninitialized bytes in http11-1.13.0
Closed / Fixedb4af93cd9f5ccb360167005b9637f89c335d309aCreated 4 years agoUpdated 4 years ago
Descriptionplain2023-03-06 17:30:50
valgrind run reports uninitialized bytes usage in http11-1.13.0: ==26164== Syscall param socketcall.getsockopt(optlen) points to uninitialised byte(s) ==26164== at 0x586E8EA: getsockopt (in /usr/lib64/libc-2.17.so) ==26164== by 0x5D4D28: TcpGetOptionProc (tclUnixSock.c:1045) ==26164== by 0x5468A6: Tcl_GetChannelOption (tclIO.c:8144) ==26164== by 0x54D074: Tcl_FconfigureObjCmd (tclIOCmd.c:785) ==26164== by 0x434E1F: Dispatch (tclBasic.c:4997) ==26164== by 0x434EA7: TclNRRunCallbacks (tclBasic.c:5037) ==26164== by 0x434773: Tcl_EvalObjv (tclBasic.c:4756) ==26164== by 0x436DD5: TclEvalEx (tclBasic.c:5913) ==26164== by 0x559F7D: Tcl_FSEvalFileEx (tclIOUtil.c:1782) ==26164== by 0x5669A6: Tcl_MainEx (tclMain.c:405) ==26164== by 0x410188: main (tclAppInit.c:94) ==26164== Address 0x1ffeffe6bc is on thread 1's stack ==26164== in frame #1, created by TcpGetOptionProc (tclUnixSock.c:900)
Referenced by3
972b6a856aMerge trunk 1997f71246: Fix [b4af93cd9f]: uninitialized bytes in http11-1.13.0. check-in2023-03-22 16:51:172dff4cb44bFix [b4af93cd9f]: uninitialized bytes in http11-1.13.0 check-in2023-03-07 20:09:30cb97451374[b4af93cd9f] Proposed fix from apnadkarni. It works! check-in2023-03-06 18:17:19
dgpplain2023-03-06 17:34:18
Very likely same issue exposed by test socket_inet-7.3: ==26857== Syscall param socketcall.getsockopt(optlen) points to uninitialised byte(s) ==26857== at 0x586E8EA: getsockopt (in /usr/lib64/libc-2.17.so) ==26857== by 0x5D4D28: TcpGetOptionProc (tclUnixSock.c:1045) ==26857== by 0x5468A6: Tcl_GetChannelOption (tclIO.c:8144) ==26857== by 0x54D074: Tcl_FconfigureObjCmd (tclIOCmd.c:785) ==26857== by 0x434E1F: Dispatch (tclBasic.c:4997) ==26857== by 0x434EA7: TclNRRunCallbacks (tclBasic.c:5037) ==26857== by 0x434773: Tcl_EvalObjv (tclBasic.c:4756) ==26857== by 0x436DD5: TclEvalEx (tclBasic.c:5913) ==26857== by 0x559F7D: Tcl_FSEvalFileEx (tclIOUtil.c:1782) ==26857== by 0x5669A6: Tcl_MainEx (tclMain.c:405) ==26857== by 0x410188: main (tclAppInit.c:94) ==26857== Address 0x1ffeffe70c is on thread 1's stack ==26857== in frame #1, created by TcpGetOptionProc (tclUnixSock.c:900)
apnadkarnimarkdown2023-03-06 17:57:50
Most likely because size needs to be initialized to sizeof(opt) before the call to getsockopt on line 1045.
dgpplain2023-03-06 18:18:31
Thanks. That does seem to fix it. Fix committed to a branch. If it looks ok to you, either merge it, or tell me I should merge it.
apnadkarniplain2023-03-07 01:41:05
Please go ahead and merge it. Thanks
jan.nijtmanswiki2023-03-07 20:11:09
Fixed [here]
dgpplain2023-03-08 13:42:04
Thanks!
Log in (anonymous is fine) to add a comment.