From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108780 invoked by alias); 12 May 2018 17:30:50 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 108711 invoked by uid 48); 12 May 2018 17:30:45 -0000 From: "luke at diamand dot org" To: elfutils-devel@sourceware.org Subject: [Bug tools/23173] New: eu-addr2line does not flush its output, causing problems when used from a script Date: Sat, 12 May 2018 17:30:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: tools X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: luke at diamand dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2018-q2/txt/msg00036.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D23173 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) feed= ing addresses to stdin one at a time, you won't get any output for quite some t= ime. 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); --=20 You are receiving this mail because: You are on the CC list for the bug.