#1871 Crash/Core dump with bad color resource in option db

obsolete: 8.4.9

The following code produces a core dump or crash on
unix variants and on Windows with at least 8.4.9 and 8.4.8

% option add *background coredump
% menu .m
unknown color name "coredump"
% menu .m
unknown color name "coredump"
% menu .m
Segmentation fault (core dumped)

This problem seems centered around the menu widget to
some degree and appears to be the direct result of
failling to create a menu widget because of an invalid
color in the tk option database. Note that core dump
usually occurs while creating certain widgets after the
menu widget has failed to be created.


  • Donal K. Fellows

    Logged In: YES

    Bug also exists on 8.5a2 on WinXP with the following typed

    % option add *background foo
    % menu .m
    unknown color name "foo"
    % option clear
    % menu .m
    => CRASH

    Crash doesn't happen if I create a menu with a name other
    than .m between the 'option clear' and the second invokation
    of 'menu .m'

  • Donal K. Fellows

    • labels: --> 10. Generic Menus
    • priority: 5 --> 9
    • assigned_to: nobody --> hobbs
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2005-05-31

    Logged In: YES

    Fixed in 8.4.10 and 8.5 head. The menu creation was not
    being consistent about destruction, so the command token
    remained on an option db creation error.

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2005-05-31
    • status: open --> closed-fixed