Skip to content
Tcl Source Code View Ticket
Login

View Ticket

segfault in CreateClientSocket?

Closed / Fixed3093120fffffffffffffffffffffffffffffffffCreated 16 years agoUpdated 16 years ago
Descriptionplain2010-10-22 17:21:05
Platform: SPARC SunOS 5.9
Tcl cvs head, downloaded from activestate ftp site.
./configure --prefix=/projects/sprs_lwv/tcl86 --enable-shared --enable-symbols --enable-stubs --enable-threads

$ make all test install

:
:

http.test
Running httpd in thread 3
Test file error: child killed: segmentation violation
dgpplain2010-10-27 00:24:22
Which test triggers the segfault?
lvirdenplain2010-10-27 21:53:40
What you see there is what I see in the make test output. It is also what I see if I try to run just that one file.  I don't see anything in unix/README or tests/README about getting more verbose output from the test suite - iis there a flag needed?
ferrieuxplain2010-10-27 22:48:39
To run just one test file *and* print the names of the individual tests as they are run:

   make test TESTFLAGS="-verbose t -f $name.test"
lvirdenplain2010-10-27 23:43:06
So, using
make test TESTFLAGS="-verbose t -f $name.test"
I see:
Tests running in interp:  /vol/tclsrcsol/tcl86/tcl/unix/tcltest
Tests located in:  /vol/tclsrcsol/tcl86/tcl/tests
Tests running in:  /vol/tclsrcsol/tcl86/tcl/unix
Temporary files stored in /vol/tclsrcsol/tcl86/tcl/unix
Test files run in separate interpreters
Running tests that match:  *
Skipping test files that match:  l.*.test
Only running test files that match:  http.test
Tests began at Wed Oct 27 12:38:07 EDT 2010
http.test
Running httpd in thread 3
---- http-1.1 start
---- http-1.2 start
---- http-1.3 start
---- http-1.4 start
---- http-1.5 start
---- http-1.6 start
---- http-2.1 start
---- http-3.1 start
---- http-3.2 start
---- http-3.3 start
---- http-3.4 start
---- http-3.5 start
---- http-3.6 start
---- http-3.7 start
---- http-3.8 start
---- http-3.9 start
---- http-3.10 start
---- http-3.11 start
---- http-3.13 start
---- http-3.14 start
---- http-3.15 start
---- http-3.16 start
---- http-3.17 start
---- http-3.18 start
---- http-3.19 start
---- http-3.20 start
---- http-3.21 start
---- http-3.22 start
---- http-3.23 start
---- http-3.24 start
---- http-3.25 start
---- http-3.26 start
---- http-4.1 start
---- http-4.2 start
---- http-4.3 start
---- http-4.4 start
---- http-4.5 start
---- http-4.6 start
---- http-4.7 start
---- http-4.8 start
---- http-4.9 start
---- http-4.10 start
---- http-4.11 start
---- http-4.12 start
---- http-4.13 start
---- http-4.14 start
---- http-4.15 start
Test file error: child killed: segmentation violation

Tests ended at Wed Oct 27 12:38:10 EDT 2010
all.tcl:        Total   0       Passed  0       Skipped 0       Failed  0
Sourced 1 Test Files.

Test files exiting with errors:  

  http.test


So since I see tests AFTER http-4.15, it may be the issue.  While I don't believe we use a proxy server here, I do know there are firewalls, etc.

I wouldn't think that a proxy should result in a segmentation error though.
Here's the core dump stack trace:

srv19 (133) $ dbx tcltest core
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 7.0' in your .dbxrc
Reading tcltest
core file header read successfully
Reading ld.so.1
Reading libtcl8.6.so
Reading libdl.so.1
Reading libsocket.so.1
Reading libnsl.so.1
Reading libpthread.so.1
Reading libm.so.1
Reading libc.so.1
Reading libmp.so.2
Reading libc_psr.so.1
Reading libthread.so.1
detected a multithreaded program
t@1 (l@1) terminated by signal SEGV (no mapping at the fault address)
0xff384880: freeaddrinfo+0x0004:        ld      [%i0 + 0x1c], %l1
Current function is CreateClientSocket
  975       freeaddrinfo(addrlist);
(dbx 1) where                                                         
current thread: t@1
  [1] freeaddrinfo(0x0, 0xffbfda2c, 0x442660, 0x50, 0x0, 0xffbfda18), at 0xff384880
