... sort tt | /usr/bin/less process attached to gdb using -p Terminate less with 'q' while process is running 64-@@ ./gdb.sh 5180 ... Attaching to process 5140 [New Thread 5140.0xd80] [New Thread 5140.0xc08] [New Thread 5140.0x1a2c] Reading symbols from /usr/bin/sort.exe...Reading symbols from /usr/lib/debug//usr/bin/sort.exe.dbg...done. done. 0x0000000076f6afb1 in ntdll!DbgBreakPoint () from /drv/c/Windows/SYSTEM32/ntdll.dll (gdb) cont Continuing. [Thread 5140.0x1a2c exited with code 0] Program received signal SIGPIPE, Broken pipe. [Switching to Thread 5140.0xd80] 0x00000001004026f6 in write_line (line=0xffffb9d0, fp=0x134, output_file=0xb0 ) at /usr/src/debug/coreutils-8.26-2/src/sort.c:2792 2792 if (fwrite (buf, 1, n_bytes, fp) != n_bytes) (gdb) bt #0 0x00000001004026f6 in write_line (line=0xffffb9d0, fp=0x134, output_file=0xb0 ) at /usr/src/debug/coreutils-8.26-2/src/sort.c:2792 #1 0x00000000ffffb9cc in ?? () Backtrace stopped: previous frame inner to this frame (corrupt stack?) (gdb) cont Continuing. Program received signal SIGPIPE, Broken pipe. 0x00000001004026f6 in write_line (line=0xffffb520, fp=0x134, output_file=0xb0 ) at /usr/src/debug/coreutils-8.26-2/src/sort.c:2792 2792 if (fwrite (buf, 1, n_bytes, fp) != n_bytes) (gdb) bt #0 0x00000001004026f6 in write_line (line=0xffffb520, fp=0x134, output_file=0xb0 ) at /usr/src/debug/coreutils-8.26-2/src/sort.c:2792 #1 0x00000000ffffb51c in ?? () Backtrace stopped: previous frame inner to this frame (corrupt stack?) (gdb) cont Continuing. Program received signal SIGSEGV, Segmentation fault. 0x0000000076f385fd in ntdll!RtlUnwindEx () from /drv/c/Windows/SYSTEM32/ntdll.dll (gdb) bt #0 0x0000000076f385fd in ntdll!RtlUnwindEx () from /drv/c/Windows/SYSTEM32/ntdll.dll #1 0x000000018005eba3 in __unwind_single_frame (ctx=0xffffde50) at /usr/src/debug/cygwin-2.9.0-3/winsup/cygwin/exceptions.cc:287 #2 _cygtls::call_signal_handler (this=0xffffce00) at /usr/src/debug/cygwin-2.9.0-3/winsup/cygwin/exceptions.cc:1660 #3 0x00000001801211ad in sig_send (p=, p@entry=0x180010000, si=..., tls=tls@entry=0x0) at /usr/src/debug/cygwin-2.9.0-3/winsup/cygwin/sigproc.cc:735 #4 0x000000018011db41 in _pinfo::kill (this=0x180010000, si=...) at /usr/src/debug/cygwin-2.9.0-3/winsup/cygwin/signal.cc:249 #5 0x000000018011dfe9 in kill0 (pid=5180, si=...) at /usr/src/debug/cygwin-2.9.0-3/winsup/cygwin/signal.cc:300 #6 0x000000018011e1ba in kill (sig=13, pid=) at /usr/src/debug/cygwin-2.9.0-3/winsup/cygwin/signal.cc:309 #7 raise (sig=sig@entry=13) at /usr/src/debug/cygwin-2.9.0-3/winsup/cygwin/signal.cc:285 #8 0x00000001800676c9 in fhandler_base_overlapped::wait_overlapped (this=this@entry=0x1802fde40, inres=, writing=writing@entry=true, bytes=bytes@entry=0xffffbe6c, nonblocking=false, len=65536) at /usr/src/debug/cygwin-2.9.0-3/winsup/cygwin/fhandler.cc:2035 #9 0x0000000180067c31 in fhandler_base_overlapped::raw_write (this=0x1802fde40, ptr=0x600039b00, len=65536) at /usr/src/debug/cygwin-2.9.0-3/winsup/cygwin/fhandler.cc:2141 #10 0x0000000180062426 in fhandler_base::write (this=0x1802fde40, ptr=0x600039b00, len=65536) at /usr/src/debug/cygwin-2.9.0-3/winsup/cygwin/fhandler.cc:852 #11 0x0000000180131bd6 in write (fd=1, ptr=0x600039b00, len=65536) at /usr/src/debug/cygwin-2.9.0-3/winsup/cygwin/syscalls.cc:1232 #12 0x00000001801c4033 in _write_r (ptr=0xffffd680, fd=, buf=, cnt=) at /usr/src/debug/cygwin-2.9.0-3/newlib/libc/reent/writer.c:58 #13 0x000000018017fb48 in __sflush_r (ptr=ptr@entry=0xffffd680, fp=fp@entry=0x1801fc870 ) at /usr/src/debug/cygwin-2.9.0-3/newlib/libc/stdio/fflush.c:225 #14 0x000000018017fceb in _fflush_r (ptr=ptr@entry=0xffffd680, fp=fp@entry=0x1801fc870 ) at /usr/src/debug/cygwin-2.9.0-3/newlib/libc/stdio/fflush.c:281 #15 0x0000000180185471 in __sfvwrite_r (ptr=ptr@entry=0xffffd680, fp=fp@entry=0x1801fc870 , uio=uio@entry=0xffffc5c0) at /usr/src/debug/cygwin-2.9.0-3/newlib/libc/stdio/fvwrite.c:190 #16 0x0000000180185a49 in _fwrite_unlocked_r (ptr=0xffffd680, buf=, size=1, count=26, fp=0x1801fc870 ) at /usr/src/debug/cygwin-2.9.0-3/newlib/libc/stdio/fwrite.c:170 #17 0x0000000180185aaa in fwrite_unlocked (buf=, size=, count=, fp=) at /usr/src/debug/cygwin-2.9.0-3/newlib/libc/stdio/fwrite.c:211 #18 0x00000001801197eb in _sigfe () at sigfe.s:35 #19 0x00000001004026f6 in write_line (line=0x6fffffb6910, fp=fp@entry=0x1801fc870 , output_file=0x0) at /usr/src/debug/coreutils-8.26-2/src/sort.c:2792 #20 0x0000000100403bf5 in write_unique (line=, tfp=tfp@entry=0x1801fc870 , temp_output=temp_output@entry=0x0) at /usr/src/debug/coreutils-8.26-2/src/sort.c:3422 #21 0x0000000100405319 in mergelines_node (temp_output=0x0, tfp=0x1801fc870 , total_lines=8150, node=0x6000390a0) at /usr/src/debug/coreutils-8.26-2/src/sort.c:3485 #22 merge_loop (temp_output=0x0, tfp=0x1801fc870 , total_lines=8150, queue=0xffffc9d0) at /usr/src/debug/coreutils-8.26-2/src/sort.c:3553 #23 sortlines (lines=lines@entry=0x6ffffff1a50, nthreads=nthreads@entry=8, total_lines=8150, node=node@entry=0x6000390a0, queue=queue@entry=0xffffc9d0, tfp=0x1801fc870 , temp_output=temp_output@entry=0x0) at /usr/src/debug/coreutils-8.26-2/src/sort.c:3670 #24 0x00000001004103e0 in sort (nthreads=8, output_file=0x0, nfiles=, files=0x600000948) at /usr/src/debug/coreutils-8.26-2/src/sort.c:3976 #25 main (argc=2, argv=0xffffcc50) at /usr/src/debug/coreutils-8.26-2/src/sort.c:4770 (gdb) cont Continuing. [Inferior 1 (process 5140) exited with code 01] <==== as result of taskkill /f /im sort.exe (gdb) quit 64-@@ =====