Mail Archives: cygwin/2013/01/28/08:59:21
I'm seeing strange behaviour from lftp scripts that use external commands; lftp
forks, but then hangs and needs to be killed. This is only happening from
mintty, but not when lftp gets started from CMD:
sh -c "PATH=/bin lftp -c '\!echo bla'"
Tracing lftp in mintty yields the following after the fork:
44 264494 [main] lftp 5764 sync_with_parent: signalling parent: performed
fork fixup
26 264520 [main] lftp 5764 child_info::ready: signalled 0x250 that I was ready
378 264522 [main] lftp 2924 child_info::sync: pid 5764, WFMO returned 0,
exit_code 0x103, res 1
49 264571 [main] lftp 2924 sig_send: sendsig 0x8C, pid 2924, signal -41,
its_me 1
28 264599 [main] lftp 2924 sig_send: wakeup 0x264
35 264634 [main] lftp 2924 sig_send: Waiting for pack.wakeup 0x264
5 264639 [sig] lftp 2924 wait_sig: signalling pack.wakeup 0x264
45 264684 [main] lftp 2924 sig_send: returning 0x0 from sending signal -41
207 264891 [main] lftp 2924 fork: 5764 = fork()
32 264923 [main] lftp 2924 wait4: calling proc_subproc, pid 5764, options 2
27 264950 [main] lftp 2924 proc_subproc: args: 6, 2284032
25 264975 [main] lftp 2924 proc_subproc: wval->pid 5764, wval->options 2
24 264999 [main] lftp 2924 checkstate: nprocs 1
26 265025 [main] lftp 2924 stopped_or_terminated: considering pid 5764, pgid
3108, w->pid 5764
22 265047 [main] lftp 2924 checkstate: no matching terminated children found
27 265074 [main] lftp 2924 checkstate: returning -1
25 265099 [main] lftp 2924 proc_subproc: only found non-terminated children
24 265123 [main] lftp 2924 proc_subproc: finished processing
terminated/stopped child
24 265147 [main] lftp 2924 proc_subproc: returning 1
1514 266034 [main] lftp 5764 sig_send: sendsig 0x90, pid 5764, signal -41,
its_me 1
27 266061 [main] lftp 5764 sig_send: wakeup 0x244
29 266090 [main] lftp 5764 sig_send: Waiting for pack.wakeup 0x244
25 266115 [sig] lftp 5764 wait_sig: signalling pack.wakeup 0x244
30 266145 [main] lftp 5764 sig_send: returning 0x0 from sending signal -41
177 266322 [main] lftp 5764 fork: 0 = fork()
38 266360 [main] lftp 5764 getpid: 5764 = getpid()
29 266389 [main] lftp 5764 setpgid: pid 5764, pgid 5764, res 0
26 266415 [main] lftp 5764 getpid: 5764 = getpid()
24 266439 [main] lftp 5764 kill0: kill (5764, 17)
26 266465 [main] lftp 5764 sig_send: sendsig 0x90, pid 5764, signal 17, its_me 1
25 266490 [main] lftp 5764 sig_send: wakeup 0x254
29 266519 [main] lftp 5764 sig_send: Waiting for pack.wakeup 0x254
31 266550 [sig] lftp 5764 fhandler_pty_slave::tcflush: tcflush(0) handle 0x14C
30 266580 [sig] lftp 5764 fhandler_termios::bg_check: /dev/pty0, bg I/O pgid
5764, tpgid 3108, myctty ctty /dev/pty0
25 266605 [sig] lftp 5764 tty_min::is_orphaned_process_group: checking pgid
5764, my sid -1, my parent 2924
120 266725 [sig] lftp 5764 open_shared: name cygpid.3460, n 3460, shared
0x3D0000 (wanted 0x0), h 0x244, *m 6
52 266777 [sig] lftp 5764 open_shared: name cygpid.5664, n 5664, shared
0x3F0000 (wanted 0x0), h 0x258, *m 6
48 266825 [sig] lftp 5764 open_shared: name cygpid.2924, n 2924, shared
0x4E0000 (wanted 0x0), h 0x268, *m 6
56 266881 [sig] lftp 5764 open_shared: name cygpid.5696, n 5696, shared
0x4F0000 (wanted 0x0), h 0x274, *m 6
42 266923 [sig] lftp 5764 open_shared: name cygpid.2340, n 2340, shared
0x500000 (wanted 0x0), h 0x27C, *m 6
26 266949 [sig] lftp 5764 pinfo::init: execed process windows pid 2340,
cygwin pid 3460
49 266998 [sig] lftp 5764 open_shared: name cygpid.3460, n 3460, shared
0x500000 (wanted 0x0), h 0x27C, *m 6
60 267058 [sig] lftp 5764 open_shared: name cygpid.4168, n 4168, shared
0x500000 (wanted 0x0), h 0x27C, *m 6
25 267083 [sig] lftp 5764 __set_errno: void pinfo::init(pid_t, DWORD,
void*):314 setting errno 3
42 267125 [sig] lftp 5764 open_shared: name cygpid.3108, n 3108, shared
0x500000 (wanted 0x0), h 0x27C, *m 6
46 267171 [sig] lftp 5764 open_shared: name cygpid.5400, n 5400, shared
0x510000 (wanted 0x0), h 0x284, *m 6
36 267207 [sig] lftp 5764 tty_min::is_orphaned_process_group: checking pid
3460 - has pgid 3460
24 267231 [sig] lftp 5764 tty_min::is_orphaned_process_group: checking pid
5664 - has pgid 0
23 267254 [sig] lftp 5764 tty_min::is_orphaned_process_group: checking pid
2924 - has pgid 3108
21 267275 [sig] lftp 5764 tty_min::is_orphaned_process_group: checking pid
5764 - has pgid 5764
30 267305 [sig] lftp 5764 open_shared: name cygpid.2924, n 2924, shared
0x520000 (wanted 0x0), h 0x288, *m 6
28 267333 [sig] lftp 5764 tty_min::is_orphaned_process_group: ppid->pgid
3108, ppid->sid -1
117 267450 [sig] lftp 5764 kill_pgrp: pid 5764, signal 21
74 267524 [sig] lftp 5764 open_shared: name cygpid.3460, n 3460, shared
0x3D0000 (wanted 0x0), h 0x27C, *m 6
42 267566 [sig] lftp 5764 open_shared: name cygpid.5664, n 5664, shared
0x3F0000 (wanted 0x0), h 0x274, *m 6
44 267610 [sig] lftp 5764 open_shared: name cygpid.2924, n 2924, shared
0x4E0000 (wanted 0x0), h 0x268, *m 6
47 267657 [sig] lftp 5764 open_shared: name cygpid.5696, n 5696, shared
0x4F0000 (wanted 0x0), h 0x258, *m 6
43 267700 [sig] lftp 5764 open_shared: name cygpid.2340, n 2340, shared
0x500000 (wanted 0x0), h 0x244, *m 6
25 267725 [sig] lftp 5764 pinfo::init: execed process windows pid 2340,
cygwin pid 3460
33 267758 [sig] lftp 5764 open_shared: name cygpid.3460, n 3460, shared
0x500000 (wanted 0x0), h 0x244, *m 6
53 267811 [sig] lftp 5764 open_shared: name cygpid.4168, n 4168, shared
0x500000 (wanted 0x0), h 0x244, *m 6
25 267836 [sig] lftp 5764 __set_errno: void pinfo::init(pid_t, DWORD,
void*):314 setting errno 3
33 267869 [sig] lftp 5764 open_shared: name cygpid.4168, n 4168, shared
0x500000 (wanted 0x0), h 0x244, *m 6
25 267894 [sig] lftp 5764 __set_errno: void pinfo::init(pid_t, DWORD,
void*):314 setting errno 3
39 267933 [sig] lftp 5764 open_shared: name cygpid.3108, n 3108, shared
0x500000 (wanted 0x0), h 0x244, *m 6
43 267976 [sig] lftp 5764 open_shared: name cygpid.5400, n 5400, shared
0x510000 (wanted 0x0), h 0x28C, *m 6
38 268014 [sig] lftp 5764 kill_pgrp: killing pid 5764, pgrp 5764, p->ctty
/dev/pty0, ctty /dev/pty0
28 268042 [sig] lftp 5764 sig_send: sendsig 0x90, pid 5764, signal 21, its_me 1
23 268065 [sig] lftp 5764 sig_send: wakeup 0x290
24 268089 [sig] lftp 5764 sig_send: Waiting for pack.wakeup 0x290
28185096 28450243 [sig] lftp 2924 fhandler_pty_slave::tcflush: tcflush(0) handle
0x14C
63 28450306 [sig] lftp 2924 fhandler_pty_slave::read: read(0, -1) handle 0x14C
123 28450429 [sig] lftp 2924 fhandler_pty_slave::read: wait timed out,
time_to_wait 0
24 28450453 [sig] lftp 2924 fhandler_pty_slave::read: -1=read(0, -1)
19 28450472 [sig] lftp 2924 fhandler_pty_slave::tcflush: -1=tcflush(0)
20 28450492 [sig] lftp 2924 sigpacket::process: signal 2 processing
21 28450513 [sig] lftp 2924 init_cygheap::find_tls: sig 2
20 28450533 [sig] lftp 2924 sigpacket::process: using tls 0x22CE64
370 28450903 [sig] lftp 2924 sigpacket::process: signal 2, signal handler
0x6102FE00
26 28450929 [sig] lftp 2924 sigpacket::setup_handler: controlled interrupt.
stackptr 0x22DA34, stack 0x22DA30, stackptr[-1] 0x41B306
29 28450958 [sig] lftp 2924 proc_subproc: args: 5, 1
23 28450981 [sig] lftp 2924 proc_subproc: clear waiting threads
21 28451002 [sig] lftp 2924 checkstate: nprocs 1
21 28451023 [sig] lftp 2924 stopped_or_terminated: considering pid 5764, pgid
5764, w->pid 5764
22 28451045 [sig] lftp 2924 checkstate: no matching terminated children found
21 28451066 [sig] lftp 2924 checkstate: returning -1
21 28451087 [sig] lftp 2924 proc_subproc: waiting thread found no children
22 28451109 [sig] lftp 2924 proc_subproc: finished clearing
21 28451130 [sig] lftp 2924 proc_subproc: returning 1
-16 28451114 [main] lftp 2924 wait4: 0 = cygwait (...)
36 28451150 [sig] lftp 2924 _cygtls::interrupt_setup: armed signal_arrived
0x28C, signal 2
39 28451189 [sig] lftp 2924 sigpacket::setup_handler: signal 2 delivered
21 28451210 [sig] lftp 2924 sigpacket::process: returning 1
3 28451213 [main] lftp 2924 set_process_mask_delta: oldmask 0x80000, newmask
0x80000, deltamask 0x0
42 28451255 [main] lftp 2924 signal_exit: exiting due to signal 2
24 28451279 [main] lftp 2924 signal_exit: about to call do_exit (2)
23 28451302 [main] lftp 2924 do_exit: do_exit (2), exit_state 2
23 28451325 [main] lftp 2924 void: 0x4451B0 = signal (20, 0x1)
22 28451347 [main] lftp 2924 void: 0x43BC30 = signal (1, 0x1)
21 28451368 [main] lftp 2924 void: 0x0 = signal (2, 0x1)
21 28451389 [main] lftp 2924 void: 0x0 = signal (3, 0x1)
28 28451417 [main] lftp 2924 fhandler_pty_slave::cleanup: /dev/pty0 closed,
usecount 4
24 28451441 [main] lftp 2924 fhandler_base::close_with_arch: line 1125:
/dev/pty0<0x61275368> usecount + -1 = 3
23 28451464 [main] lftp 2924 fhandler_base::close_with_arch: not closing
archetype
24 28451488 [main] lftp 2924 fhandler_pty_slave::cleanup: /dev/pty0 closed,
usecount 3
22 28451510 [main] lftp 2924 fhandler_base::close_with_arch: line 1125:
/dev/pty0<0x61275368> usecount + -1 = 2
22 28451532 [main] lftp 2924 fhandler_base::close_with_arch: not closing
archetype
26 28451558 [main] lftp 2924 fhandler_pty_slave::cleanup: /dev/pty0 closed,
usecount 2
22 28451580 [main] lftp 2924 fhandler_base::close_with_arch: line 1125:
/dev/pty0<0x61275368> usecount + -1 = 1
22 28451602 [main] lftp 2924 fhandler_base::close_with_arch: not closing
archetype
25 28451627 [main] lftp 2924 fhandler_base::close: closing
'/mnt/upload/mirror' handle 0x240
26 28451653 [main] lftp 2924 fhandler_base::close: closing
'/mnt/upload/mirror/test.lftp' handle 0x24C
25 28451678 [main] lftp 2924 init_cygheap::close_ctty: closing cygheap->ctty
0x61275368
22 28451700 [main] lftp 2924 fhandler_base::close_with_arch: closing passed
in archetype, usecount 0
23 28451723 [main] lftp 2924 fhandler_pty_slave::close: closing last open
/dev/pty0 handle
149 28451872 [main] lftp 2924 fhandler_console::free_console: freed console, res 1
27 28451899 [main] lftp 2924 fhandler_pty_common::close: pty0 <0x14C,0x154>
closing
28 28451927 [main] lftp 2924 getpid: 2924 = getpid()
29 28451956 [main] lftp 2924 proc_terminate: nprocs 1
23 28451979 [main] lftp 2924 proc_subproc: args: 5, 1
23 28452002 [main] lftp 2924 proc_subproc: clear waiting threads
20 28452022 [main] lftp 2924 proc_subproc: finished clearing
21 28452043 [main] lftp 2924 proc_subproc: returning 1
23 28452066 [main] lftp 2924 cygthread::terminate_thread: thread 'waitproc',
id 0x758, inuse 1, stack_ptr 0x1F0AD40
108 28452174 [main] lftp 2924 proc_terminate: leaving
47 28452221 [main] lftp 2924 __to_clock_t: dwHighDateTime 0, dwLowDateTime 468003
23 28452244 [main] lftp 2924 __to_clock_t: total 00000000 0000002E
20 28452264 [main] lftp 2924 __to_clock_t: dwHighDateTime 0, dwLowDateTime 780005
21 28452285 [main] lftp 2924 __to_clock_t: total 00000000 0000004E
21 28452306 [main] lftp 2924 pinfo::exit: Calling ExitProcess n 0x2, exitcode
0x200
Regards,
Achim.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -