2 heshang285170811 heshang285170811 于 2016.01.26 18:47 提问

SCP执行到100%后卡住,服务端中文件缺少部分 10C

从linux中scp到 cygwn时,时有发生卡在100%的问题
通过查看进程信息,得知client与server端的ssh连接未关闭;
有个方向:
通过查看成功scp文件的strace信息,发现一般read 数据大小为16324、49152,这些都是1024的倍数。
而scp失败的情况下,出现了read 32767(32768=1024*32).同时在网上查到,如果文件里出现'\0'会发生pipe end的情况。
所以猜想文件传输过程中是不是有'\0'。这里有很多漏洞,强行猜想的吧。scp失败的文件,多scp几次可以成功。。。。。

各错误代码的具体信息为:
Windows Error 109 : ERROR_BROKEN_PIPE: The pipe has been ended.
Windows Error 232 : ERROR_NO_DATA: The pipe is being closed.

以下分别是client、server端的strace信息:
client:
write(6, "\350\264\267\346\254\276\345\210\227\350\241\250\0012016-01-06 08:36:08"..., 16384) = 16384
read(3, "88-4422-919e-edb4ae22b058\001827207"..., 15710) = 15710
write(6, "88-4422-919e-edb4ae22b058\001827207"..., 15710) = 15710
fcntl(6, F_GETFL) = 0x801 (flags O_WRONLY|O_NONBLOCK)
fcntl(6, F_SETFL, O_WRONLY) = 0
alarm(0) = 1
getpgrp() = 45147
ioctl(1, TIOCGPGRP, [45147]) = 0
write(1, "\rTD_APP_EVENT_20160106.txt "..., 211) = 211
write(1, "\n", 1) = 1
close(3) = 0
write(6, "\0", 1) = 1
read(7,
server:
51 479824835 [main] scp 4564 peek_pipe: /dev/fd/pipe:[6], already ready for read
44 479824879 [main] scp 4564 set_bits: me 0x80049C38, testing fd 0 (/dev/fd/pipe:[6])
43 479824922 [main] scp 4564 set_bits: ready 1
43 479824965 [main] scp 4564 select_stuff::cleanup: calling cleanup routines
139 479825104 [main] scp 4564 select_stuff::destroy: deleting select records
81 479825185 [main] scp 4564 select_stuff::cleanup: calling cleanup routines
46 479825231 [main] scp 4564 select_stuff::destroy: deleting select records
66 479825297 [main] scp 4564 cygwin_select: 1 = select(1, 0x28A210, 0x28A1F0, 0x28A1D0, 0x0)
64 479825361 [main] scp 4564 read: read(0, 0x8003D98F, 32767) nonblocking
81 479825442 [main] scp 4564 fhandler_base_overlapped::wait_overlapped: EOF, Win32 error 109

50 479825492 [main] scp 4564 fhandler_base::read: returning 0, binary mode
10984 479836476 [main] scp 4564 read: 0 = read(0, 0x8003D98F, 32767)

53 479836529 [main] scp 4564 read: read(0, 0x8003D98F, 32767) nonblocking
61 479836590 [main] scp 4564 fhandler_base_overlapped::wait_overlapped: EOF, Win32 error 109
46 479836636 [main] scp 4564 fhandler_base::read: returning 0, binary mode
57 479836693 [main] scp 4564 read: 0 = read(0, 0x8003D98F, 32767)

58 479836751 [main] scp 4564 fcntl64: fcntl(1, 3, ...)
73 479836824 [main] scp 4564 fhandler_base::fcntl: GETFL: 0x10001
46 479836870 [main] scp 4564 fcntl64: 65537 = fcntl(1, 3, 0x0)
8294 479845164 [main] scp 4564 _cygwin_istext_for_stdio: fd 1: opened as binary
530 479845694 [main] scp 4564 time: 1452148171 = time(0x0)
48 479845742 [main] scp 4564 fstat64: 0 = fstat(1, 0x28A180)
1826 479847568 [main] scp 4564 fhandler_base_overlapped::wait_overlapped: res 4, Win32 Error 232

79 479847647 [main] scp 4564 seterrno_from_win_error: /home/corinna/src/cygwin/cygwin-1.7.32/cygwin-1.7.32-1.i686/src/src/winsup/cygwin/fhandler.cc:2038 windows error 232
84 479847731 [main] scp 4564 geterrno_from_win_error: windows error 232 == errno 32
70 479847801 [main] scp 4564 kill0: kill (4564, 13)
50 479847851 [main] scp 4564 sig_send: sendsig 0xA0, pid 4564, signal 13, its_me 1
48 479847899 [main] scp 4564 sig_send: wakeup 0x11C
133 479848032 [sig] scp 4564 sigpacket::process: signal 13 processing
64 479848096 [sig] scp 4564 init_cygheap::find_tls: sig 13
59 479848155 [sig] scp 4564 sigpacket::process: using tls 0x28CE64
93 479848248 [sig] scp 4564 sigpacket::process: signal 13, signal handler 0x6102F600
43 479848291 [sig] scp 4564 sigpacket::setup_handler: controlled interrupt. stackptr 0x28DB5C, stack 0x28DB58, stackptr[-1] 0x401E1B
51 479848342 [sig] scp 4564 proc_subproc: args: 5, 1
39 479848381 [sig] scp 4564 proc_subproc: clear waiting threads
60 479848441 [sig] scp 4564 proc_subproc: finished clearing
40 479848481 [sig] scp 4564 proc_subproc: returning 1
92 479848573 [sig] scp 4564 _cygtls::interrupt_setup: armed signal_arrived 0x100, signal 13
41 479848614 [sig] scp 4564 sigpacket::setup_handler: signal 13 delivered
62 479848676 [sig] scp 4564 sigpacket::process: returning 1
54 479848730 [sig] scp 4564 wait_sig: signalling pack.wakeup 0x11C
94 479848824 [main] scp 4564 sig_send: Waiting for pack.wakeup 0x11C
53 479848877 [main] scp 4564 set_process_mask_delta: oldmask 0, newmask 0, deltamask 0
90 479848967 [main] scp 4564 signal_exit: exiting due to signal 13
65 479849032 [main] scp 4564 signal_exit: about to call do_exit (D)
48 479849080 [main] scp 4564 do_exit: do_exit (13), exit_state 2
41 479849121 [main] scp 4564 void: 0x0 = signal (20, 0x1)
38 479849159 [main] scp 4564 void: 0x0 = signal (1, 0x1)
37 479849196 [main] scp 4564 void: 0x0 = signal (2, 0x1)
37 479849233 [main] scp 4564 void: 0x0 = signal (3, 0x1)
77 479849310 [main] scp 4564 fhandler_base::close: closing '/dev/fd/pipe:[6]' handle 0x1BC
61 479849371 [main] scp 4564 fhandler_base::close: closing 'pipe:[9]' handle 0x264
56 479849427 [main] scp 4564 fhandler_base::close: closing 'pipe:[11]' handle 0x268
82 479849509 [main] scp 4564 fhandler_base::close: closing '/sftphome/jk_sftp/talkingdata/TD_APP_EVENT/20160106/TD_APP_EVENT_20160106.txt' handle 0x104
219 479849728 [main] scp 4564 getpid: 4564 = getpid()
68 479849796 [main] scp 4564 proc_terminate: nprocs 0
44 479849840 [main] scp 4564 proc_terminate: leaving
45 479849885 [main] scp 4564 pinfo::exit: Calling ExitProcess n 0xD, exitcode 0xD

3个回答

devmiao
devmiao   Ds   Rxr 2016.01.27 08:16
heshang285170811
heshang285170811 呵呵
接近 2 年之前 回复
heshang285170811
heshang285170811   2016.02.16 17:23

这个问题应该是,网络流量达到网卡带宽最大值导致数据丢失的

heshang285170811
heshang285170811   2016.02.16 17:23

这个问题应该是,网络流量达到网卡带宽最大值导致数据丢失的

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!