This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: fail executing large code

Your suggestion was a simple but good idea.

I would like to explain my error:
I wrote a demo program to test my library, and the demo source contains
this line:

namespace Demo


    cout << "Hello" <<endl;


}//end namespace.

I suppose that you cannot put the function main() inside the namespace
but under linux the compilation works fine and so does the execution.
Under WinNT, with cygnus, again the compilation works fine but the
execution throws the exception mentioned in the first occurence of
ostream opeator '<<' invocation.

This is the gdb output:
GNU gdb 4.17.1
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
welcome to change it and/or distribute copies of it under certain
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
This GDB was configured as "i586-cygwin32"...
(gdb) break 134
Breakpoint 1 at 0x403276: file, line 134.
(gdb) run
Starting program:

Breakpoint 1, main (argc=1, argv=0xa030fe0) at
134		cout << "usage: "<<argv[0]<<" <cosa>  [<indexName>] [<pathFile>]" 
<< endl;
(gdb) list
129	      string    pathFileDirettive("direttive.txt");
130	      string    indexName("TReSyDemo");
133	      if (argc <= 1) {
134		cout << "usage: "<<argv[0]<<" <cosa>  [<indexName>] [<pathFile>]" 
<< endl;
135		cout << "         <cosa> 'crea'   -> crea l'indice su <pathFile>." 
<< endl;
136		cout << "                'mount'  -> monta l'indice <indexName> ed
eseguo debug_print."  << endl;
137		cout << "                'search' -> monta l'indice <indexName> e
esegue una search."  << endl;
138		cout << "         <indexName> nome dell'indice. Default
\""<<indexName<<"\"."  << endl;
(gdb) s
0x521c38 in ostream::operator<< () at
1987		}
(gdb) list
1982	static void yy_flex_free( ptr )
1983	void *ptr;
1984	#endif
1985		{
1986		free( ptr );
1987		}
1989	#if YY_MAIN
1990	int main()
1991		{
(gdb) quit
The program is running.  Exit anyway? (y or n) 

By moving the function main() out of the namespace the problem is
but I think that the compiler should trace this error.

Has anyone any suggestion o comment about it?

Chris Faylor wrote:
> Run your program under gdb to determine where it is dying.
> cgf
> On Mon, Oct 25, 1999 at 10:54:47AM +0200, Michele Paoli wrote:
> >hi all,
> >
> >executing an application compiled with cygnus r b20 i get this
> >exception:
> >
> >  [main] d:\utenti\Frecco\lavoro\project\TReSyDemo.exe 1761 (0)
> >handle_exceptions: Exception:  STATUS_ACCESS_VIOLATION
> >  [main] TReSyDemo 1761 (0) handle_exceptions: Dumping stack trace to
> >TReSyDemo.exe.core
> >
> >any one can suggest me which kind of problem?
> >The error arrive before any line of code was executed and smaller
> >program have not any problem.
> >
> >Thanks a lot.

  Michele Paoli - Computer Research for Cultural Heritage Centre
  via della Faggiola, 19 - 56126 Pisa (Italy)
  Phone  +39 (0)50 509409

Want to unsubscribe from this list?
Send a message to

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]