Bug#888884: segfault for no obvious reason on rcp from remote host

2018-02-01 Thread Hiroyuki YAMAMORI
Dear Maintainer,

It will fix with the following patch.

--- netkit-rsh-0.17/rcp/rcp.c
+++ new/rcp/rcp.c
@@ -889,7 +889,11 @@
fprintf(fp, "%c", 0x01);
vfprintf(fp, fmt, ap);
fflush(fp);
-   if (!iamremote) vfprintf(stderr, fmt, ap);
+   if (!iamremote) {
+   va_end(ap);
+   va_start(ap, fmt);
+   vfprintf(stderr, fmt, ap);
+   }
 
va_end(ap);
 }

Bug#366535 will also be fixed with this patch.

Thank you,
Hiroyuki YAMAMORI



Bug#888884: segfault for no obvious reason on rcp from remote host

2018-01-30 Thread Yaroslav Halchenko
Package: rsh-client
Version: 0.17-15
Severity: important

I was truly amazed to find an 11 year old segfault-reporting #366535 but since
my traceback/use case is different, decided that it might be a different
issue.

We use rcp/rsh on our local cluster between nodes.  rcp "doesn't work":

root@head3:~# gdb --args /usr/bin/rcp head1:/etc/singularity/singularity.conf 
/etc/singularity/singularity.conf
GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/rcp...(no debugging symbols found)...done.
(gdb) r
Starting program: /usr/bin/rcp head1:/etc/singularity/singularity.conf 
/etc/singularity/singularity.conf

Program received signal SIGSEGV, Segmentation fault.
0x7f2e68b0bdcc in _IO_vfprintf_internal (s=, 
format=, ap=)
at vfprintf.c:1642
1642vfprintf.c: No such file or directory.
(gdb) bt
#0  0x7f2e68b0bdcc in _IO_vfprintf_internal (s=, 
format=, ap=)
at vfprintf.c:1642
#1  0x7f2e68b0cb01 in buffered_vfprintf (s=s@entry=0x7f2e68e67060 
<_IO_2_1_stderr_>, 
format=format@entry=0x4036ed "rcp: protocol screwup: %s\n", 
args=args@entry=0x7ffec335c380)
at vfprintf.c:2348
#2  0x7f2e68b0737e in _IO_vfprintf_internal (s=0x7f2e68e67060 
<_IO_2_1_stderr_>, 
format=0x4036ed "rcp: protocol screwup: %s\n", ap=0x7ffec335c380) at 
vfprintf.c:1296
#3  0x00401672 in ?? ()
#4  0x0040240d in ?? ()
#5  0x00403357 in ?? ()
#6  0x7f2e68ae2b45 in __libc_start_main (main=0x402a70, argc=3, 
argv=0x7ffec335e768, init=, 
fini=, rtld_fini=, stack_end=0x7ffec335e758) 
at libc-start.c:287
#7  0x004014b9 in ?? ()
#8  0x7ffec335e758 in ?? ()
#9  0x001c in ?? ()
#10 0x0003 in ?? ()
#11 0x7ffec335ecb6 in ?? ()
#12 0x7ffec335ecc3 in ?? ()
#13 0x7ffec335eceb in ?? ()
#14 0x in ?? ()

rsh head1   works fine

rcp the file from head1 to head3 works:
root@head1:/etc/singularity# rcp $PWD/singularity.conf 
head3:$PWD/singularity.conf
root@head1:/etc/singularity# echo $?
0


-- System Information:
Debian Release: 8.5
  APT prefers oldstable
  APT policy: (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: sysvinit (via /sbin/init)

Versions of packages rsh-client depends on:
ii  libc6  2.19-18+deb8u4

rsh-client recommends no packages.

rsh-client suggests no packages.

-- no debconf information