Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: fbc5e7ac55a25364d57129ffa7d0a7b11e1e5f1d
Ticket: 1298158fffffffffffffffffffffffffffffffff
Reading translation causes event failure?
User & Date: billposer on 2005-09-21 21:29:33
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    I have encountered what is probably the weirdest bug that 
    I have ever seen. I have a little color chooser that I wrote 
    recently because none of the ones available did quite what 
    I wanted. One of its features is that you can ask it to propose 
    a random color. Another is that you can ask it to find the 
    named color that is closest to the current color. 
     
    When you ask for a random color, it shows it in the lower 
    of two example slots. If you then ask for the closest named 
    color, the random color is moved into the upper example slot 
    and the named color is shown in the lower one. In general, 
    the two will not be identical since there are far more 
    possible colors than named colors. 
     
    The bug arises when a message translation is read 
    (that is, when msgcat::mcget is executed and finds 
    a tranlsation in the message catalogue. 
    (Loading a message catalog is not sufficient to trigger the bug.) 
    When  
     
    When I do, the color chooser always shows the random color 
    as agreeing perfectly with some named color. 
    A little investigation shows that what is actually 
    happening is that the primary example is being copied 
    into the secondary example slot, as it should, but is 
    then not being updated with the color of the closest 
    named color. So the two identical colors shown are 
    the random color, not the closest named color. 
    It turns out that SetColor is not being called 
    in response to the ButtonPress-1 event generated 
    at the end of ShowEntry. 
     
    I have succeeded in constructing a version of the 
    program from which I have stripped as much as I 
    can without eliminating the bug, and a version 
    that eliminates the bug. They differ by the single 
    line: 
     
    pack .srch.search -side left -expand 1 -fill x -anchor e  -padx 4; 
     
    As far as I can see, there is nothing wrong with this line, 
    or with anything else in the Tcl code. I am wondering 
    whether I have managed to trigger an obscure memory 
    allocation bug. 
     
    This is with Tcl/Tk 8.4.11 on GNU/Linux 2.6.3-7 with Gnome.. 
     
    To reproduce the bug: 
     
    (a) set your locale to French, e.g. fr_FR. 
    (b) run ReducedWithBug.tcl (attached) 
    (c) click on "Alleatoire" - a new color should appear in 
         the lower example slot; 
    (d) click on "Plus Proche" 
     
    If the bug is present, the upper example slot will become the 
    same color as the lower one. If the bug is absent, this will only 
    happen in rare instances. So, if the two are not the same, you can 
    be sure that the bug is not present. If the two are the same, 
    repeat the process a few times. If the two examples are always the 
    same after pressing "Plus Proche", the 
    bug is present. 
     
    
  4. foundin changed to: "obsolete: 8.4.11"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "billposer"
  9. subsystem changed to: "None"
  10. title changed to: "Reading translation causes event failure?"
  11. type changed to: "Bug"