Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-03
06:23 • Ticket [219121ffff] fcopy alters blocking state status still Closed with 3 o... artifact: 92bfa69b7f user: dgp
2000-10-26
08:34 • Closed ticket [219121ffff]. artifact: 9b8ba62b93 user: welch
01:11 • New ticket [219121ffff]. artifact: 7a204dae86 user: nobody

fcopy alters blocking state

Closed / Fixed219121ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:11:05
OriginalBugID: 6261 Bug
Version: 8.3.2
SubmitDate: '2000-09-13'
LastModified: '2000-09-27'
Severity: SER
Status: Released
Submitter: techsupp
ChangedBy: hobbs
OS: All Unix
Machine: intel linux
FixedDate: '2000-09-27'
FixedInVersion: 8.4a2
ClosedDate: '2000-10-25'


Name:
Fustaf Neumann

ReproducibleScript:
Hi folks, 

It looks to me as if there is a bug in the fcopy command
in Tcl 8.3.2, which was not there in 8.0.5. fcopy changes
the buffering state of a channel to 1 in the new version.
The script below returns the following results for different
Tcl versions:

Results in Tcl 8.0.5
  START: blocking(file3) 0
  FCOPY: blocking(file3) 0
  DONE: blocking(file3) 0       

Results in Tcl 8.3.2
  START: blocking(file3) 0
  FCOPY: blocking(file3) 0
  DONE: blocking(file3) 1

Best  regards
-gustaf
================================================
proc stat where {
  puts stderr "  $where: blocking($::out) [fconfigure $::out -blocking]"
}
proc done {args} {
  stat DONE
  close $::in
}

puts stderr "Results in Tcl $tcl_patchLevel"
set out [open /dev/null w]
fconfigure $out -blocking 0
stat START

set in [open fcopy-bug r]
fcopy $in $out -command done

stat FCOPY

catch {vwait forever}

ObservedBehavior:
fcopy changes blocking state

DesiredBehavior:
results in Tcl 8.3.2 should be the same as in earlier releases, e.g. fcopy should not
alter blocking state.



This was introduced by a partial fix (exposing another bug) in

8.3.2.  tclIO.c:StopCopy was not reseting the nonBlocking flag

when resetting the flags for the write side.



     if (csPtr->readPtr != csPtr->writePtr) {

+      nonBlocking = (csPtr->writeFlags & CHANNEL_NONBLOCKING);

       if (nonBlocking != (outStatePtr->flags & CHANNEL_NONBLOCKING)) {

 

-- 09/27/2000 hobbs
welch Closed ticket [219121ffff]. [History diff]2000-10-26 08:34:57
dgp Ticket [219121ffff]: 3 changes [History diff]2001-04-03 06:23:16
Log in (anonymous is fine) to add a comment.