rtld dropping core on recent -current

Alexander Kabaev kabaev at gmail.com
Fri Aug 3 11:20:34 UTC 2012


On Fri, 3 Aug 2012 11:59:37 +0300
Konstantin Belousov <kostikbel at gmail.com> wrote:

> On Thu, Aug 02, 2012 at 09:55:36PM -0400, Alexander Kabaev wrote:
> > It is weird that program tries to dlopen what appears to be the
> > binary (itself?), but that did uncover the issue. Please try
> > attached patch, I only very lightly tested it here.
> > 
> > Also available here:
> > http://people.freebsd.org/~kan/rtld-digest-notes.diff
> > 
> > -- 
> > Alexander Kabaev
> 
> diff --git a/libexec/rtld-elf/map_object.c
> b/libexec/rtld-elf/map_object.c index 509a64f..350d437 100644
> --- a/libexec/rtld-elf/map_object.c
> +++ b/libexec/rtld-elf/map_object.c
> @@ -153,7 +153,6 @@ map_object(int fd, const char *path, const struct
> stat *sb) break;
>  	    note_start = (Elf_Addr)(char *)hdr + phdr->p_offset;
>  	    note_end = note_start + phdr->p_filesz;
> -	    digest_notes(obj, note_start, note_end);
>  	    break;
>  	}
>  
> @@ -292,6 +291,11 @@ map_object(int fd, const char *path, const
> struct stat *sb) obj->relro_page = obj->relocbase +
> trunc_page(relro_page); obj->relro_size = round_page(relro_size);
>  
> +    if (note_start < note_end)
> +    {
> +	digest_notes(obj, note_start, note_end);
> +    }
> +
>      munmap(hdr, PAGE_SIZE);
>      return (obj);
>  
> This is the right fix.
> 
> Why do you need the '{}' there ?

I do not. I just automatically followed style used at work. I'll
FreeBSD-fy this before commit.

-- 
Alexander Kabaev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20120803/4b95d2f0/signature.pgp


More information about the freebsd-current mailing list