Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <431DDA71.7020207@familiehaase.de> Date: Tue, 06 Sep 2005 20:05:37 +0200 From: "Gerrit P. Haase" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 MIME-Version: 1.0 To: Andreas CC: cygwin AT cygwin DOT com Subject: Re: BUG report: destructor exception vector; DLL 1.5.18 References: <431775C6 DOT 7040609 AT sdl DOT com> In-Reply-To: <431775C6.7040609@sdl.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Andreas wrote: > Hello, > > I found a bug in the Cygwin environment that blocks me. I condensed the > problem into one C++ file: all.cc > I compiles OK, but crashes, when executed. > > I compiled the same file on a LINUX system, it runs there without a problem. > > To me it seems that the deallocation in the destructor fails, when the > object has a vector element. > > Please do: > g++ -Wall -g -o all.exe all.cc > all.exe > > and see if you can reproduce. > > My output is: > > 3 [main] all 2144 handle_exceptions: Exception: > STATUS_ACCESS_VIOLATION > 1559 [main] all 2144 open_stackdumpfile: Dumping stack trace to > all.exe.stackdump Ok, after another look I saw that your mailer wrapped the code, maybe you should change your mailer? $ ./all.C.exe TR> all.C : 262 | int main(int, char**) TR> all.C : 255 | void My::main_body(int, char**) TR> all.C : 225 | My::CG_Args::CG_Args(int, char**) TR> all.C : 152 | My::UT_Args::UT_Args(int, char**) TR> all.C : 145 | My::UT_Args::iArgs::iArgs() TR< My::UT_Args::iArgs::iArgs() ENDED. TR> all.C : 168 | void My::UT_Args::iArgs::process() TR> all.C : 105 | void My::Idx_Name::add(std::string) TR< void My::Idx_Name::add(std::string) ENDED. TR> all.C : 63 | void My::Name_Idx::add(std::string, int) TR< void My::Name_Idx::add(std::string, int) ENDED. TR< void My::UT_Args::iArgs::process() ENDED. TR< My::UT_Args::UT_Args(int, char**) ENDED. TR> all.C : 197 | void My::UT_Args::print(std::string) TR> all.C : 80 | void My::Name_Idx::print(std::string) NameIdx contents: 0: ./all.C -> 0 TR< void My::Name_Idx::print(std::string) ENDED. TR> all.C : 115 | void My::Idx_Name::print(std::string) IdxName contents: 0: ./all.C TR< void My::Idx_Name::print(std::string) ENDED. TR< void My::UT_Args::print(std::string) ENDED. TR> all.C : 177 | int My::UT_Args::getIdx(std::string) TR> all.C : 68 | int My::Name_Idx::getIdx(std::string) TR< int My::Name_Idx::getIdx(std::string) ENDED. TR< int My::UT_Args::getIdx(std::string) ENDED. TR> all.C : 177 | int My::UT_Args::getIdx(std::string) TR> all.C : 68 | int My::Name_Idx::getIdx(std::string) TR< int My::Name_Idx::getIdx(std::string) ENDED. TR< int My::UT_Args::getIdx(std::string) ENDED. TR> all.C : 177 | int My::UT_Args::getIdx(std::string) TR> all.C : 68 | int My::Name_Idx::getIdx(std::string) TR< int My::Name_Idx::getIdx(std::string) ENDED. TR< int My::UT_Args::getIdx(std::string) ENDED. TR> all.C : 204 | void My::UT_Args::getUnchecked() TR< void My::UT_Args::getUnchecked() ENDED. TR> all.C : 161 | My::UT_Args::~UT_Args() Mark before TR> all.C : 147 | My::UT_Args::iArgs::~iArgs() TR< My::UT_Args::iArgs::~iArgs() ENDED. Segmentation fault (core dumped) Core dumps here too. If I do as Brian suggested all is fine: int UT_Args::getIdx(string name) { Tracer tr(__FILE__,__LINE__,__PRETTY_FUNCTION__,true); int idx = p->nameIdx.getIdx(name); if (idx == -1) { p->checked[idx]=false; } else { p->checked[idx]=true; } return idx; } Gerrit -- 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/