public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [Bug tools/23173] New: eu-addr2line does not flush its output, causing problems when used from a script
@ 2018-05-12 17:30 luke at diamand dot org
  2018-05-12 19:39 ` [Bug tools/23173] " mark at klomp dot org
  2018-05-12 21:18 ` luke at diamand dot org
  0 siblings, 2 replies; 3+ messages in thread
From: luke at diamand dot org @ 2018-05-12 17:30 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=23173

            Bug ID: 23173
           Summary: eu-addr2line does not flush its output, causing
                    problems when used from a script
           Product: elfutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: tools
          Assignee: unassigned at sourceware dot org
          Reporter: luke at diamand dot org
                CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

I noticed that eu-addr2line just write its output to stdout without any
flushing.

That means that if you are using it in a pipe (in my case from Python) feeding
addresses to stdin one at a time, you won't get any output for quite some time.

Just adding a call to fflush(stdout) fixes the problem.

I noticed that the binutils addr2line utility does exactly this:

      /* fflush() is essential for using this command as a server
         child process that reads addresses from a pipe and responds
         with line number information, processing one address at a
         time.  */
      fflush (stdout);

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-12 21:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-12 17:30 [Bug tools/23173] New: eu-addr2line does not flush its output, causing problems when used from a script luke at diamand dot org
2018-05-12 19:39 ` [Bug tools/23173] " mark at klomp dot org
2018-05-12 21:18 ` luke at diamand dot org

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).