[no subject]

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


----------  Forwarded Message  ----------

Subject: [sam@xxxxxxxxxx: allegro crashes when unloading the svgalib module]
Date: Sun, 6 Apr 2003 13:49:29 +0200
From: Eduard Bloch <blade@xxxxxxxxxx>
To: ebotcazou@xxxxxxxxxx, gradha@xxxxxxxxxx

Hi people,

I got the attached bug report and it sounds pretty reasonable for me.
Please fix it in the next release.

MfG,
Eduard.
--
Condense soup, not books!

-------------------------------------------------------


Peter, why did we not do that when the problem was detected a long time ago?

-- 
Eric Botcazou
--------------Boundary-00=_22CX3SD980JRPF60CU6E
Content-Type: message/rfc822;
  charset="us-ascii";
  name="Attachment: 1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Received: (at submit) by bugs.debian.org; 5 Apr 2003 21:47:37 +0000
Return-path: <sam@xxxxxxxxxx>
Received: from zen.via.ecp.fr [138.195.130.71] 
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 191vVg-00037t-00; Sat, 05 Apr 2003 15:47:36 -0600
Received: by zen.via.ecp.fr (Postfix, from userid 10072)
	id E6D0A3AC53; Sat,  5 Apr 2003 23:47:04 +0200 (CEST)
Date: Sat, 5 Apr 2003 23:47:04 +0200
From: Sam Hocevar <sam@xxxxxxxxxx>
To: submit@xxxxxxxxxx
Subject: allegro crashes when unloading the svgalib module
Message-ID: <20030405214704.GP29771@xxxxxxxxxx>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="z6Eq5LdranGa6ru8"
Content-Disposition: inline
User-Agent: Mutt/1.3.28i
Mail-Copies-To: nobody
X-No-CC: I read mailing-lists; do not CC me on replies.
Delivered-To: submit@xxxxxxxxxx
X-Spam-Status: No, hits=-2.8 required=4.0
	tests=HAS_PACKAGE,PATCH_UNIFIED_DIFF,SPAM_PHRASE_00_01,
	      USER_AGENT,USER_AGENT_MUTT
	version=2.44
X-Spam-Level: 


--z6Eq5LdranGa6ru8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: allegro
Version: 2:4.0.2-1.1
Tags: patch upstream
Severity: important

   The /usr/lib/allegro/4.0/alleg-svgalib.so module uses the svgalib
library which calls atexit() to register a function to be executed at
program exit. But allegro unloads alleg-svgalib.so, which causes the
unloading of svgalib, and at program exit the function is not in an
allocated section, which causes a crash.

   Suggested fix attached. It just disables the unloading of modules
containing the string "svgalib".

-- 
Sam.

--z6Eq5LdranGa6ru8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="patch-allegro-svgalib.diff"

--- allegro-4.0.2/src/unix/umodules.c	2002-07-03 22:18:09.000000000 +0200
+++ allegro4-4.0.2-patch/src/unix/umodules.c	2003-04-05 22:44:52.000000000 +0200
@@ -32,6 +32,7 @@
 {
    void *handle;
    struct MODULE *next;
+   int unsafe;
 } MODULE;
 
 
@@ -119,6 +120,7 @@
       if (m) {
 	 m->handle = handle;
 	 m->next = module_list;
+	 m->unsafe = strstr (filename, "svgalib") ? 1 : 0;
 	 module_list = m;
       }
    }
@@ -141,7 +143,8 @@
       shutdown = dlsym(m->handle, "_module_shutdown");
       if (shutdown)
          shutdown();
-      dlclose(m->handle);
+      if (!m->unsafe)
+	 dlclose(m->handle);
       free(m);
    }
    

--z6Eq5LdranGa6ru8--



--------------Boundary-00=_22CX3SD980JRPF60CU6E--





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/