Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Bug#554945: Autoflushing of stdout is broken with perl 5.10

 
   Soft32 Home -> Linux -> Bugs Dist RSS
Next:  Bug#552609: python-lxml patch breaks exporting of..  
Author Message
Roger Leigh

External


Since: Nov 28, 2006
Posts: 21



(Msg. 1) Posted: Sat Nov 07, 2009 7:20 am
Post subject: Bug#554945: Autoflushing of stdout is broken with perl 5.10
Archived from groups: linux>debian>bugs>dist (more info?)

Package: perl
Version: 5.10.1-6
Severity: normal

This thread also describes the problem:
http://coding.derkeiler.com/Archive/Perl/comp.lang.perl.misc/2009-06/m...0035.ht

In sbuild, we use the following routine to print log messages:

while (<STDIN>) {
if ($nolog) {
print $saved_stdout $_;
} else {
if ($log) {
print CPLOG $_;
}
if ($verbose) {
print $saved_stdout $_;
}
}
}

in a child logger process which reads from a pipe. Taken from the sub
open_build_log from
http://git.debian.org/?p=buildd-tools/sbuild.git;a=blob;f=lib/Sbuild/B...d.pm;h=

This is using standard buffered I/O on $saved_stdout, which is just a
dup'd reference to STDOUT.

if I add these changes:


@@ -2585,12 +2586,14 @@ sub open_build_log {
+ $saved_stdout->autoflush(1);
while (<STDIN>) {
if ($nolog) {
print $saved_stdout $_;
+ $saved_stdout->flush();
} else {
if ($log) {
print CPLOG $_;
}
if ($verbose) {
print $saved_stdout $_;
+ $saved_stdout->flush();
}
}
}

What I see is that if I just set autoflushing, the output is still
buffered. If I (additionally or separately) add the explicit
flushing after print, then I do see correct flushing.

The conclusion I've drawn is that autoflushing does not work on
stdout. The other handle, CPLOG, has set autoflushing without
any problems at all. The above thread from comp.lang.perl.misc
shows the same behaviour.


Regards,
Roger

-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (550, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.31-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-Cool
Shell: /bin/sh linked to /bin/dash

Versions of packages perl depends on:
ii libbz2-1.0 1.0.5-3 high-quality block-sorting file co
ii libc6 2.10.1-5 GNU C Library: Shared libraries
ii libdb4.7 4.7.25-8 Berkeley v4.7 Database Libraries [
ii libgdbm3 1.8.3-7 GNU dbm database routines (runtime
ii perl-base 5.10.1-6 minimal Perl system
ii perl-modules 5.10.1-6 Core Perl modules
ii zlib1g 1:1.2.3.3.dfsg-15 compression library - runtime

Versions of packages perl recommends:
ii make 3.81-7 An utility for Directing compilati
ii netbase 4.37 Basic TCP/IP networking system

Versions of packages perl suggests:
pn libterm-readline-gnu-perl | l <none> (no description available)
ii perl-doc 5.10.1-6 Perl documentation

-- no debconf information



--
To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST RemoveThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster RemoveThis @lists.debian.org
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Bug#435589: libimage-exiftool-perl: Should Recommend libco.. - Package: libimage-exiftool-perl Hi, The README file says: === DEPENDENCIES Requires Perl version 5.004 or later. No...

Bug#435553: Add search on package names - Package: reportbug-ng Version: 0.2007.07.19 Severity: wishlist --- Please enter the report below this line. --- I..

Bug#431170: The way to keep entity is documented in debian.. - Hi, It was a bit ambiguous but debiandoc-sgml-doc has appendix which goes in details how to keep entity. Osamu -- ...

Bug#435552: Doesn't detect debcontrol files in non-debian/.. - Package: vim-runtime Version: 1:7.1-022+1 Severity: minor Tags: patch Hi, "vi control" on a debcon...

Bug#435554: pidgin: Info text in About dialog scrolls down - Package: pidgin Version: 2.1.0-1 Severity: minor -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 When opening the About...

Bug#417674: new versions available - Dear Baishampayan, Please do consider packaging the latest version. Thanks. Kumar -- Kumar Appaiah, 458, Jamuna..
       Soft32 Home -> Linux -> Bugs Dist All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]