tee core dumped

Igor Pechtchanski pechtcha@cs.nyu.edu
Fri Aug 29 15:41:00 GMT 2003


On Wed, 27 Aug 2003, Philippe Torche wrote:

> I found a problem with tee (probably), please try this sample code
> below. I've found the same problem with other tools like gawk, ...
>
> echo '#!/usr/bin/bash
> sleep 10 > /dev/null 2>&1 &
> transfert_job=$!
>
> echo LINENO=$LINENO
> procps -p $transfert_job -o 'pid,ppid'
> echo LINENO=$LINENO
> ' > test.sh
> chmod +x test.sh
> # OK
> test.sh > test.out
> # KO KO KO KO KO KO KO KO KO KO KO KO KO KO
> test.sh | tee test.out
> # Segmentation fault (core dumped)
>
> Info:
> ----
>
> ========================================
> $ cat tee.exe.stackdump
> Exception: STATUS_ACCESS_VIOLATION at eip=610BA041
> eax=00000000 ebx=615F1F50 ecx=FFFFFFFF edx=6F6C5C72 esi=0076FE9C
> edi=6F6C5C72
> ebp=0076FE74 esp=0076FE70 program=C:\cygwin\bin\tee.exe
> cs=001B ds=0023 es=0023 fs=0038 gs=0000 ss=0023
> Stack trace:
> Frame     Function  Args
> 0076FE74  610BA041  (6F6C5C72, 0076FEA0, 00000004, 0076FE9C)
> 0076FEB4  6105828B  (00A20000, 00000000, 00000000, FFFFFFFF)
> 0076FF04  61077738  (FFFFFFFE, 00000010, 00000000, 00000000)
> 0076FF84  61077CC8  (610D1B58, 00000000, 858A88E0, 804FAB78)
> 0076FFB4  610053C8  (610D1B58, 00000000, 0022FC44, 610D1B58)
>       3 [sig] tee 2400 handle_exceptions: Error while dumping state
> (probably corrupted stack)
>
> ========================================
> $ /usr/bin/tee --version
> tee (sh-utils) 2.0.15
> Written by Mike Parker, Richard M. Stallman, and David MacKenzie.
>
> ========================================
> $ cygcheck -svr
> [snip]

Philippe,

