Zev Weiss <[EMAIL PROTECTED]> wrote: > I'm trying to recover some data from a disk that was unexpectedly > reformatted, and am running into a segmentation fault, though it's > not clear from the output whether it's coming from dd or egrep (hence > this email being sent to both grep and coreutils). I'm running the > following command in bash: > > dd if=/dev/sdc | egrep -A 50 -B 50 -a '^[\\\:]\ [^\ \t\n]{1,15}\ \(\ > [A-Za-z0-9\ ]{0,15}\ \-\-\ [A-Za-z0-9\ ]{0,15}\ \)$' > ./outputfile > > (Looking for telltale signs of Forth source code.) > > It runs for about about two minutes and then fails with a segfault, > though the console output doesn't tell which process segfaulted. I'm > running Fedora 8 x86_64 with Linux kernel version 2.6.23.1-42.fc8 (in > runlevel 3, for what it's worth). > > dd is version 6.9 > egrep is version 2.5.1 > bash is version 3.2.25(1)-release (x86_64-redhat-linux-gnu) [if that's > of any relevance]
Thanks for taking the time to report it. Rerun the pipeline, using strace on one command at a time or both. I'd log egrep's syscalls first: dd if=/dev/sdc | strace -o egrep-log \ egrep -A 50 -B 50 -a '^[\\\:]\ [^\ \t\n]{1,15}\ \(\ [A-Za-z0-9\ ]{0,15}\ \-\-\ [A-Za-z0-9\ ]{0,15}\ \)$' > ./outputfile Then when it segfaults, look at egrep-log. If that's not helpful, do it for dd instead. Or easier still, just eliminate dd and the pipeline: egrep -A 50 -B 50 -a '^[\\\:]\ [^\ \t\n]{1,15}\ \(\ [A-Za-z0-9\ ]{0,15}\ \-\-\ [A-Za-z0-9\ ]{0,15}\ \)$' < /dev/sdc > ./outputfile if that fails, it's egrep's fault. _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils