#4852 segfaulting tests

obsolete: 8.6b1.1
closed-fixed
9
2014-08-28
2011-07-12
Don Porter
No

Starting with the 2011-06-22 commit [8eefe5a06f]
a --enable-symbols=all build of Tcl exhibits these
test failures:

$ make test TESTFLAGS="-file chanio.test"
...
==== chan-io-28.7 Tcl_CloseEx (half-close) socket FAILED
==== Contents of test case:

set ff [openpipe r $echo]
gets $ff port
set s [socket 127.0.0.1 $port]
puts $s Hey
close $s w
set timer [after 1000 [namespace code {set ::done Failed}]]
set acc {}
fileevent $s readable [namespace code {
if {[gets $s line]<0} {
set done Succeeded
} else {
lappend acc $line
}
}]
vwait [namespace which -variable done]
after cancel $timer
close $s r
close $ff
list $done $acc

---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
---- errorInfo: child killed: segmentation violation
while executing
"close $ff"
("uplevel" body line 19)
invoked from within
"uplevel 1 $script"
---- errorCode: CHILDKILLED 13540 SIGSEGV {segmentation violation}
==== chan-io-28.7 FAILED

==== chan-io-53.10 Bug 1350564, multi-directional fcopy FAILED
==== Contents of test case:

# Now pass data through the server in both directions.
set ::forever {}
chan puts $a AB
vwait ::forever
chan puts $b BA
vwait ::forever
set ::forever

---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
---- errorInfo: error writing "sock8d11700": broken pipe
while executing
"chan puts $a AB"
("uplevel" body line 4)
invoked from within
"uplevel 1 $script"
---- errorCode: POSIX EPIPE {broken pipe}
---- Test cleanup failed:
child killed: segmentation violation
---- errorInfo(cleanup): child killed: segmentation violation
while executing
"chan close $pipe"
("uplevel" body line 4)
invoked from within
"uplevel 1 $cleanup"
---- errorCode(cleanup): CHILDKILLED 13618 SIGSEGV {segmentation violation}
==== chan-io-53.10 FAILED

This is on a 32-bit Centos 5.6 Linux system.
I believe it has no IPv6 support, but I'll take any
instructions on how to confirm that definitely.

Discussion

  • Don Porter

    Don Porter - 2011-07-12

    Other test suite failures in that config since that commit:

    ==== http-4.14 http::Event FAILED
    ==== Contents of test case:

    set token [http::geturl $badurl/?timeout=10 -timeout 10000 -command \#]
    if {$token eq ""} {
    error "bogus return from http::geturl"
    }
    http::wait $token
    http::status $token
    # error code varies among platforms.

    ---- Test completed normally; Return code was: 0
    ---- Return code should have been one of: 1
    ==== http-4.14 FAILED

    Test file error: low guard byte 0 is 0x0
    low guard byte 1 is 0x0
    low guard byte 2 is 0x0
    low guard byte 3 is 0x0
    low guard byte 4 is 0x0
    low guard byte 5 is 0x0
    low guard byte 6 is 0x0
    low guard byte 7 is 0x0
    total mallocs 579887
    total frees 533665
    current packets allocated 46222
    current bytes allocated 2268195
    maximum packets allocated 47140
    maximum bytes allocated 2910895
    low guard failed at 61616161, /home/dgp/fossil/tcl/unix/tclUnixSock.c 548
    0 bytes allocated at ((null) 0)
    Memory validation failure

    httpold.test
    Test file error: child killed: segmentation violation

    ==== io-53.10 Bug 1350564, multi-directional fcopy FAILED
    ==== Contents of test case:

    # Now pass data through the server in both directions.
    set ::forever {}
    puts $a AB
    vwait ::forever
    puts $b BA
    vwait ::forever
    set ::forever

    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: error writing "sock916d6e8": broken pipe
    while executing
    "puts $a AB"
    ("uplevel" body line 4)
    invoked from within
    "uplevel 1 $script"
    ---- errorCode: POSIX EPIPE {broken pipe}
    ---- Test cleanup failed:
    child killed: segmentation violation
    ---- errorInfo(cleanup): child killed: segmentation violation
    while executing
    "close $pipe"
    ("uplevel" body line 4)
    invoked from within
    "uplevel 1 $cleanup"
    ---- errorCode(cleanup): CHILDKILLED 25221 SIGSEGV {segmentation violation}
    ==== io-53.10 FAILED

    socket.test
    Test file error: child killed: segmentation violation

     
  • Don Porter

    Don Porter - 2011-07-12

    Much simpler interactive demo:

    $make gdb
    ...
    (gdb) run
    Starting program: /home/dgp/fossil/tcl/unix/tclsh
    [Thread debugging using libthread_db enabled]
    [New Thread 0x4043cb90 (LWP 27098)]
    % socket -server foo 0; exit

    Program received signal SIGSEGV, Segmentation fault.
    0x080f4db7 in ValidateMemory (memHeaderP=0x61616141,
    file=0x81b42c8 "/home/dgp/fossil/tcl/unix/tclUnixSock.c", line=548,
    nukeGuards=1) at /home/dgp/fossil/tcl/generic/tclCkalloc.c:235
    235 byte = *(memHeaderP->low_guard + idx);

     
  • Don Porter

    Don Porter - 2011-07-12

    Shifting over the bisect to the rmax-ipv6-branch,
    the segfaults start with the 2011-06-07 commit [5f816f5758]

     
  • Don Porter

    Don Porter - 2011-07-12

    Testing this patch:

    Index: unix/tclUnixSock.c

    --- unix/tclUnixSock.c
    +++ unix/tclUnixSock.c
    @@ -542,12 +542,14 @@
    if (close(fds->fd) < 0) {
    errorCode = errno;
    }

    }
    - for (fds = statePtr->fds.next; fds != NULL; fds = fds->next) {
    + for (fds = statePtr->fds.next; fds != NULL; /*fds = fds->next*/) {
    + TcpFdList *next = fds->next;
    ckfree(fds);
    + fds = next;
    }
    if (statePtr->addrlist != NULL) {
    freeaddrinfo(statePtr->addrlist);
    }
    if (statePtr->myaddrlist != NULL) {

     
  • Don Porter

    Don Porter - 2011-07-12
    • assigned_to: rmax --> dgp
    • status: open --> closed-fixed
     
  • Don Porter

    Don Porter - 2011-07-12

    Converted patch's 'for' to a 'while' and committed to trunk.

     
  • Reinhard Max

    Reinhard Max - 2011-07-12

    Thanks, Don for finding and fixing this.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks