[#72261] Re: [ruby-cvs:60055] nobu:r52902 (trunk): console.c: console_getpass
— Joseph Jones <joeyi5216@...>
Joseph Jones liked your message with Boxer. On December 6, 2015 at 18:23:36 MST, Eric Wong <normalperson@yhbt.net> wrote:Hi nobu, I get this failure on Debian 7.0 (wheezy) on32-bit x86 (64-bit kernel), x86-64 and Debian 8.0 (jessie) x86-64: 1) Failure:TestIO_Console#test_getpass [/home/ew/ruby/test/io/console/test_io_console.rb:190]: expected but was asdf">.r52910 did not fix this.I'm not too familiar with tty-related code and haven't figure outwhat's going on.Here's the relevant strace from that test, and below is the mkmf.log:13856 clock_gettime(CLOCK_REALTIME, {1449450431, 418795141}) = 013856 waitpid(-1, 0xfff95360, 0) = -1 ECHILD (No child processes)13856 write(1, ".", 1) = 113856 stat64("/proc/self/fd", {st_mode=S_IFDIR|0500, st_size=0, ...}) = 013856 open("/proc/self/fd", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 713856 lseek(7, 0, SEEK_SET) = 013856 getdents64(7, /* 10 entries */, 32768) = 24013856 getdents64(7, /* 0 entries */, 32768) = 013856 close(7) = 013856 clock_gettime(CLOCK_REALTIME, {1449450431, 419229169}) = 013856 open("/dev/ptmx", O_RDWR|O_NOCTTY|O_CLOEXEC) = 713856 fcntl64(7, F_GETFD) = 0x1 (flags FD_CLOEXEC)13856 rt_sigaction(SIGCHLD, {SIG_DFL, [], 0}, {SIG_DFL, [], 0}, 8) = 013856 ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 013856 ioctl(7, TIOCGPTN, [7]) = 013856 stat64("/dev/pts/7", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 7), ...}) = 013856 getuid32() = 100013856 rt_sigaction(SIGCHLD, {SIG_DFL, [], 0}, NULL, 8) = 013856 ioctl(7, TIOCSPTLCK, [0]) = 013856 ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 013856 ioctl(7, TIOCGPTN, [7]) = 013856 stat64("/dev/pts/7", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 7), ...}) = 013856 chmod("/dev/pts/7", 0600) = 013856 open("/dev/pts/7", O_RDWR|O_NOCTTY|O_LARGEFILE|O_CLOEXEC) = 813856 mmap2(NULL, 528384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x55a2c00013856 mmap2(NULL, 528384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x55aad00013856 mprotect(0x55aad000, 4096, PROT_NONE) = 013856 clone(child_stack=0x55b2d494, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x55b2dbd8, {entry_number:12, base_addr:0x55b2db70, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0x55b2dbd8) = 1385913859 set_robust_list(0x55b2dbe0, 0xc 13856 write(7, "> ", 2 13859 ) = 013859 sched_getaffinity(13859, 32, 13856 ) = 213859 {3, 0}) = 813856 ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS 13859 sigaltstack({ss_sp=0x5849f778, ss_flags=0, ss_size=16384} 13856 , {B38400 opost isig icanon echo ...}) = 013859 , {ss_sp=0, ss_flags=SS_DISABLE, ss_size=0}) = 013859 write(6, "!", 1 13856 ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS 13859 ) = 113858 ) = 1 ([{fd=5, revents=POLLIN}])13859 futex(0x581b7848, FUTEX_WAIT_PRIVATE, 1, NULL 13858 read(3, 0x56848020, 1024) = -1 EAGAIN (Resource temporarily unavailable)13856 , {B38400 opost isig icanon echo ...}) = 013858 read(5, 13856 ioctl(7, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost isig icanon -echo ...}) = 013856 ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon -echo ...}) = 013858 "!", 1024) = 113856 futex(0x581b7848, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x581b7844, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1} 13858 read(5, 13856 ) = 113858 0x56848020, 1024) = -1 EAGAIN (Resource temporarily unavailable)13856 read(7, 13858 poll([{fd=3, events=POLLIN}], 1, 100 13856 "> ", 8192) = 213859 ) = 013856 futex(0x581b787c, FUTEX_WAIT_PRIVATE, 1, NULL 13859 futex(0x581b787c, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x581b7878, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 013856 ) = -1 EAGAIN (Resource temporarily unavailable)13859 futex(0x581b7828, FUTEX_WAKE_PRIVATE, 1 13856 write(6, "!", 1 13859 ) = 013856 ) = 113859 prctl(PR_SET_NAME, 0x55b2d2fc, 0, 0xfffffffe, 0x581b7ec8 13856 futex(0x581b7828, FUTEX_WAKE_PRIVATE, 1 13859 ) = 013856 ) = 013856 futex(0x581b7848, FUTEX_WAIT_PRIVATE, 3, NULL 13859 time(NULL) = 144945043113859 clock_gettime(CLOCK_MONOTONIC, {4118337, 10691901}) = 013859 clock_gettime(CLOCK_MONOTONIC, {4118337, 10712250}) = 013859 futex(0x581b7848, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x581b7844, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 113856 ) = 013859 clock_gettime(CLOCK_MONOTONIC, 13856 futex(0x581b7828, FUTEX_WAKE_PRIVATE, 1 13859 {4118337, 10782767}) = 013856 ) = 013859 futex(0x5842b214, FUTEX_WAIT_PRIVATE, 1, {0, 99929483} 13856 read(7, 13858 ) = 0 (Timeout)13858 poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}], 2, -1) = 1 ([{fd=5, revents=POLLIN}])13858 read(3, 0x56848020, 1024) = -1 EAGAIN (Resource temporarily unavailable)13858 read(5, "!", 1024) = 113858 read(5, 0x56848020, 1024) = -1 EAGAIN (Resource temporarily unavailable)13858 poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}], 2, -1 13859 ) = -1 ETIMEDOUT (Connection timed out)13859 futex(0x5842b268, FUTEX_WAKE_PRIVATE, 1) = 013859 clock_gettime(CLOCK_MONOTONIC, {4118337, 110885257}) = 013859 time(NULL) = 144945043113859 write(8, "asdf\n", 5) = 513859 madvise(0x55aad000, 507904, MADV_DONTNEED 13856 "asdf\r\n", 8192) = 613859 ) = 013859 _exit(0) = ?13856 ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon -echo ...}) = 013856 ioctl(7, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost isig icanon echo ...}) = 013856 ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 013856 write(7, "\n", 1) = 113856 close(7) = 013856 close(8) = 013856 clock_gettime(CLOCK_REALTIME, {1449450431, 522078062}) = 013856 waitpid(-1, 0xfff95360, 0) = -1 ECHILD (No child processes)13856 write(1, "F", 1) = 1mkmf.log:"gcc -o conftest -I../../../.ext/include/x86_64-linux -I../../.././include -I../../.././ext/io/console -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat conftest.c -L. -L../../.. -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-R/home/ew/r/trunk/lib -L/home/ew/r/trunk/lib -lruby-static -lpthread -lrt -lgmp -ldl -lcrypt -lm -lc"checked program was:/* begin */1: #include "ruby.h"2: 3: int main(int argc, char **argv)4: {5: return 0;6: }/* end */"gcc -I../../../.ext/include/x86_64-linux -I../../.././include -I../../.././ext/io/console -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -c conftest.c"conftest.c:5:3: error: #error conftest.c:6:1: error: expected identifier or ‘(’ before ‘|’ tokenchecked program was:/* begin */1: #include "ruby.h"2: 3: /*top*/4: #ifndef _WIN325: # error6: |:/ === _WIN32 undefined === /:|7: #endif/* end */have_header: checking for termios.h... -------------------- yes"gcc -E -I../../../.ext/include/x86_64-linux -I../../.././include -I../../.././ext/io/console -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat conftest.c -o conftest.i"checked program was:/* begin */1: #include "ruby.h"2: 3: #include /* end */--------------------have_func: checking for cfmakeraw() in termios.h... -------------------- yes"gcc -o conftest -I../../../.ext/include/x86_64-linux -I../../.././include -I../../.././ext/io/console -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat conftest.c -L. -L../../.. -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-R/home/ew/r/trunk/lib -L/home/ew/r/trunk/lib -lruby-static -lpthread -lrt -lgmp -ldl -lcrypt -lm -lc"checked program was:/* begin */ 1: #include "ruby.h" 2: 3: #include 4: 5: /*top*/ 6: extern int t(void); 7: int main(int argc, char **argv) 8: { 9: if (argc > 1000000) {10: printf("%p", &t);11: }12: 13: return 0;14: }15: int t(void) { void ((*volatile p)()); p = (void ((*)()))cfmakeraw; return !p; }/* end */--------------------have_header: checking for sys/ioctl.h... -------------------- yes"gcc -E -I../../../.ext/include/x86_64-linux -I../../.././include -I../../.././ext/io/console -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat conftest.c -o conftest.i"checked program was:/* begin */1: #include "ruby.h"2: 3: #include /* end */--------------------extconf.h is:/* begin */1: #ifndef EXTCONF_H2: #define EXTCONF_H3: #define HAVE_TERMIOS_H 14: #define HAVE_CFMAKERAW 15: #define HAVE_SYS_IOCTL_H 16: #endif/* end */