Skip to content
Tcl Source Code View Ticket
Login

View Ticket

crash in Tcl_OpenTcpServer() on Windows

Closed / Fixed2538f373ffc78d6dba9c3d973c147a84fdd9bbd8Created 11 years agoUpdated 11 years ago
Descriptionplain2016-04-06 23:36:35
Windows only:
If Tcl_OpenTcpServer() is the very first Socket call, then the thread data is not set correctly resulting in a crash.  Found in an embedded application.  Not reproducible via tclsh.

tclWinSock.c:
  2064      ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey);
  2065  
  2066      if (TclpHasSockets(interp) != TCL_OK) {
  2067  	return NULL;
  2068      }

The order above, KeyGet followed by HasSocket, is backwards.

that's a week of my life I'll never get back :)
Referenced by2
oehharwiki2016-04-07 21:43:55

Thank you Brian. I will look into that next week when I am back in the office.

- Harald

jan.nijtmansplain2016-04-08 13:32:57
Fixed in core-8-6-branch and trunk (didn't find this in core-8-5-branch). Thanks! Good catch!
jan.nijtmans Closed ticket [2538f373ff]. [History diff]2016-04-08 13:33:42
Log in (anonymous is fine) to add a comment.