[Bug tools/23173] New: eu-addr2line does not flush its output, causing problems when used from a script

luke at diamand dot org sourceware-bugzilla@sourceware.org
Sat May 12 17:30:00 GMT 2018


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.


More information about the Elfutils-devel mailing list