Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d66bf909629d7968131f1ca31b8fe19242b8e3bf7001df7fce71b93977a0acc9
Ticket: 52dbc4b3f8ef52c40eb8dd2080c5de48a14cd49c
tclInterp.c: Tcl_Free() called through pointer of incorrect type
User & Date: chrstphrchvz on 2023-10-13 08:35:33
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    <tt>Tcl_Free()</tt> is not a <tt>Tcl_LimitHandlerDeleteProc</tt>. Nothing in core Tcl calls <tt>Tcl_LimitAddHandler()</tt> with <tt>TCL_DYNAMIC</tt> as the <tt>deleteProc</tt>, but I predict that doing so would cause UBSan <tt>-fsanitize=function</tt> errors with the following:
    
    <pre>
    <span style="font-weight:bold"><span style="color:firebrick">runtime error:</span> call to function TclpFree through pointer to incorrect function type 'void (*)(void *)'</span>
    </pre>
    
    A workaround would be to use a wrapper function; see attached patch.
    
  5. foundin changed to: "8.6.13"
  6. is_private changed to: "0"
  7. login: "chrstphrchvz"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "6133eb3026f9b10aa9b7b48da92ae2834fc225b0"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "chrstphrchvz"
  14. subsystem changed to: "20. [interp]"
  15. title changed to:
    tclInterp.c: Tcl_Free() called through pointer of incorrect type
    
  16. type changed to: "Bug"