This is the mail archive of the libc-hacker@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: segv in _dl_close


"Alexander V. Lukyanov" <lav@alpha.netis.ru> writes:

> >Description:
> 	apache-1.3.3-2 with mod_php3-3.0.5-2 (from Red Hat's Raw Hide)

I'm not sure whether this fixes your problem but I've found a problem
in _dl_close.  Please give the appended patch a try and let me know
about the result.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: dl-close.c
===================================================================
RCS file: /glibc/cvsfiles/libc/elf/dl-close.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- dl-close.c	1998/10/07 13:38:18	1.28
+++ dl-close.c	1999/01/16 16:40:08	1.29
@@ -1,5 +1,5 @@
 /* Close a shared object opened by `_dl_open'.
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -108,12 +108,11 @@
 	      do
 		--cnt;
 	      while (_dl_main_searchlist->r_list[cnt] != imap);
-	      while (cnt < _dl_main_searchlist->r_nlist)
-		{
-		  _dl_main_searchlist->r_list[0]
-		    = _dl_main_searchlist->r_list[1];
-		  ++cnt;
-		}
+
+	      while (++cnt < _dl_main_searchlist->r_nlist)
+		_dl_main_searchlist->r_list[cnt - 1]
+		  = _dl_main_searchlist->r_list[cnt];
+
 	      --_dl_main_searchlist->r_nlist;
 	      if (_dl_main_searchlist->r_nlist
 		  == _dl_initial_searchlist.r_nlist)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]