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 Delivered-To: mailing list cygwin AT cygwin DOT com From: "Markus Hoenicka" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15437.57169.404000.997498@gargle.gargle.HOWL> Date: Tue, 22 Jan 2002 21:53:21 +0000 To: cygwin AT cygwin DOT com Subject: C++ dll segfault problem X-Mailer: VM 6.94 under Emacs 20.6.1 Hi, I'm stuck with a problem building dynamically linked versions of OpenJade, onsgmls etc. (http://sourceforge.net/projects/openjade). The statically linked versions build out of the box and run without problems. Building the dlls and the dynamically linked versions is also no major problem, using dllhelpers-0.2.9. However, the dynamically linked versions segfault *after* they create all output they should create. Please keep in mind that this segfault appears nowhere else. The static Cygwin build is ok. Static and dynamic builds on various other operating systems and architectures are ok as well. It also does not affect the function of the programs. This makes me suspect that there is some weird platform-specific problem during deallocating memory when the dlls are unloaded on exit. I've been trying to debug this (I have to admit that my command of C++ is poor and my knowledge about the inner workings of dlls is even worse). What I see in gdb is that the programs indeed crash in a destructor. For the heck of it I modified this destructor, removing the code that frees memory. Sure enough it segfaults in another destructor. It is as if the memory is long gone at the time where the code tries to deallocate it. I've also tried to get some insight from strace. strace in this case has the unique ability to *prevent* the segfault, so the stack traces of the statically and dynamically linked binaries are pretty much identical. Is there any known issue about dlls generated from C++ code? Are there any tricks to properly debug this situation? Any help is greatly appreciated. regards, Markus -- Markus Hoenicka, PhD UT Houston Medical School Dept. of Integrative Biology and Pharmacology 6431 Fannin MSB4.114 Houston, TX 77030 (713) 500-6313, -7477 (713) 500-7444 (fax) Markus DOT Hoenicka AT uth DOT tmc DOT edu http://ourworld.compuserve.com/homepages/hoenicka_markus/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/