All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: cody@linux.vnet.ibm.com, a.p.zijlstra@chello.nl,
	paulus@samba.org, mingo@redhat.com, acme@ghostprotocols.net,
	mpe@ellerman.id.au
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] perf symbols: symbol-minimal.c causes random fd to be closed
Date: Thu, 12 Dec 2013 13:47:25 +1100	[thread overview]
Message-ID: <20131212134725.4dacdd06@kryten> (raw)


I hit a cryptic failure when testing a recent version
of perf:

  # perf report
  write failure on standard output: Bad file descriptor

The issue is in commit b68e2f91 (perf symbols: Introduce symsrc
structure). symsrc__destroy() does a close(ss->fd) but
ss->fd is only initialised in the symbol-elf.c case and
not for symbol-minimal.c.

The issue has been around for a while however most people
will build with libelf which wont use the symbol-minimal.c
code.

Cc: stable@vger.kernel.org # v3.8+
Signed-off-by: Anton Blanchard <anton@samba.org>
---

diff --git a/tools/perf/util/symbol-minimal.c b/tools/perf/util/symbol-minimal.c
index 2d2dd05..3528204 100644
--- a/tools/perf/util/symbol-minimal.c
+++ b/tools/perf/util/symbol-minimal.c
@@ -254,6 +254,7 @@ int symsrc__init(struct symsrc *ss, struct dso *dso __maybe_unused,
 		goto out_close;
 
 	ss->type = type;
+	ss->fd = fd;
 
 	return 0;
 out_close:

             reply	other threads:[~2013-12-12  2:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-12  2:47 Anton Blanchard [this message]
2013-12-12 14:21 ` [PATCH] perf symbols: symbol-minimal.c causes random fd to be closed Arnaldo Carvalho de Melo

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=20131212134725.4dacdd06@kryten \
    --to=anton@samba.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=cody@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.