Package: expect Version: 5.43.0-3.1 Severity: normal [ CC'ed to package adopter as the BTS doesn't know about them yet ]
Hi. Expect seems to have intermittent semi-random problems during processing of large amounts of binary data. The attached scripts, testspew (expect) and spew (perl) originally had a telnet connection between them (I'm SIGSEGV hunting in telnetd-ssl) but if I take out the telnet connection the problem still appears. Put them both in the same directory, make them executable, then do: ./testspew|cat -A spew just spits out incrementing 32 bit numbers, and testspew checks they are right, after adjusting for newline processing. They run for between 2 and 20 minutes or so on my machine, before dying due to a "\r\n" where there should be a "\n". This implies the match on "^\r\n" at line 15 of testspew is failing and it is matching "^(.)" instead (line 20) I let it run repeatedly overnight, here are the (cleaned up) results. The initial number is how many times it failed at that particular point. It usually fails on 624906, but not always, and I've tried running it from just before 624906 and it sails past it, so it's not just that particular data pattern causing the problem. 1 Expected 264795 ([^J^D^@) got 67767643 ([^M^J^D) 3 Expected 330408 (M-(^J^E^@) got 84544936 (M-(^M^J^E) 81 Expected 624906 (^JM-^I^I^@) got 159975949 (^M^JM-^I^I) Hope this all makes sense, feel free to ask if it doesn't. Ian. -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (500, 'unstable') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.15 Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Versions of packages expect depends on: ii libc6 2.3.6-15 GNU C Library: Shared libraries ii tcl8.4 8.4.12-1 Tcl (the Tool Command Language) v8 expect recommends no packages. -- no debconf information
#!/usr/bin/expect -f remove_nulls -d 0 spawn ./spew set lastnum -1 set done 0 set buf "" set buflen 0 while { ! $done } { expect { -re "^\r\n" { append buf "\n" incr buflen puts "RETURN-NEWLINE" } -re "^(.)" { append buf $expect_out(1,string) incr buflen } eof { puts "EOF" set done 1 } } if { ! $done && $buflen == 4 } { set buflen 0 binary scan $buf i num incr lastnum if { $lastnum != $num } { set expected [ binary format i $lastnum ] puts "ERROR: Expected $lastnum ($expected) got $num ($buf)" exit } else { puts "OK: $num ($buf)" } set buf "" } } puts "DONE"
spew
Description: Perl program