public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: pw <p.willis@telus.net>
To: cygwin@cygwin.com
Subject: Re: _cygtls::handle_exceptions  and segmentation fault while running   bash script
Date: Thu, 20 Dec 2007 00:36:00 -0000	[thread overview]
Message-ID: <47698460.408@telus.net> (raw)
In-Reply-To: <47695D32.3020309@telus.net>

pw: wrote
> An input file mock up script is as follows (tested/works):
> 
> #!/bin/bash
> #mockup_input_files.sh
> 
> mkdir final
> mkdir sunshine
> 
> for FNUM in `seq 1 26`;do
>     OFILE=`echo $FNUM| awk '{print "./final/test_file_" $1 ".final.txt"}'`;
>     echo 
> "HEADER|HEADER|HEADER|HEADER|HEADER|HEADER|HEADER|HEADER|HEADER" > $OFILE
> 
>     for L in `seq 1 992`; do
>         LINE=`echo 9|awk '{for(i=1;i<=$1;i++){printf("%d000", 
> i);if(i<9){printf("|");}} printf("\n");}'`;
>         echo "$LINE" >> $OFILE;
>     done
> done
> 
>  find -type f -iname '*.final.txt' | awk -F "/" '{print $NF 
> "|73.056977|6986" }'>latitudes.txt
> 
> #END OF SCRIPT


This script only produces 9 columns of data. Running the
problem script against this mocked up data didn't cause any
exceptions.

I modified the script as follows to allow easier adjustment of
the number of columns in the mock up input data:

#!/bin/bash

mkdir final
mkdir sunshine

export COLUMNS=16

for FNUM in `seq 1 26`;do
	OFILE=`echo $FNUM| awk '{print "./final/test_file_" $1 ".final.txt"}'`;
	
	LINE=`echo $COLUMNS|awk 
'{for(i=1;i<=$1;i++){printf("HEADER_%d",i);if(i<$1){printf("|");}} 
printf("\n");}'`;
	echo "$LINE" > $OFILE;

	for L in `seq 1 992`; do
		LINE=`echo $COLUMNS|awk 
'{for(i=1;i<=$1;i++){printf("%d000",i);if(i<$1){printf("|");}} 
printf("\n");}'`;
		echo "$LINE" >> $OFILE;
	done
	unix2dos $OFILE;
done
#END OF SCRIPT

Using 9 columns didn't cause an exception or segfault.
I increased the number of columns to 16 and ran the other
problematic script again and again no exception or segfault.
(??) I am wondering if the Windows XP system is actually
violating the stack and not cygwin.


Peter

--
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/

      reply	other threads:[~2007-12-19 20:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-19 19:40 pw
2007-12-20  0:36 ` pw [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47698460.408@telus.net \
    --to=p.willis@telus.net \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).