delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/09/15:27:03

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3AA93C60.11BB7B2D@tensilica.com>
Date: Fri, 09 Mar 2001 12:26:08 -0800
From: Sterling Augustine <Sterling AT tensilica DOT com>
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.16-3 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: 1.1.8 dllwrap stl static list destructors crash

Below is a set of sources for a simple program and dll. The dll contains
a static stl list. No operations are ever performed on this list, except
that it is constructed and destructed. When the the program exits, the
list's destructor is called, and it crashes (I'm fairly hazy on stl
internals, but my guess is that the list isn't constructed properly).
This crash doesn't occur if the list isn't inside a dll. 

To see this in operation, extract the files, and then type make.
dllcheck (which has the list in a dll) will crash. Any ideas on what's
wrong or how to fix it?

Files follow.

Thanks,

Sterling
sterling AT tensilica DOT com

>>>>>>>>>>>>>>>>
#Makefile to see an stl list inside a dll crash on deconstruction

dllcheck: bar.dll foo.o Makefile
 g++ -v -o dllcheck bar.dll foo.o 

foo.o: foo.cxx
 g++ -MD -g -c foo.cxx -o foo.o

bar.o: bar.cxx
 g++ -MD -g -c bar.cxx -o bar.o 

bar.dll: bar.o
 dllwrap --driver-name /usr/bin/g++.exe -target=i386-cygwin32
--export-all bar.o --dllname bar.dll

clean:
 rm -f bar.dll bar.o foo.o *.exe *~ *.d
>>>>>>>>>>>>>>>>>>>>

/* bar.cxx:

   the dll file. alist's deconstruction will cause a segfault 
*/

#include <list>

list <int> alist;

__declspec(dllexport) void do_nothing()
{
}

>>>>>>>>>>>>>>>>>>
/* foo.cxx:
   
   the main program. Note that it doesn't refer to the list.
*/

extern __declspec(dllimport) void do_nothing(void);

int main()
{
  do_nothing();
}

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019