www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/05/09/04:58:26

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
X-Spam-Score: -0.1
Message-ID: <48241208.1070700@sh.cvut.cz>
Date: Fri, 09 May 2008 10:57:44 +0200
From: =?ISO-8859-1?Q?V=E1clav_Haisman?= <v DOT haisman AT sh DOT cvut DOT cz>
User-Agent: Thunderbird 2.0.0.14 (Windows/20080421)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: cygtls::handle_exceptions: Error while dumping state
References: <50c702f0805090143y2f18668fl393f85a96308318f AT mail DOT gmail DOT com>
In-Reply-To: <50c702f0805090143y2f18668fl393f85a96308318f@mail.gmail.com>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
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

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Gloria Muñoz wrote:
| 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);
You have forgotten to allocate some memory for your out_file buffer.

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

- --
VH
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREIAAYFAkgkEggACgkQjksRtmO2spfl3QCfVOjGhbVuHPDpXJJd6FT2uWq7
aCQAn3CMeGWSoU+Pn56mx4qsAnZCx84z
=1ql3
-----END PGP SIGNATURE-----

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