public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "azzie at astronet dot pl" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug libc/10411] Segfault with non-existent directory in LD_LIBRARY_PATH
Date: Mon, 02 Nov 2009 18:12:00 -0000	[thread overview]
Message-ID: <20091102181202.1775.qmail@sourceware.org> (raw)
In-Reply-To: <20090717190615.10411.azzie@astronet.pl>


------- Additional Comments From azzie at astronet dot pl  2009-11-02 18:12 -------
Sorry, I did not receive your previous message, just the closing one.

Concrete example:

marcin@marcade ~ $ export LD_LIBRARY_PATH="/lame"
marcin@marcade ~ $ display
Segmentation fault

I'm using:

glibc: 2.9
ImageMagick: 6.5.2.9

I don't think it's anything ancient, but I again looked at the current git tree
and I am still wondering whether the following logic is correct:

1. dl-load.c:137 defines env_path_list as the following global variable and
attribute_relro

static struct r_search_path_struct env_path_list attribute_relro;

2. dl-load.c:2082 passes env_path_list to open_path()

fd = open_path (name, namelen, preloaded, &env_path_list,
                &realname, &fb,
                loader ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded,
                LA_SER_LIBPATH, &found_other_class);

3. dl-load.c:1946 might write to this attribute_relro (if none of the
directories exist)

static int
open_path (const char *name, size_t namelen, int preloaded,
           struct r_search_path_struct *sps, char **realname,
           struct filebuf *fbp, struct link_map *loader, int whatcode,
           bool *found_other_class)
{
   ...

   /* rtld_search_dirs is attribute_relro, therefore avoid writing
      into it.  */

   if (sps != &rtld_search_dirs)
      sps->dirs = (void *) -1;
   }

Note that there is a check whether sps is rtld_search_dirs but not whether it is
env_path_list - which also seems to be attribute_relro. Is this logic correct?
It segfaults for me at this very line. Your mileage may vary, but I'm suspicious
about the code itself.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |


http://sourceware.org/bugzilla/show_bug.cgi?id=10411

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


  parent reply	other threads:[~2009-11-02 18:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-17 19:06 [Bug libc/10411] New: " azzie at astronet dot pl
2009-08-01  3:52 ` [Bug libc/10411] " drepper at redhat dot com
2009-10-30  5:51 ` drepper at redhat dot com
2009-11-02 18:12 ` azzie at astronet dot pl [this message]
2009-11-02 18:22 ` azzie at astronet dot pl

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=20091102181202.1775.qmail@sourceware.org \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@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).