delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/05/09/04:44:23

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <50c702f0805090143y2f18668fl393f85a96308318f@mail.gmail.com>
Date: Fri, 9 May 2008 09:43:57 +0100
From: "=?ISO-8859-1?Q?Gloria_Mu=F1oz?=" <gloria DOT munoz DOT chueca AT gmail DOT com>
To: cygwin <cygwin AT cygwin DOT com>
Subject: cygtls::handle_exceptions: Error while dumping state
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hi all!

First of all hello everybody! because I've just joined
the list. I've had a lok into the Mailing list archive and I've seen
that this error has happened before to other people but each time the
solution was different and I haven't found the answer to my specific
case so here we go!


I'm just trying to read a .data file and create a .xls file to use
with excel; for that I've created the next simple program:

#include <stdio.h>

main (int argc, char* argv[])
{
    FILE *f1, *f2;


    char *file_name;
    int num_compressors = 0;
    int num_files = 0;
    int numC = 0;
    char *out_file;
    char *aux;
    char *ctime;

     if(argc != 2)
    {
      fprintf(stderr, "Use: %s nameOfFile\n", argv[0]);

      exit(1);
    }

     // Open source file
     if ((f1 = fopen(argv[1],"r")) == NULL){
    fprintf(stderr, "Can't open %s\n", argv[1]);
    exit(1);
      }

      fprintf(stderr, "%s opened\n", argv[1]);


      fscanf(f1,"%d",&num_compressors
);
      fprintf(stderr, "Number of compressors: %d\n", num_compressors);
      fscanf(f1,"%d",&num_files);
      fprintf(stderr, "Number of files: %d\n", num_files);


      do{
                  // THE PROBLEM SEEMS TO BEGIN HERE
           fscanf(f1,"%s",out_file);
           fprintf(stderr, "Name of compressor: %s\n", out_file);

       out_file = strcat(out_file, ".xls");
           fprintf(stderr, "Read name of the new file: %s\n", out_file);
           // Create new .xls file
          f2 = fopen (out_file, "w");

          if (f2==NULL){
             fprintf(stderr, "Can't open %s\n", out_file);
             exit(1);
          }

                fscanf(f1,"%s",file_name);
                fprintf(f2, "%s\t", file_name);

                fscanf(f1,"%s %s", aux, ctime);
                fprintf(f2, "%s\t", ctime);
               numC++;
        }while (numC < num_compressors);

  fclose(f1);
  fclose(f2);


}


The test .data file is called pruExcel.data and consist of:

1
1

gzip

to_mm_24.bin

real    0m0.614s
user    0m0.499s
sys    0m0.015s


And the output :


$ ./oExcel pruExcel.data
pruExcel.data opened
Number of compressors: 1
Number of files: 1
      7 [main] oExcel 2988 _cygtls::handle_exceptions: Error while dumping state
 (probably corrupted stack)
Segmentation fault (core dumped)

I'm working with Windows XP and CYGWIN_NT-5.1,

any idea would be appreciated!
Thanks!

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019