This is the mail archive of the libc-alpha@sourceware.org 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]
Other format: [Raw text]

Re: [PATCH 5/5][v2][BZ #15022] Remove dead DL_DST_REQ_STATIC code


On Thu, 20 Jun 2013, Roland McGrath wrote:

> That is fine.  It is not related to bug 15022 and does not depend on the
> previous patches in the series, so normal procedure would have been to post
> it separately from the series.

 Yeah, I think you're right, this should have really been standalone, 
sorry.  Thanks for your review.  I have applied this change now.

 While double-checking that I haven't missed anything here I've spotted 
another place where there's something odd about DL_DST_REQUIRED.  It is a 
reference in _dl_init_paths where we have this:

#ifdef SHARED
  /* This points to the map of the main object.  */
  l = GL(dl_ns)[LM_ID_BASE]._ns_loaded;
  if (l != NULL)
    {
[...]
    }
#endif  /* SHARED */
[...]
#ifdef SHARED
[...]
	  /* Determine the length of the substituted string.  */
	  size_t total = DL_DST_REQUIRED (l, llp, strlen (llp), cnt);
[...]

so clearly this code is somehow prepared for a missing main map in the 
shared case even though DL_DST_REQUIRED has never been and will crash in 
that case.

 I can see in the sources that _dl_init_paths is only called from two 
sites -- _dl_non_dynamic_init, that clearly doesn't apply here, and 
dl_main.  In the latter case the call is only made after the main map has 
already been initialised.  So perhaps that "if (l != NULL)" quoted above 
can really be "assert (l != NULL)"?  I'll send a patch proposal if so.

  Maciej


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