#2874 error dialog during test suite

obsolete: 8.6b1.1
closed-fixed
9
2011-03-30
2011-01-24
Don Porter
No

During a `make test` on the Tk HEAD,
while "select.test" is running, an error reporting
dialog box pops up. Requesting the stack
trace produces:

wrong # args: should be "errIncrHandler type offset count"
wrong # args: should be "errIncrHandler type offset count"
while executing
"errIncrHandler STRI> on 0 4000"
(command handling selection)

Discussion

  • Don Porter

    Don Porter - 2011-01-24

    select-10.4 appears to be the source of the trouble.

     
  • Don Porter

    Don Porter - 2011-01-24
    • labels: --> 53. [selection]
    • milestone: --> obsolete: 8.6b1.1
    • priority: 5 --> 9
    • assigned_to: nobody --> jenglish
     
  • Joe English

    Joe English - 2011-01-24

    Works For Me -- can't replicate.

    From the error message it looks like something has stomped on cmdInfoPtr->command (generic/tkSelect.c). Running under valgrind doesn't turn anything up though.

     
  • Joe English

    Joe English - 2011-01-24

    Probably cause of problem: generic/tkSelect.c r1.32 -> r1.33:

    2010-12-06 Jan Nijtmans <nijtmans@users.sf.net>
    * generic/tkSelect.c: [Bug 3129527]: Fix buffer overflow w/ GCC 4.5 and -D_FORTIFY_SOURCE=2

    This patch changed the last member of struct CommandInfo from:
    char command[4];
    to
    char command[1];

    but neglected to update Tk_CreateSelHandler ~lines 194-197:

    | unsigned cmdInfoLen = sizeof(CommandInfo) +
    | ((CommandInfo *) clientData)->cmdLength - 3;

    In test 10.4, "errIncrHandler STRI<garbage> 0 4000" should be "errIncrHandler STRING"; this is consistent with cmdInfoLen being 3 bytes off.

     
  • Joe English

    Joe English - 2011-01-24

    Should be fixed in CVS (generic/tkSelect.c r1.33 -> 1.34); please retest.

    As for why I can't replicate -- probably due to different compiler versions with different padding and/or alignment; best guess is that r1.33 Works For Me only by accident.

     
  • Don Porter

    Don Porter - 2011-03-30
    • status: open --> closed-fixed
     
  • Don Porter

    Don Porter - 2011-03-30

    Haven't seen this in recent Tk tests.