static vs. shared linking

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Mar 31 09:07:00 GMT 2015


On Mar 30 20:15, David Stacey wrote:
> On 30/03/15 11:55, Corinna Vinschen wrote:
> >On Mar 25 22:42, David Stacey wrote:
> >>I've never had much joy out of addr2line before, and I'm struggling to
> >>recreate what you've done. I've added '-g' to the command line, run 'go.sh'
> >>again. This generates a fresh stackdump file, and then I do:
> >>awk '/^[0-9]/{print $2}' shared_test.exe.stackdump | addr2line -f -e
> >>shared_test.exe
> >>but I just see question marks. Please could you show the exact lines you're
> >>using.
> >addr2line is a bit dumb and needs help.  What I do is to cat the
> >stackdump file and look at the addresses.  They usually show where
> >the stuff comes from:
> >[...]
> 
> Thank you for your reply and the explanation. That requires quite a bit of
> knowledge before addr2line is usable - no wonder I've never had anything
> sensible out of it before!
> 
> Back to the matter in hand - I don't suppose you had thoughts on why my
> simple application crashes when linked as shared, but works fine when linked
> statically?

No, sorry.  This may be a c++11 thingy which requires "something" in
libstdc++ and Cygwin, but I don't know what that could be.  It's
especially weird that free() aborts.  This points to some malloc/free
inconsistency, as if the malloc (or new) call used another
implementation of malloc than the aborting free call.  It may also
be a memory overflow issue but that would show up on other platforms
as well.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20150331/4184e81f/attachment.sig>


More information about the Cygwin mailing list