Bug 1081 - fix recursive dlclose
Summary: fix recursive dlclose
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.3.5
: P2 normal
Target Milestone: ---
Assignee: Roland McGrath
URL:
Keywords:
Depends on:
Blocks: libc236
  Show dependency treegraph
 
Reported: 2005-07-18 01:17 UTC by Roland McGrath
Modified: 2005-07-19 03:30 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roland McGrath 2005-07-18 01:17:49 UTC
This trunk patch should go into the 2.3 branch:

2005-04-26  Jakub Jelinek  <jakub@redhat.com>

	* elf/dl-close.c: Include stddef.h.
	(_dl_close): If called recursively, just remember GC needs to be rerun
	and decrease l_direct_opencount.  Avoid GC if l_direct_opencount
	decreased to 1.  Rerun GC at the end if any destructor unloaded some
	additional libraries.
	* elf/Makefile: Add rules to build and run unload6 test.
	* elf/unload6.c: New test.
	* elf/unload6mod1.c: New file.
	* elf/unload6mod2.c: New file.
	* elf/unload6mod3.c: New file.
Comment 1 cvs-commit@gcc.gnu.org 2005-07-18 01:19:53 UTC
Subject: Bug 1081

CVSROOT:	/cvs/glibc
Module name:	libc
Branch: 	glibc-2_3-branch
Changes by:	roland@sources.redhat.com	2005-07-18 01:19:49

Modified files:
	elf            : dl-close.c Makefile 

Log message:
	2005-04-26  Jakub Jelinek  <jakub@redhat.com>
	
	[BZ #1081]
	* elf/dl-close.c: Include stddef.h.
	(_dl_close): If called recursively, just remember GC needs to be rerun
	and decrease l_direct_opencount.  Avoid GC if l_direct_opencount
	decreased to 1.  Rerun GC at the end if any destructor unloaded some
	additional libraries.
	* elf/Makefile: Add rules to build and run unload6 test.
	* elf/unload6.c: New test.
	* elf/unload6mod1.c: New file.
	* elf/unload6mod2.c: New file.
	* elf/unload6mod3.c: New file.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/elf/dl-close.c.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.107.2.2&r2=1.107.2.3
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/elf/Makefile.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.287.2.4&r2=1.287.2.5

Comment 2 cvs-commit@gcc.gnu.org 2005-07-18 01:22:22 UTC
Subject: Bug 1081

CVSROOT:	/cvs/glibc
Module name:	libc
Branch: 	glibc-2_3-branch
Changes by:	roland@sources.redhat.com	2005-07-18 01:22:18

Added files:
	elf            : unload6mod1.c unload6mod2.c unload6mod3.c 
	                 unload6.c 

Log message:
	2005-04-26  Jakub Jelinek  <jakub@redhat.com>
	
	[BZ #1081]
	* elf/dl-close.c: Include stddef.h.
	(_dl_close): If called recursively, just remember GC needs to be rerun
	and decrease l_direct_opencount.  Avoid GC if l_direct_opencount
	decreased to 1.  Rerun GC at the end if any destructor unloaded some
	additional libraries.
	* elf/Makefile: Add rules to build and run unload6 test.
	* elf/unload6.c: New test.
	* elf/unload6mod1.c: New file.
	* elf/unload6mod2.c: New file.
	* elf/unload6mod3.c: New file.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/elf/unload6mod1.c.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=NONE&r2=1.1.4.1
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/elf/unload6mod2.c.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=NONE&r2=1.1.4.1
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/elf/unload6mod3.c.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=NONE&r2=1.1.4.1
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/elf/unload6.c.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=NONE&r2=1.1.4.1

Comment 3 Roland McGrath 2005-07-19 03:30:49 UTC
This fix is now in the 2.3 branch as well as the trunk, and the problem should
be resolved as of the 2.3.6 release.