public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Robert Yang <liezhi.yang@windriver.com>
To: Mark Wielaard <mark@klomp.org>
Cc: <elfutils-devel@sourceware.org>
Subject: Re: [PATCH V2] libelf/elf_end.c: check data_list.data.d.d_buf before free it
Date: Mon, 03 Sep 2018 01:32:00 -0000	[thread overview]
Message-ID: <69a0a0fb-d09c-4580-f2cc-7962130a2d18@windriver.com> (raw)
In-Reply-To: <1535708136.13215.1.camel@klomp.org>



On 08/31/2018 05:35 PM, Mark Wielaard wrote:
> Hi Robert,
> 
> On Fri, 2018-08-31 at 10:17 +0800, Robert Yang wrote:
>> Sorry, I can't make sure which ones is wrong, libqb, prelink or
>> elfutils, this
>> happens when cross compiling, and I've built more than 4 hunderds of packages,
>> libqb 1.0.3 is the only package which has the problem, I've also fixed prelink,
>> but it is another segmentation fault error. I've reported this problem to libqb
>> community, then they make another branch for libqb, and it works well without
>> any errors, the branch is topic-no-ldsection, and the commit is:
>> https://github.com/ClusterLabs/libqb/commit/358e0120d8cd288095907869d3f8da92937188a0
> 
> So, this is a separate issue? Or does the prelink problem also go away
> when using that commit/branch?
> 
>> I've used gdb/valgrind to debug this segfault, but can't find prelink's distinct
>> problem, the only problem I found is that elfutil's elf_end() free() a NULL
>> memory, so I made this patch.
> 
> OK. So I believe that is because prelink's error handling seems wrong.
> It seems to assume it adding the ELF data buffer itself, so frees it,
> but the data actually seemed to come from elf_getdata, so shouldn't
> have been freed by prelink.

Thanks, I will investigate that.

// Robert

> 
> Thanks,
> 
> Mark
> 

      reply	other threads:[~2018-09-03  1:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-29  8:42 [PATCH V1] " Robert Yang
2018-08-29  8:42 ` [PATCH V2] " Robert Yang
2018-08-30 19:57   ` Mark Wielaard
2018-08-31  2:14     ` Robert Yang
2018-08-31  9:35       ` Mark Wielaard
2018-09-03  1:32         ` Robert Yang [this message]

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=69a0a0fb-d09c-4580-f2cc-7962130a2d18@windriver.com \
    --to=liezhi.yang@windriver.com \
    --cc=elfutils-devel@sourceware.org \
    --cc=mark@klomp.org \
    /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).