delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/11/26/20:54:27

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: <20001127015342.12966.qmail@web116.yahoomail.com>
Date: Sun, 26 Nov 2000 17:53:42 -0800 (PST)
From: Earnie Boyd <earnie_boyd AT yahoo DOT com>
Subject: Re: Linking problem
To: Reuben Thomas <rrt1001 AT cam DOT ac DOT uk>, cygwin AT sources DOT redhat DOT com
MIME-Version: 1.0

--- Reuben Thomas <rrt1001 AT cam DOT ac DOT uk> wrote:
> 
> The first binary (exc3.exe) doesn't work, and crashes with the infamous
> 
> Application Error
> The application failed to initialize properly (0xc0000005). Click on OK to
> terminate the application
> 
> message in a Windows pop-up message box.
> 
> The second version (except.exe) runs correctly, producing "hi".
> 
> If I run exc3.exe in gdb (gdb --nw exc3.exe, then run) I get three SIGSEGVs,
> before the error "Program exited with code 0200", then the rather bizarre
> "You can't do that without a process to debug."
> 
> The only difference between the two sets of libraries used is the order in
> which the directories holding them were created. If I create a third set of
> directories in the same order as those used to link except.exe, and copy the
> import libraries into them, everything works.
> 

Here's the deal, you're addressing uninitialized pointers.  The addresses
you're addressing are changed by the mear moving of objects so that in one case
your addressing memory outside of the allocated memory for the process and in
the other case your addressing memory within the allocated memory for the
process.  You may even find that executing the "program that works" may give
SIGSEGV if started by gdb or even strace.  Often a program that SIGSEGV's will
not do so when started with gdb or strace.

Cheers,

=====
Earnie Boyd
mailto:earnie_boyd AT yahoo DOT com

---         <http://earniesystems.safeshopper.com>         ---
--- Cygwin: POSIX on Windows <http://gw32.freeyellow.com/> ---
---   Minimalist GNU for Windows <http://www.mingw.org/>   ---

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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