Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f899b3ade9c9744a4b22bf31342850af2d928d64
Ticket: 4f51fb37428603a028f505129f6978c2445fbc08
`Expect' memory faults upon issuing `c'
User & Date: anonymous on 2015-07-12 18:37:38
Changes

  1. comment changed to:
    as advised on comp.lang.tcl I issue this bug report,  happens with Expect 5.45.3  under macosx 10.10.3: 
    
    I want to use `expect' as an interactive debugger for a very modest tcl script. running the script either via `/usr/bin/env expect -D 1' or by adding somewhere a `debug 1' to the script and loading the Expect package from within `tclsh' and sourcing the script  from within tclsh initially does the expected (...), i.e. I get the `dbg' prompt of `Expect'.  simple things (looking at variables, single-stepping, etc. work). but as soon as I issue `c' there is a short, notable delay (somewhat larger than usual runtime of the script I'd say) followed by a memory fault. 
    
    the problem is most easily reproduced by running the script (called "breakdown" for totally unrelated reasons ;-) like
     
        expect -D 1 breakdown
        c  #(issued at the dbg prompt)
    
    this triggers the memfault each and every time on my machine.
    
    the script does nothing fancy. it uses 
    
     namespace path {::tcl::mathop} 
     package require cmdline 
    
    otherwise it's "vanilla tcl" (making some use of `clock')
    
    I have attached the affected script plus some small required data files read by the script as a tarfile.
    
  2. icomment:
    I have tried to find out where approximately the problem occurs. so far I can only state:
    
    it happens in procedure `getLimits'. if this proc is bypassed (by providing a valid value for its return argument so that the script can proceed) the memfault does not occur. it also does not occur if only a _single_ data file (not necessarily the first one) is processed. so editing the `set databases {d1 d2 d3 d4}'
    line at the end of the script accordingly (e.g. `set databases d2') the memfault after issuing `c' from within the expect debugger does also not occur.
    
    so only if  a second call to `getLimits' occurs the memfault is triggered (it also seems that in this case the memfault occurs immediately at time of the second call and nothing more is executed).
    
    I would suspect that it has to do with the use of the `clock' command but this is only a wild guess. not sure whether this is helpful ...
    
  3. login: "anonymous"
  4. mimetype: "text/plain"