ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:71863] Re: [ruby-cvs:60055] nobu:r52902 (trunk): console.c: console_getpass
       [not found] <20151206062514.BF16324009@fluorine.ruby-lang.org>
@ 2015-12-07  1:23 ` Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-12-07  1:23 UTC (permalink / raw
  To: nobu; +Cc: ruby-core

Hi nobu, I get this failure on Debian 7.0 (wheezy) on
32-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]:
<"asdf"> expected but was
<"> asdf">.

r52910 did not fix this.

I'm not too familiar with tty-related code and haven't figure out
what's going on.

Here's the relevant strace from that test, and below is the mkmf.log:

13856 clock_gettime(CLOCK_REALTIME, {1449450431, 418795141}) = 0
13856 waitpid(-1, 0xfff95360, 0)        = -1 ECHILD (No child processes)
13856 write(1, ".", 1)                  = 1
13856 stat64("/proc/self/fd", {st_mode=S_IFDIR|0500, st_size=0, ...}) = 0
13856 open("/proc/self/fd", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 7
13856 lseek(7, 0, SEEK_SET)             = 0
13856 getdents64(7, /* 10 entries */, 32768) = 240
13856 getdents64(7, /* 0 entries */, 32768) = 0
13856 close(7)                          = 0
13856 clock_gettime(CLOCK_REALTIME, {1449450431, 419229169}) = 0
13856 open("/dev/ptmx", O_RDWR|O_NOCTTY|O_CLOEXEC) = 7
13856 fcntl64(7, F_GETFD)               = 0x1 (flags FD_CLOEXEC)
13856 rt_sigaction(SIGCHLD, {SIG_DFL, [], 0}, {SIG_DFL, [], 0}, 8) = 0
13856 ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
13856 ioctl(7, TIOCGPTN, [7])           = 0
13856 stat64("/dev/pts/7", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 7), ...}) = 0
13856 getuid32()                        = 1000
13856 rt_sigaction(SIGCHLD, {SIG_DFL, [], 0}, NULL, 8) = 0
13856 ioctl(7, TIOCSPTLCK, [0])         = 0
13856 ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
13856 ioctl(7, TIOCGPTN, [7])           = 0
13856 stat64("/dev/pts/7", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 7), ...}) = 0
13856 chmod("/dev/pts/7", 0600)         = 0
13856 open("/dev/pts/7", O_RDWR|O_NOCTTY|O_LARGEFILE|O_CLOEXEC) = 8
13856 mmap2(NULL, 528384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x55a2c000
13856 mmap2(NULL, 528384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x55aad000
13856 mprotect(0x55aad000, 4096, PROT_NONE) = 0
13856 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) = 13859
13859 set_robust_list(0x55b2dbe0, 0xc <unfinished ...>
13856 write(7, "> ", 2 <unfinished ...>
13859 <... set_robust_list resumed> )   = 0
13859 sched_getaffinity(13859, 32,  <unfinished ...>
13856 <... write resumed> )             = 2
13859 <... sched_getaffinity resumed> {3, 0}) = 8
13856 ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS <unfinished ...>
13859 sigaltstack({ss_sp=0x5849f778, ss_flags=0, ss_size=16384} <unfinished ...>
13856 <... ioctl resumed> , {B38400 opost isig icanon echo ...}) = 0
13859 <... sigaltstack resumed> , {ss_sp=0, ss_flags=SS_DISABLE, ss_size=0}) = 0
13859 write(6, "!", 1 <unfinished ...>
13856 ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS <unfinished ...>
13859 <... write resumed> )             = 1
13858 <... poll resumed> )              = 1 ([{fd=5, revents=POLLIN}])
13859 futex(0x581b7848, FUTEX_WAIT_PRIVATE, 1, NULL <unfinished ...>
13858 read(3, 0x56848020, 1024)         = -1 EAGAIN (Resource temporarily unavailable)
13856 <... ioctl resumed> , {B38400 opost isig icanon echo ...}) = 0
13858 read(5,  <unfinished ...>
13856 ioctl(7, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost isig icanon -echo ...}) = 0
13856 ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon -echo ...}) = 0
13858 <... read resumed> "!", 1024)     = 1
13856 futex(0x581b7848, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x581b7844, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1} <unfinished ...>
13858 read(5,  <unfinished ...>
13856 <... futex resumed> )             = 1
13858 <... read resumed> 0x56848020, 1024) = -1 EAGAIN (Resource temporarily unavailable)
13856 read(7,  <unfinished ...>
13858 poll([{fd=3, events=POLLIN}], 1, 100 <unfinished ...>
13856 <... read resumed> "> ", 8192)    = 2
13859 <... futex resumed> )             = 0
13856 futex(0x581b787c, FUTEX_WAIT_PRIVATE, 1, NULL <unfinished ...>
13859 futex(0x581b787c, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x581b7878, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 0
13856 <... futex resumed> )             = -1 EAGAIN (Resource temporarily unavailable)
13859 futex(0x581b7828, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
13856 write(6, "!", 1 <unfinished ...>
13859 <... futex resumed> )             = 0
13856 <... write resumed> )             = 1
13859 prctl(PR_SET_NAME, 0x55b2d2fc, 0, 0xfffffffe, 0x581b7ec8 <unfinished ...>
13856 futex(0x581b7828, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
13859 <... prctl resumed> )             = 0
13856 <... futex resumed> )             = 0
13856 futex(0x581b7848, FUTEX_WAIT_PRIVATE, 3, NULL <unfinished ...>
13859 time(NULL)                        = 1449450431
13859 clock_gettime(CLOCK_MONOTONIC, {4118337, 10691901}) = 0
13859 clock_gettime(CLOCK_MONOTONIC, {4118337, 10712250}) = 0
13859 futex(0x581b7848, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x581b7844, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1
13856 <... futex resumed> )             = 0
13859 clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
13856 futex(0x581b7828, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
13859 <... clock_gettime resumed> {4118337, 10782767}) = 0
13856 <... futex resumed> )             = 0
13859 futex(0x5842b214, FUTEX_WAIT_PRIVATE, 1, {0, 99929483} <unfinished ...>
13856 read(7,  <unfinished ...>
13858 <... poll resumed> )              = 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)                = 1
13858 read(5, 0x56848020, 1024)         = -1 EAGAIN (Resource temporarily unavailable)
13858 poll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}], 2, -1 <unfinished ...>
13859 <... futex resumed> )             = -1 ETIMEDOUT (Connection timed out)
13859 futex(0x5842b268, FUTEX_WAKE_PRIVATE, 1) = 0
13859 clock_gettime(CLOCK_MONOTONIC, {4118337, 110885257}) = 0
13859 time(NULL)                        = 1449450431
13859 write(8, "asdf\n", 5)             = 5
13859 madvise(0x55aad000, 507904, MADV_DONTNEED <unfinished ...>
13856 <... read resumed> "asdf\r\n", 8192) = 6
13859 <... madvise resumed> )           = 0
13859 _exit(0)                          = ?
13856 ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon -echo ...}) = 0
13856 ioctl(7, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost isig icanon echo ...}) = 0
13856 ioctl(7, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
13856 write(7, "\n", 1)                 = 1
13856 close(7)                          = 0
13856 close(8)                          = 0
13856 clock_gettime(CLOCK_REALTIME, {1449450431, 522078062}) = 0
13856 waitpid(-1, 0xfff95360, 0)        = -1 ECHILD (No child processes)
13856 write(1, "F", 1)                  = 1

mkmf.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 ‘|’ token
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: /*top*/
4: #ifndef _WIN32
5: # error
6: |:/ === _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 <termios.h>
/* 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 <termios.h>
 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 <sys/ioctl.h>
/* end */

--------------------

extconf.h is:
/* begin */
1: #ifndef EXTCONF_H
2: #define EXTCONF_H
3: #define HAVE_TERMIOS_H 1
4: #define HAVE_CFMAKERAW 1
5: #define HAVE_SYS_IOCTL_H 1
6: #endif
/* end */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-07  0:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20151206062514.BF16324009@fluorine.ruby-lang.org>
2015-12-07  1:23 ` [ruby-core:71863] Re: [ruby-cvs:60055] nobu:r52902 (trunk): console.c: console_getpass Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).