=>[2] CreateClientSocket(interp = 0x84fb8, port = 80, host = 0x442660 "not_a_host.tcl.tk", myaddr = (nil), myport = 0, async = 1), line 975 in "tclUnixSock.c"
  [3] Tcl_OpenTcpClient(interp = 0x84fb8, port = 80, host = 0x442660 "not_a_host.tcl.tk", myaddr = (nil), myport = 0, async = 1), line 1040 in "tclUnixSock.c"
  [4] Tcl_SocketObjCmd(notUsed = (nil), interp = 0x84fb8, objc = 4, objv = 0x8c9bc), line 1606 in "tclIOCmd.c"
  [5] NRRunObjProc(data = 0x102174, interp = 0x84fb8, result = 0), line 4371 in "tclBasic.c"
  [6] TclNRRunCallbacks(interp = 0x84fb8, result = 0, rootPtr = (nil)), line 4318 in "tclBasic.c"
  [7] Tcl_EvalObjv(interp = 0x84fb8, objc = 13, objv = 0x8c0e0, flags = 2097152), line 4108 in "tclBasic.c"
  [8] TclEvalEx(interp = 0x84fb8, script = 0xdab40 "# Commands covered:  http::config, http::geturl, http::wait, http::reset\n#\n# This file contains a collection of tests for the http script library.\n# Sourcing this file into Tcl runs the tests and generates output for errors.\n# No output means no errors were found.\n#\n# Copyright (c) 1991-1993 The Regents of the University of California.\n# Copyright (c) 1994-1996 Sun Microsystems, Inc.\n# Copyright (c) 1998-2000 by Ajuba Solutions.\n#\n# See the file "license.terms" for information on usage and redistribution of" ..., numBytes = 19475, flags = 0, line = 518, clNextOuter = (nil), outerScript = 0xdab40 "# Commands covered:  http::config, http::geturl, http::wait, http::reset\n#\n# This file contains a collection of tests for the http script library.\n# Sourcing this file into Tcl runs the tests and generates output for errors.\n# No output means no errors were found.\n#\n# Copyright (c) 1991-1993 The Regents of the University of California.\n# Copyright (c) 1994-1996 Sun Microsystems, Inc.\n# Copyright (c) 1998-2000 by Ajuba Solutions.\n#\n# See the file "license.terms" for information on usage and redistribution of" ...), line 5222 in "tclBasic.c"
  [9] Tcl_EvalEx(interp = 0x84fb8, script = 0xdab40 "# Commands covered:  http::config, http::geturl, http::wait, http::reset\n#\n# This file contains a collection of tests for the http script library.\n# Sourcing this file into Tcl runs the tests and generates output for errors.\n# No output means no errors were found.\n#\n# Copyright (c) 1991-1993 The Regents of the University of California.\n# Copyright (c) 1994-1996 Sun Microsystems, Inc.\n# Copyright (c) 1998-2000 by Ajuba Solutions.\n#\n# See the file "license.terms" for information on usage and redistribution of" ..., numBytes = 19475, flags = 0), line 4878 in "tclBasic.c"
  [10] Tcl_FSEvalFileEx(interp = 0x84fb8, pathPtr = 0x8b588, encodingName = (nil)), line 1753 in "tclIOUtil.c"
  [11] Tcl_Main(argc = -1, argv = 0xffbfe424, appInitProc = 0x175c0 = &Tcl_AppInit(Tcl_Interp *interp)), line 399 in "tclMain.c"
  [12] main(argc = 36, argv = 0xffbfe394), line 80 in "tclAppInit.c"

Platform is SunOS 5.9, compiled with Sun's c compiler, using Tcl 8.6 cvs head from today.
Configured as
./configure --prefix=/projects/sprs_lwv/tcl86 --enable-shared --enable-symbols --enable-stubs --enable-threads
dgpplain2010-10-28 22:00:01
Please use the option "-match http-4.15" to 
confirm it is exactly that test causing the segfault.
dgpplain2010-10-28 22:04:39
stack trace points into unix socket code

so far I've heard of no one reproducing
the report.
dgp Ticket [3093120fff]: 1 change [History diff]2010-10-28 22:06:57
dgpplain2010-10-28 22:35:47
Good news!  I located a Solaris system and
reproduced the crash.
dgpplain2010-10-28 22:48:17
Looking likely the 2010-10-12 commit
is to blame
dgpplain2010-10-28 23:06:13
problem appears to be that freeaddrinfo(NULL)
is not tolerated by Solaris.
dgpplain2010-10-28 23:23:00
allow_comments - 1


The obvious NULL protection solves the crash.
Log in (anonymous is fine) to add a comment.