Lack of responses doesn't necessarily indicate that your post wasn't seen
(or your problem reproduced), but more likely lack of time for debugging
the problem (see <http://www.catb.org/~esr/faqs/smart-questions.html>).

FWIW, I was able to reproduce your problem (in fact, simply calling
"/bin/procps -p $$ -o 'pid,ppid' | tee test.out" was enough to trigger the
problem). At the moment, I don't have an unstripped version of the DLL
installed on my system, so I couldn't do the debugging necessary for this.
>From the range of addresses in the stack trace, it seems to happen
somewhere in the Cygwin DLL itself.  I've compared the strace for the
problematic command with the one from simply doing "echo | tee test.out".
The difference in straces is not significant (to me), except that readv()
seems to never get to the end of fhandler_base::read().  I'm attaching the
relevant chunk of the diffs (with times and PIDs stripped out to minimize
noise) in the hopes that this helps someone else debug this.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton
-------------- next part --------------
--- tee-echo.strace	2003-08-29 09:18:45.000000000 -0400
+++ tee-procps.strace	2003-08-29 09:18:54.000000000 -0400
@@ -5,7 +5,7 @@ DLL version:  1003.22, api: 0.78

 DLL build:    2003-03-18 09:20
 OS version:   Windows NT-5.0
 Heap size:    402653184
-Date/Time:    2003-08-29 09:01:55
+Date/Time:    2003-08-29 09:04:09
 **********************************************
 X X [main] tee XXXX environ_init: 0x10020008: !C:=C:\cygwin\bin
 X X [main] tee XXXX environ_init: 0x100204D0: ALLUSERSPROFILE=C:\Documents and Settings\All Users
@@ -199,11 +199,11 @@ X X [main] tee XXXX sigproc_init: proces
 X X [main] tee XXXX _cygwin_istext_for_stdio: _cygwin_istext_for_stdio (0)
 X X [main] tee XXXX _cygwin_istext_for_stdio:  _cifs: fd not open
 X X [main] tee XXXX _cygwin_istext_for_stdio: _cygwin_istext_for_stdio (1)
+X X [sig] tee XXXX wait_sig: sigcatch_nonmain 0xCC, sigcatch_main 0xD0
+X X [sig] tee XXXX wait_sig: Ready.  dwProcessid PPPP
 X X [main] tee XXXX _cygwin_istext_for_stdio:  _cifs: fd not open
 X X [main] tee XXXX _cygwin_istext_for_stdio: _cygwin_istext_for_stdio (2)
 X X [main] tee XXXX _cygwin_istext_for_stdio:  _cifs: fd not open
-X X [sig] tee XXXX wait_sig: sigcatch_nonmain 0xCC, sigcatch_main 0xD0
-X X [sig] tee XXXX wait_sig: Ready.  dwProcessid PPPP
 X X [main] tee XXXX build_argv: argv[0] = 'tee'
 X X [main] tee XXXX build_argv: argv[1] = 'test.out'
 X X [main] tee XXXX build_argv: argc 2
@@ -215,8 +215,8 @@ X X [main] tee XXXX dtable::build_fhandl
 X X [main] tee XXXX fhandler_base::set_flags: flags 0x10002, supplied_bin 0x0
 X X [main] tee XXXX fhandler_base::set_flags: O_TEXT/O_BINARY set in flags 0x10000
 X X [main] tee XXXX fhandler_base::set_flags: filemode set to binary
-X X [main] tee XXXX fhandler_base::init: created new fhandler_base for handle 0x2A8, bin 1
-X X [main] tee XXXX dtable::init_std_file_from_handle: fd 0, handle 0x2A8
+X X [main] tee XXXX fhandler_base::init: created new fhandler_base for handle 0x2A4, bin 1
+X X [main] tee XXXX dtable::init_std_file_from_handle: fd 0, handle 0x2A4
 X X [main] tee XXXX normalize_posix_path: src /dev/conout
 X X [main] tee XXXX normalize_posix_path: /dev/conout = normalize_posix_path (/dev/conout)
 X X [main] tee XXXX mount_info::conv_to_win32_path: conv_to_win32_path (/dev/conout)
@@ -302,38 +302,41 @@ X X [main] tee XXXX _cygwin_istext_for_s
 X X [main] tee XXXX setmode_helper: setmode: file was raw now raw
 X X [main] tee XXXX setmode: setmode (3</tmp/shtest/test.out>, 0x10000) returns binary
 X X [main] tee XXXX readv: readv (0, 0x22FA60, 1) blocking, sigcatchers 0
-X X [read_pipe] tee XXXX fhandler_base::read: returning 1, binary mode
-X X [main] tee XXXX readv: 1 = readv (0, 0x22FA60, 1), errno 0
-X X [main] tee XXXX writev: writev (1, 0x22F980, 1)
-X X [main] tee XXXX fhandler_console::write: 22FA90, 1
-X X [main] tee XXXX fhandler_console::write: at 10(0x20) state is 0
-X X [main] tee XXXX fhandler_console::write: 1 = write_console (,..1)
-X X [main] tee XXXX writev: 1 = write (1, 0x22F980, 1), errno 0
-X X [main] tee XXXX writev: writev (3, 0x22F980, 1)
-X X [main] tee XXXX fhandler_base::write: binary write
-X X [main] tee XXXX fhandler_base::write: 1 = write (0x22FA90, 1)
-X X [main] tee XXXX writev: 1 = write (3, 0x22F980, 1), errno 0
-X X [main] tee XXXX readv: readv (0, 0x22FA60, 1) blocking, sigcatchers 0
-X X [read_pipe] tee XXXX fhandler_base::read: returning 0, binary mode
-X X [main] tee XXXX readv: 0 = readv (0, 0x22FA60, 1), errno 0
-X X [main] tee XXXX close: close (3)
-X X [main] tee XXXX fhandler_base::close: closing '/tmp/shtest/test.out' handle 0x108
-X X [main] tee XXXX close: 0 = close (3)
-X X [main] tee XXXX close: close (0)
-X X [main] tee XXXX fhandler_base::close: closing '/dev/piper' handle 0x2A8
-X X [main] tee XXXX close: 0 = close (0)
-X X [main] tee XXXX do_exit: do_exit (0)
-X X [main] tee XXXX void: 0x0 = signal (20, 0x1)
-X X [main] tee XXXX void: 0x0 = signal (1, 0x1)
-X X [main] tee XXXX void: 0x0 = signal (2, 0x1)
-X X [main] tee XXXX void: 0x0 = signal (3, 0x1)
-X X [main] tee XXXX fhandler_console::close: decremented open_fhs, now 1
-X X [main] tee XXXX fhandler_console::close: decremented open_fhs, now 0
-X X [main] tee XXXX sigproc_terminate: entering
-X X [main] tee XXXX proc_terminate: nchildren 0, nzombies 0
-X X [main] tee XXXX proc_terminate: leaving
-X X [main] tee XXXX __to_clock_t: dwHighDateTime 0, dwLowDateTime 200288
-X X [main] tee XXXX __to_clock_t: total 00000000 00000014
-X X [main] tee XXXX __to_clock_t: dwHighDateTime 0, dwLowDateTime 200288
-X X [main] tee XXXX __to_clock_t: total 00000000 00000014
-X X [main] tee XXXX _pinfo::exit: Calling ExitProcess 0
+X X [sig] tee XXXX wait_sig: awake
+X X [sig] tee XXXX wait_sig: processing signal 0
+X X [sig] tee XXXX pinfo::init: execed process windows pid 1748, cygwin pid 1788
+X X [sig] tee XXXX pinfo::init: execed process windows pid 1840, cygwin pid 1820
+X X [sig] tee XXXX pinfo::init: execed process windows pid 1996, cygwin pid 452
+X X [sig] tee XXXX pinfo::init: execed process windows pid 2068, cygwin pid 2048
+X X [sig] tee XXXX pinfo::init: execed process windows pid 2176, cygwin pid 2148
+X X [sig] tee XXXX pinfo::init: execed process windows pid 2264, cygwin pid 2232
+X X [sig] tee XXXX pinfo::init: execed process windows pid 3164, cygwin pid 2980
+X X [sig] tee XXXX pinfo::init: execed process windows pid 3304, cygwin pid 2856
+X X [sig] tee XXXX pinfo::init: execed process windows pid 3728, cygwin pid 3820
+X X [sig] tee XXXX pinfo::init: execed process windows pid 3932, cygwin pid 3980
+X X [sig] tee XXXX pinfo::init: execed process windows pid 2908, cygwin pid 3740
+X X [sig] tee XXXX pinfo::init: execed process windows pid 3880, cygwin pid 3800
+X X [sig] tee XXXX handle_exceptions: In cygwin_except_handler exc 0xC0000005 at 0x610BA041 sp 0x7DFE70
+X X [sig] tee XXXX handle_exceptions: In cygwin_except_handler sig = 11 at 0x610BA041
+X X [sig] tee XXXX handle_exceptions: In cygwin_except_handler calling 0x0
+X X [sig] tee XXXX handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
+X X [sig] tee XXXX try_to_debug: debugger_command ''
+X X [sig] tee XXXX open_stackdumpfile: Dumping stack trace to tee.exe.stackdump
+X X [sig] tee XXXX signal_exit: about to call do_exit (18B00)
+X X [sig] tee XXXX do_exit: do_exit (101120)
+X X [sig] tee XXXX void: 0x0 = signal (20, 0x1)
+X X [sig] tee XXXX void: 0x0 = signal (1, 0x1)
+X X [sig] tee XXXX void: 0x0 = signal (2, 0x1)
+X X [sig] tee XXXX void: 0x0 = signal (3, 0x1)
+X X [sig] tee XXXX fhandler_base::close: closing '/dev/piper' handle 0x2A4
+X X [sig] tee XXXX fhandler_console::close: decremented open_fhs, now 1
+X X [sig] tee XXXX fhandler_console::close: decremented open_fhs, now 0
+X X [sig] tee XXXX fhandler_base::close: closing '/tmp/shtest/test.out' handle 0x108
+X X [sig] tee XXXX sigproc_terminate: entering
+X X [sig] tee XXXX proc_terminate: nchildren 0, nzombies 0
+X X [sig] tee XXXX proc_terminate: leaving
+X X [sig] tee XXXX __to_clock_t: dwHighDateTime 0, dwLowDateTime 500720
+X X [sig] tee XXXX __to_clock_t: total 00000000 00000032
+X X [sig] tee XXXX __to_clock_t: dwHighDateTime 0, dwLowDateTime 300432
+X X [sig] tee XXXX __to_clock_t: total 00000000 0000001E
+X X [sig] tee XXXX _pinfo::exit: Calling ExitProcess 101120
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list