Menu

#2342 Placer geometry manager crash, and patch

obsolete: 8.4.16
closed-fixed
9
2007-10-25
2007-10-23
No

When a Tk geometry manager reconfigures its
slaves, almost anything can happen via event
bindings, including deleting the manager widget or
slaves. The Tk pack and grid managers carefully
handle this, through a combination of
Tcl_Preserve/Tcl_Release and an abort flag. The
corresponding code is missing from the place
manager.

With Tcl/Tk 8.4.15 I was seeing crashes while using
place in mega-widget construction, in complex
timing-relating circumstances. I have since
produced a (very) contrived simple example, in
placer.tcl. Run it with wish. Using Tcl/Tk
8.4.15 resizing the main window crashes wish every
time on my Solaris unix build, and on a Windows-XP
single-threaded build. Memory corruption - so
your mileage may vary for different builds.

I have applied exactly the same protection method
as used in grid and pack to the placer. This
solve the problem in placer.tcl, and in my real
application. The Tcl/Tk 8.4 updated code applied
to CVS 1.13.2.1 is in tkPlace.c.84. I have also
updated the Tcl/Tk 8.5 code from CVS 1.22, in
tkPlace.c.85.

Discussion

  • Colin McDonald

    Colin McDonald - 2007-10-23

    problem demo

     
  • Colin McDonald

    Colin McDonald - 2007-10-23

    Tcl/Tk 8.4 update to CVS 1.13.2.1

     
  • Colin McDonald

    Colin McDonald - 2007-10-23

    Logged In: YES
    user_id=883691
    Originator: YES

    File Added: tkPlace.c.84

     
  • Colin McDonald

    Colin McDonald - 2007-10-23

    Tcl/Tk 8.5 update to CVS 1.22

     
  • Colin McDonald

    Colin McDonald - 2007-10-23

    Logged In: YES
    user_id=883691
    Originator: YES

    File Added: tkPlace.c.85

     
  • Donal K. Fellows

    • priority: 5 --> 9
     
  • Don Porter

    Don Porter - 2007-10-25

    Logged In: YES
    user_id=80530
    Originator: NO

    I just tried the submitted replacement
    tkPlace.c on the Tk HEAD. It does not
    prevent the crash. The demo script
    provided crashes on the Tk HEAD both
    before and after the submitted fix
    is attempted.

    Better news is that the fix for
    core-8-4-branch *does* appear to
    be effective.

     
  • Don Porter

    Don Porter - 2007-10-25

    Logged In: YES
    user_id=80530
    Originator: NO

    I must report pilot error
    on the HEAD testing. Seems
    my test was loading an
    installed libtk.so, and not
    the patched version. Submitted
    fix is effective on both branches.

    I'm committing these patches.
    If later maintainer review indicates
    the submitted code is not acceptable,
    it can be revised, but for now
    a crash-stopper is a crash-stopper.

     
  • Don Porter

    Don Porter - 2007-10-25
    • assigned_to: pspjuth --> dgp
    • status: open --> closed-fixed
     
  • Don Porter

    Don Porter - 2007-10-25

    Logged In: YES
    user_id=80530
    Originator: NO

    fixes committed.