Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 640d3947f07149b217bd178248a8efb36415a9e0
Ticket: 613117ffffffffffffffffffffffffffffffffff
Memory corruption (in expr?)
User & Date: jkbonfield on 2002-09-23 23:24:32
Changes

  1. icomment:
    Logged In: YES 
    user_id=154581
    
    It's not a memory corruption, but a sprintf format bug. The
    TCL_LL_MODIFIER gets set to ll, which leads to a sprintf of 
    %lld and this in turn leads to printing up of "ld" (as Digital Unix 
    does not support this,  and neither does it support lltostr).
    
    Digital Unix, running on an Alpha, has long as 64bits. %d is for 
    32-bit integers and %ld for l64-bit longs. This is the nice and 
    easy case, which other OSes have broken away from with 
    their long long hacks. I need to figure out why the automatic 
    type detection in tcl.h is chosing the wrong macro, but once 
    I've done that I'll submit a patch for testing (I cannot test it on 
    linux/alpha).
    
    What I cannot figure out from all this is quite how come this 
    bug required the black magic invocations I listed at the start to 
    trigger it. Clearly calling double(150) causes a 64-bit version 
    of the number and a removal of the string-format copy, but I 
    cannot see why this is dependant on 150 being used in an 
    argument to grid! Anyway, I'm pleased to finally get 
    somewhere with this rather bizarre bug!
    
    James
    
    
    
  2. login: "jkbonfield"
  3. mimetype: "text/plain"
  4. username: "jkbonfield"