public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
From: Dave Brolley <brolley@redhat.com>
To: sid@sources.redhat.com
Subject: [patch][commit] Follow Up to Recent libltdl Patch
Date: Wed, 24 Jan 2007 21:46:00 -0000	[thread overview]
Message-ID: <45B7D39B.4000007@redhat.com> (raw)

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

                 reply	other threads:[~2007-01-24 21:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=45B7D39B.4000007@redhat.com \
    --to=brolley@redhat.com \
    --cc=sid@sources.redhat.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).