public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Core dump on 32-bit Cygwin if program calls dlopen
Date: Wed, 16 Jul 2014 07:02:00 -0000	[thread overview]
Message-ID: <20140716070231.GA25020@calimero.vinschen.de> (raw)
In-Reply-To: <20140715143915.GA8330@calimero.vinschen.de>

[-- Attachment #1: Type: text/plain, Size: 2930 bytes --]

Hi JonY,

On Jul 15 16:39, Corinna Vinschen wrote:
> On Jul 15 21:55, JonY wrote:
> > On 7/15/2014 21:08, Corinna Vinschen wrote:
> > >>
> > >> FWIW, the problem disappears if I revert gcc-core and libgcc1 to 4.8.2-2.
> > > 
> > > JonY, do you have a chance to have a look into this issue?
> > > 
> > 
> > Sorry, I have been busy these few weeks, but I am well aware that there
> > is a problem with one of the libgcc changes, but has yet to investigate it.
> > 
> > I believe Jon Turney has looked into it somewhat.
> 
> Sounds good.  Thanks in advance.

Yesterday I asked my collegues to take a stab at the issue and one of
them, DJ Delorie, came up with a libgcc patch already.  It hasn't been
sent upstream yet.  Can we give it a try, perhaps by creating a new
libgcc DLL, please?

Thanks,
Corinna


Index: libgcc/config/i386/cygming-crtbegin.c
===================================================================
--- libgcc/config/i386/cygming-crtbegin.c	(revision 212546)
+++ libgcc/config/i386/cygming-crtbegin.c	(working copy)
@@ -99,12 +99,13 @@ static EH_FRAME_SECTION_CONST char __EH_
   = { };
 
 static struct object obj;
 
 /* Handle of libgcc's DLL reference.  */
 HANDLE hmod_libgcc;
+static void *  (*deregister_frame_fn) (const void *) = NULL;
 #endif
 
 #if TARGET_USE_JCR_SECTION
 static void *__JCR_LIST__[]
   __attribute__ ((used, section(JCR_SECTION_NAME), aligned(4)))
   = { };
@@ -130,15 +131,20 @@ __gcc_register_frame (void)
   if (h)
     {
       /* Increasing the load-count of LIBGCC_SONAME DLL.  */
       hmod_libgcc = LoadLibrary (LIBGCC_SONAME);
       register_frame_fn = (void (*) (const void *, struct object *))
 			  GetProcAddress (h, "__register_frame_info");
+      deregister_frame_fn = (void* (*) (const void *))
+	                    GetProcAddress (h, "__deregister_frame_info");
+    }
+  else
+    {
+      register_frame_fn = __register_frame_info;
+      deregister_frame_fn = __deregister_frame_info;
     }
-  else 
-    register_frame_fn = __register_frame_info;
   if (register_frame_fn)
      register_frame_fn (__EH_FRAME_BEGIN__, &obj);
 #endif
 
 #if TARGET_USE_JCR_SECTION 
   if (__JCR_LIST__[0])
@@ -158,19 +164,12 @@ __gcc_register_frame (void)
 }
 
 void
 __gcc_deregister_frame (void)
 {
 #if DWARF2_UNWIND_INFO
-  void *  (*deregister_frame_fn) (const void *);
-  HANDLE h = GetModuleHandle (LIBGCC_SONAME);
-  if (h)
-    deregister_frame_fn = (void* (*) (const void *))
-			  GetProcAddress (h, "__deregister_frame_info");
-  else 
-    deregister_frame_fn = __deregister_frame_info;
   if (deregister_frame_fn)
      deregister_frame_fn (__EH_FRAME_BEGIN__);
   if (hmod_libgcc)
     FreeLibrary (hmod_libgcc);
 #endif
 }

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-07-16  7:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-14 23:42 Ken Brown
2014-07-15  9:03 ` Corinna Vinschen
2014-07-15 11:45   ` Ken Brown
2014-07-15 13:08     ` Corinna Vinschen
2014-07-15 13:56       ` JonY
2014-07-15 14:39         ` Corinna Vinschen
2014-07-16  7:02           ` Corinna Vinschen [this message]
2014-07-16 22:03             ` JonY
2014-07-17  7:37               ` Corinna Vinschen
2014-07-17 15:31                 ` Jon TURNEY
2014-07-17 18:24                   ` Corinna Vinschen
2014-07-20 22:02                     ` JonY
2014-07-22  8:27                     ` Corinna Vinschen
2014-07-22 13:00                       ` Jon TURNEY
2014-07-22 13:20                         ` Corinna Vinschen
2014-07-24 13:08                           ` Kai Tietz
2014-07-24 13:45                             ` Corinna Vinschen
2014-07-24 22:15                               ` JonY
2014-07-25 12:37                                 ` Corinna Vinschen
2014-07-15 13:34 Houder
2014-07-15 14:45 Jan Nijtmans
2014-07-15 15:29 ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140716070231.GA25020@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).