delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/10/02/10:47:57

Message-Id: <200110021447.f92EltJ00360@delorie.com>
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
From: "Mark Paulus" <commpg AT yahoo DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Date: Tue, 02 Oct 2001 08:45:35 -0600
Reply-To: "Mark Paulus" <commpg AT yahoo DOT com>
X-Mailer: PMMail 2000 Professional (2.20.2350) For Windows 2000 (5.0.2195;2)
MIME-Version: 1.0
Subject: Strange behaviour: Static lib vs DLL

Hi,

I am attempting to port a program that has the ability to 
build an executable using either static libs or .dlls.
However, when I build/run this program with dlls, then it
gets a stackdump.  I have put in lots of fprintf(stderr, "In ...());
type messages, and what it looks like, is that one 
global class is actually being relocated or something equally 
wierd.....

Here is a snippet of the relevant logs, with some explanation:
from static build:

in pkgSystem()                    // Global constructor
in debSystem()                   //  Global constructor
In Configuration()               //  Global constructor
this = 0xA06D0F8             //  Address of (*this) (Duh)....
_config = 0x0                    //  Global object that this constructor is constructing
Root = 0xA06D108           //  Address of private data item being allocated (new)
_config = 0xA06D0F8       //  Address of object in main()
_config = 0xA06D0F8       //  Address of object in main() again (make sure it isn't corrupted)
In pkgInitConfig(), Cnf = 0xA06D0F8    //  Initialization function called.  Notice Cnf = this above
In Configuration::Set(Name = 'APT::Architecture', Value = 'cygwin-i386')
this = 0xA06D0F8             //  Within an object method.  same (*this)
Root = 0xA06D108          //   Same private data address
Entering Configuration::Lookup(const char *Name='APT::Architecture', Create = '1
')
this = 0xA06D0F8
Root = 0xA06D108
Non-null NAME
Root = 0xa06d108

Here is the same output, but generated by an exe that uses dlls
(pkgSystem, debSyste, and Configuration are contained w/in the dll)

in pkgSystem()
in debSystem()
In Configuration()
this = 0xA06D0F8
_config = 0x0
Root = 0xA06D108
_config = 0x355425FF	//  Notice that this address DOES NOT match (*this) above
_config = 0x355425FF
In pkgInitConfig(), Cnf = 0x355425FF
In Configuration::Set(Name = 'APT::Architecture', Value = 'cygwin-i386')
this = 0x355425FF
//  At this point, Root is Null, and program stackdumps....

Has anyone seen behaviour like this, or has any ideas as to why this might be happening???
any thoughts/leads/pointers would be appreciated.....



--
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/

- Raw text -


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