From: NG Chi Fai Newsgroups: comp.os.msdos.djgpp,comp.lang.c++ Subject: Problems using CYGWIN Date: Sun, 16 May 1999 23:47:56 -0700 Organization: oronet, Penn Valley, C Lines: 55 Message-ID: <373FBB9C.FE26B278@netvigator.com> NNTP-Posting-Host: gv1-241.oro.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 17 May 1999 06:48:39 GMT X-Mailer: Mozilla 4.51 [en] (Win95; I) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hello, I used DJGPP and CYGWIN to compile the following code. DJGPP runs as expected while CYGWIN reports Program received signal SIGSEGV, Segmentation fault. 0x6105b0f3 in _size_of_stack_reserve__ () Please help solve the problem. It seems the Segmentation fault happens after the cout << line. However, there is something wrong before the cout << line because the output data are corrupted. // code follows, I've removed some lines that I think is irrelevant. #include template < class T > class a { private: public: T* t; a(void) {t=new T[256];}; ~a(void) {delete[] t;}; template < class U > a & operator = (const a &v) { int i; for(i=0;i<256;i++) { t[i]=T(v.t[i]); } return *this; }; void fill ( const T & h) { ... }; a duplicate(void) { a temp; temp=*this; return temp; }; friend ostream & operator << (ostream& out, const a& t); }; int main(void) { a b; a c; a d; b.fill (99); c.fill (88.888); d=b; b=c; c.duplicate(); cout << b << c << d; return 0; }