public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
* [patch][commit] Follow Up to Recent libltdl Patch
@ 2007-01-24 21:46 Dave Brolley
  0 siblings, 0 replies; only message in thread
From: Dave Brolley @ 2007-01-24 21:46 UTC (permalink / raw)
  To: sid

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

Hi,

It turns out that my recent patch to correct a dangling pointer in 
sid/component/cfgroot/libltdl causes an infinite loop in the case that a 
resident dynamic library is in use by SID. I've committed the attached 
patch which corrects the problem. It also improves efficiency by only 
checking whether 'cur' is still in the linked list in the case that 
lt_dlclose was called.

Dave

[-- Attachment #2: sid-ltdl.ChangeLog --]
[-- Type: text/plain, Size: 160 bytes --]

2007-01-24  Dave Brolley  <brolley@redhat.com>

	* libltdl/ltdl.c (lt_dlexit): Make sure that 'cur' is not NULL before
	checking that it is still in the list.


[-- Attachment #3: sid-ltdl.patch.txt --]
[-- Type: text/plain, Size: 1456 bytes --]

Index: sid/component/cfgroot/libltdl/ltdl.c
===================================================================
RCS file: /cvs/src/src/sid/component/cfgroot/libltdl/ltdl.c,v
retrieving revision 1.4
diff -c -p -r1.4 ltdl.c
*** sid/component/cfgroot/libltdl/ltdl.c	17 Jan 2007 21:17:08 -0000	1.4
--- sid/component/cfgroot/libltdl/ltdl.c	24 Jan 2007 21:34:46 -0000
*************** lt_dlexit ()
*** 2329,2344 ****
  		    {
  		      ++errors;
  		    }
  		}
- 	      /* Make sure that the handle pointed to by 'cur' still exists.
- 		 lt_dlclose recursively closes dependent libraries which removes
- 		 them from the linked list.  One of these might be the one
- 		 pointed to by 'cur'.  */
- 	      for (tmp = handles; tmp; tmp = tmp->next)
- 		if (tmp == cur)
- 		  break;
- 	      if (! tmp)
- 		cur = handles;
  	    }
  	  /* done if only resident modules are left */
  	  if (!saw_nonresident)
--- 2329,2347 ----
  		    {
  		      ++errors;
  		    }
+ 		  /* Make sure that the handle pointed to by 'cur' still exists.
+ 		     lt_dlclose recursively closes dependent libraries which removes
+ 		     them from the linked list.  One of these might be the one
+ 		     pointed to by 'cur'.  */
+ 		  if (cur)
+ 		    {
+ 		      for (tmp = handles; tmp; tmp = tmp->next)
+ 			if (tmp == cur)
+ 			  break;
+ 		      if (! tmp)
+ 			cur = handles;
+ 		    }
  		}
  	    }
  	  /* done if only resident modules are left */
  	  if (!saw_nonresident)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-01-24 21:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-24 21:46 [patch][commit] Follow Up to Recent libltdl Patch Dave Brolley

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).