Package: expect Version: 5.43.0-14 Followup-For: Bug #377332 This patch corrects a data loss problem in the patch for #156854. expAdjust does not do what H. J. wanted it to; the buffer has two sizes (the requested size and the amount of data actually in it), and the data can oddly enough be larger than the buffer size. So if you bump up the buffer size by 2K and tell expect to adjust the buffer, it may discard some of the data in the middle.
We found this in a testcase which produces about 1.8MB of output fairly quickly. The failure is timing sensitive and I think it matches the description of #377332. I'm not completely sure the patch is right, but it helped in all our testing. Index: expect-5.43.0/expect.c =================================================================== --- expect-5.43.0.orig/expect.c 2007-10-22 19:46:23.000000000 -0400 +++ expect-5.43.0/expect.c 2007-10-22 20:12:55.000000000 -0400 @@ -48,9 +48,9 @@ would appreciate credit if this program is 8MB (0x800000). */ #define EXP_MATCH_MAX 2000 #define EXP_MATCH_INC 2000 -#define EXP_MATCH_STEP_LIMIT 0x700000 -#define EXP_MATCH_LIMIT 0x800000 -#define EXP_MATCH_LIMIT_QUOTE "0x800000" +#define EXP_MATCH_STEP_LIMIT 0x7000000 +#define EXP_MATCH_LIMIT 0x8000000 +#define EXP_MATCH_LIMIT_QUOTE "0x8000000" /* initial length of strings that we can guarantee patterns can match */ int exp_default_match_max = EXP_MATCH_MAX; @@ -1667,7 +1667,7 @@ int save_flags; return count; } else { - esPtr->umsize += EXP_MATCH_INC; + esPtr->umsize = exp_size + EXP_MATCH_INC; expAdjust(esPtr); } } -- System Information: Debian Release: lenny/sid APT prefers unstable APT policy: (500, 'unstable'), (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 2.6.22 (SMP w/2 CPU cores; PREEMPT) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages expect depends on: ii libc6 2.6.1-6 GNU C Library: Shared libraries ii tcl8.4 8.4.16-1 Tcl (the Tool Command Language) v8 expect recommends no packages. -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]