Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: fc40374925e9e8a65b1e0d6f4a503dde28adc3f1
Ticket: 714784ffffffffffffffffffffffffffffffffff
64 bit / thread configuration causes test failures
User & Date: lvirden on 2003-04-03 18:00:55
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Platform: SPARC Solaris 8 and Sun's C compiler
     Sun WorkShop 6 update 2 C 5.3 Patch 111679-08 2002/05/09
    Tcl: CVS Head snapshot from activestate ftp site, April
    3, 2003.
    
    configure --enable-shared --enable-symbols
    --prefix=/volws/lwv26/ldatae --enable-64bit
    --enable-threads
    
    If I configure with just enable 64bit or just threads,
    the test suite runs to completion with no errors.  With
    both, however, I get the following set of errors. 
    Since the errors seem to be related to configuration
    flags, it was suggested on the wiki chat that the
    report be filed as one report and let someone determine
    whether this is multiple bugs, or just one bug.
    
    
    http.test
    Test file error: invalid thread id
        while executing
    "testthread send $httpthread [list set port $port]"
        invoked from within
    "if {[info commands testthread] == "testthread" &&
    [file exists $httpdFile]} {
        set httpthread [testthread create "
            source [list $httpdFile]
            testt..."
        (file "/vol/tclsrcsol/tcl85/tcl/tests/http.test"
    line 59)
    
    socket.test
    
    ==== socket-2.3 tcp connection with client interface
    specified FAILED
    ==== Contents of test case:
    
        removeFile script
        set f [open $path(script) w]
        puts $f {
            set timer [after 2000 "set x done"]
            set f [socket  -server accept 2830]
            proc accept {file addr port} {
                global x
                puts "[gets $file] $addr"
                close $file
                set x done
            }
            puts ready
            vwait x
            after cancel $timer
            close $f
        }
        close $f
        set f [open "|[list [interpreter] $path(script)]" r]
        gets $f x
        if {[catch {socket -myaddr 127.0.0.1 127.0.0.1
    2830} sock]} {
            set x $sock
        } else {
            puts $sock hello
            flush $sock
            lappend x [gets $f]
            close $sock
        }
        close $f
        set x
    
    ---- Result was:
    ready {hello 0.0.0.0}
    ---- Result should have been (exact matching):
    ready {hello 127.0.0.1}
    ==== socket-2.3 FAILED
    ==== socket-7.1 testing socket specific options FAILED
    ==== Contents of test case:
    
        removeFile script
        set f [open $path(script) w]
        puts $f {
            set ss [socket -server accept 0]
            proc accept args {
                global x
                set x done
            }
            puts ready
            puts [lindex [fconfigure $ss -sockname] 2]
            set timer [after 10000 "set x timed_out"]
            vwait x
            after cancel $timer
        }
        close $f
        set f [open "|[list [interpreter] $path(script)]" r]
        gets $f
        gets $f listen
        set s [socket 127.0.0.1 $listen]
        set p [fconfigure $s -peername]
        close $s
        close $f
        set l ""
        lappend l [string compare [lindex $p 0] 127.0.0.1]
        lappend l [string compare [lindex $p 2] $listen]
        lappend l [llength $p]
    
    ---- Result was:
    -1 0 3
    ---- Result should have been (exact matching):
    0 0 3
    ==== socket-7.1 FAILED
    
    ==== socket-7.5 testing socket specific options FAILED
    ==== Contents of test case:
    
        set s [socket -server accept 0]
        proc accept {s a p} {
            global x
            set x [fconfigure $s -sockname]
            close $s
        }
        set listen [lindex [fconfigure $s -sockname] 2]
        set s1 [socket 127.0.0.1 $listen]
        set timer [after 10000 "set x timed_out"]
        vwait x
        after cancel $timer
        close $s
        close $s1
        set l ""
        lappend l [lindex $x 0] [expr {[lindex $x 2] ==
    $listen}] [llength $x]
    
    ---- Result was:
    0.0.0.0 1 3
    ---- Result should have been (exact matching):
    127.0.0.1 1 3
    ==== socket-7.5 FAILED
    
    ==== socket-13.1 Testing use of shared socket between
    two threads FAILED
    ==== Contents of test case:
    
        removeFile script
        threadReap
    
        makeFile {
            set f [socket -server accept 0]
            set listen [lindex [fconfigure $f -sockname] 2]
            proc accept {s a p} {
                fileevent $s readable [list echo $s]
                fconfigure $s -buffering line
            }
            proc echo {s} {
                 global i
                 set l [gets $s]
                 if {[eof $s]} {
                     global x
                     close $s
                     set x done
                 } else { 
                     incr i
                     puts $s $l
                 }
            }
            set i 0
            vwait x
            close $f
    
            # thread cleans itself up.
            testthread exit
        } script
        
        # create a thread
        set serverthread [testthread create { source script } ]
        update
        set port [testthread send $serverthread {set listen}]
        update
    
        after 1000
        set s [socket 127.0.0.1 $port]
        fconfigure $s -buffering line
    
        catch {
            puts $s "hello"
            gets $s result
        }
        close $s
        update
    
        after 2000
        lappend result [threadReap]
        
        set result
    
    ---- Result was:
    invalid thread id
    ---- Result should have been (exact matching):
    hello 1
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ==== socket-13.1 FAILED
    
    source.test
    split.test
    stack.test
    string.test
    stringComp.test
    stringObj.test
    subst.test
    switch.test
    tcltest.test
    thread.test
    
    ==== thread-1.13 Tcl_ThreadObjCmd: send args FAILED
    ==== Contents of test case:
    
        threadReap
        set serverthread [testthread create]
        set five [testthread send $serverthread {set x 5}]
        threadReap
        set five
    
    ---- Result was:
    invalid thread id
    ---- Result should have been (exact matching):
    5
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ==== thread-1.13 FAILED
    
    ==== thread-1.15 Tcl_ThreadObjCmd: wait FAILED
    ==== Contents of test case:
    
        threadReap
        set serverthread [testthread create {set z 5 ;
    testthread wait}]
        set five [testthread send $serverthread {set z}]
        threadReap
        set five
    
    ---- Result was:
    invalid thread id
    ---- Result should have been (exact matching):
    5
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ==== thread-1.15 FAILED
    
    ==== thread-3.1 TclThreadList FAILED
    ==== Contents of test case:
    
        threadReap
        catch {unset tid}
        set len [llength [testthread names]]
        set l1  {}
        foreach t {0 1 2} {
            lappend l1 [testthread create]
        }
        set l2 [testthread names]
        list $l1 $l2
        set c [string compare  [lsort -integer [concat
    $::tcltest::mainThread $l1]] 
     [lsort -integer $l2]]
        threadReap
        list $len $c
    
    ---- Result was:
    1 1
    ---- Result should have been (exact matching):
    1 0
    ==== thread-3.1 FAILED
    
    ==== thread-4.2 TclThreadSend -async FAILED
    ==== Contents of test case:
    
        threadReap
        set len [llength [testthread names]]
        set serverthread [testthread create]
        testthread send -async $serverthread {
            after 1000
            testthread exit
        }
        set two [llength [testthread names]]
        after 1500 {set done 1}
        vwait done
        threadReap
        list $len [llength [testthread names]] $two
    
    ---- Result was:
    invalid thread id
    ---- Result should have been (exact matching):
    1 1 2
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ==== thread-4.2 FAILED
    
    ==== thread-4.3 TclThreadSend preserve errorInfo FAILED
    ==== Contents of test case:
    
        threadReap
        set len [llength [testthread names]]
        set serverthread [testthread create]
        set x [catch {testthread send $serverthread {set
    undef}} msg]
        threadReap
        list $len $x $msg $errorInfo
    
    ---- Result was:
    1 1 {invalid thread id} {invalid thread id
        while executing
    "testthread send $serverthread {set undef}"}
    ---- Result should have been (exact matching):
    1 1 {can't read "undef": no such variable} {can't read
    "undef": no such variable
        while executing
    "set undef"
        invoked from within
    "testthread send $serverthread {set undef}"}
    ==== thread-4.3 FAILED
    
    ==== thread-4.4 TclThreadSend preserve code FAILED
    ==== Contents of test case:
    
        threadReap
        set len [llength [testthread names]]
        set serverthread [testthread create]
        set x [catch {testthread send $serverthread
    {break}} msg]
        threadReap
        list $len $x $msg $errorInfo
    
    ---- Result was:
    1 1 {invalid thread id} {invalid thread id
        while executing
    "testthread send $serverthread {break}"}
    ---- Result should have been (exact matching):
    1 3 {} {}
    ==== thread-4.4 FAILED
    
    ==== thread-4.5 TclThreadSend preserve errorCode FAILED
    ==== Contents of test case:
    
        threadReap
        set ::tcltest::mainThread [testthread names]
        set serverthread [testthread create]
        set x [catch {testthread send $serverthread {error
    ERR INFO CODE}} msg]
        threadReap
        list $x $msg $errorCode
    
    ---- Result was:
    1 {invalid thread id} NONE
    ---- Result should have been (exact matching):
    1 ERR CODE
    ==== thread-4.5 FAILED
    
    ==== thread-5.0 Joining threads FAILED
    ==== Contents of test case:
    
        threadReap
        set serverthread [testthread create -joinable]
        testthread send -async $serverthread {after 1000 ;
    testthread exit}
        set res [testthread join $serverthread]
        threadReap
        set res
    
    ---- Result was:
    invalid thread id
    ---- Result should have been (exact matching):
    0
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ==== thread-5.0 FAILED
    
    ==== thread-5.1 Joining threads after the fact FAILED
    ==== Contents of test case:
    
        threadReap
        set serverthread [testthread create -joinable]
        testthread send -async $serverthread {testthread exit}
        after 2000
        set res [testthread join $serverthread]
        threadReap
        set res
    
    ---- Result was:
    invalid thread id
    ---- Result should have been (exact matching):
    0
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ==== thread-5.1 FAILED
    
    ==== thread-5.2 Try to join a detached thread FAILED
    ==== Contents of test case:
    
        threadReap
        set serverthread [testthread create]
        testthread send -async $serverthread {after 1000 ;
    testthread exit}
        catch {set res [testthread join $serverthread]} msg
        threadReap
        lrange $msg 0 2
    
    ---- Result was:
    invalid thread id
    ---- Result should have been (exact matching):
    cannot join thread
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ==== thread-5.2 FAILED
    
    
    
    unixInit.test
    
    ==== unixInit-1.2 initialisation: standard channel type
    deduction FAILED
    ==== Contents of test case:
    
        # pipe1 is a connection to a server that reports
    what port it
        # starts on, and delivers a constant string to the
    first client to
        # connect to that port before exiting.
        set pipe1 [open "|[list [interpreter]]" r+]
        puts $pipe1 {
            proc accept {channel host port} {
                puts $channel {puts [fconfigure stdin
    -peername]; exit}
                close $channel
                exit
            }
            puts [fconfigure [socket -server accept 0]
    -sockname]
            vwait forever  }
        # Note the backslash above; this is important to
    make sure that the
        # whole string is read before an [exit] can happen...
        flush $pipe1
        set port [lindex [gets $pipe1] 2]
        set sock [socket localhost $port]
        # pipe2 is a connection to a Tcl interpreter that
    takes its orders
        # from the socket we hand it (i.e. the server we
    create above.)
        # These orders will tell it to print out the
    details about the
        # socket it is taking instructions from, hopefully
    identifying it
        # as a socket.  Which is what this test is all about.
        set pipe2 [open "|[list [interpreter] <@$sock]" r]
        set result [gets $pipe2]
    
        # Clear any pending data; stops certain kinds of
    (non-important) errors
        fconfigure $pipe1 -blocking 0; gets $pipe1
        fconfigure $pipe2 -blocking 0; gets $pipe2
    
        # Close the pipes and the socket.
        close $pipe2
        close $pipe1
        catch {close $sock}
    
        # Can't use normal comparison, as hostname varies
    due to some
        # installations having a messed up /etc/hosts file.
        if {
            [string equal 127.0.0.1 [lindex $result 0]] &&
            [string equal $port     [lindex $result 2]]
        } then {
            subst "OK"
        } else {
            subst "Expected: `[list 127.0.0.1 localhost
    $port]', Got `$result'"
        }
    
    ---- Result was:
    Expected: `127.0.0.1 localhost 62598', Got `0.0.0.0
    localhost 62598'
    ---- Result should have been (exact matching):
    OK
    ==== unixInit-1.2 FAILED
    
    
    
    
    
    
  4. foundin changed to: "obsolete: 8.5a0"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "lvirden"
  9. subsystem changed to: "None"
  10. title changed to: "64 bit / thread configuration causes test failures"
  11. type changed to: "Bug"