Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH] missing newline after "Unable to flush stdout: ..." #16151

Closed
p5pRT opened this issue Sep 16, 2017 · 10 comments
Closed

[PATCH] missing newline after "Unable to flush stdout: ..." #16151

p5pRT opened this issue Sep 16, 2017 · 10 comments

Comments

@p5pRT
Copy link

@p5pRT p5pRT commented Sep 16, 2017

Migrated from rt.perl.org#132100 (status was 'resolved')

Searchable as RT132100$

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Sep 16, 2017

From @ntyni

As reported by Jacub Wilk in https://bugs.debian.org/875361
the newish diagnostic "Unable to flush stdout" doesn't have
a newline appended.

Trivial patch attached.

Perl Info

Flags:
    category=core
    severity=low

Site configuration information for perl 5.27.4:

Configured by niko at Sat Sep 16 11:25:59 EEST 2017.

Summary of my perl5 (revision 5 version 27 subversion 4) configuration:
  Local Commit: 44e580052aabe81c72faa3f8bbc273b6ac574487
  Ancestor: 07d51b5358c64b41da1bc50212be10cc23242c2a
  Platform:
    osname=linux
    osvers=4.11.0-2-amd64
    archname=x86_64-linux
    uname='linux estella 4.11.0-2-amd64 #1 smp debian 4.11.11-1 (2017-07-22) x86_64 gnulinux '
    config_args='-des -Dusedevel'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='cc'
    ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2'
    optimize='-O2'
    cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion=''
    gccversion='7.1.0'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='cc'
    ldflags =' -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib
    libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.24.so
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version='2.24'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E'
    cccdlflags='-fPIC'
    lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong'

Locally applied patches:
    44e580052aabe81c72faa3f8bbc273b6ac574487


@INC for perl 5.27.4:
    lib
    /usr/local/lib/perl5/site_perl/5.27.4/x86_64-linux
    /usr/local/lib/perl5/site_perl/5.27.4
    /usr/local/lib/perl5/5.27.4/x86_64-linux
    /usr/local/lib/perl5/5.27.4


Environment for perl 5.27.4:
    HOME=/home/niko
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LC_CTYPE=fi_FI.UTF-8
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/niko/bin:/home/niko/bin:/home/niko/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/sbin:/usr/sbin
    PERL_BADLANG (unset)
    SHELL=/bin/zsh

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Sep 16, 2017

From @ntyni

0001-Add-missing-newline-to-the-Unable-to-flush-stdout-di.patch
From 44e580052aabe81c72faa3f8bbc273b6ac574487 Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Sat, 16 Sep 2017 11:24:18 +0300
Subject: [PATCH] Add missing newline to the "Unable to flush stdout"
 diagnostic

Originally reported by Jakub Wilk.

Bug-Debian: https://bugs.debian.org/875361
---
 perl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/perl.c b/perl.c
index fd100cc64a..13bbbb07bd 100644
--- a/perl.c
+++ b/perl.c
@@ -674,7 +674,7 @@ perl_destruct(pTHXx)
         if (*stdo && PerlIO_flush(stdo)) {
             PerlIO_restore_errno(stdo);
             if (errno)
-                PerlIO_printf(PerlIO_stderr(), "Unable to flush stdout: %s",
+                PerlIO_printf(PerlIO_stderr(), "Unable to flush stdout: %s\n",
                     Strerror(errno));
             if (!STATUS_UNIX)
                 STATUS_ALL_FAILURE;
-- 
2.13.3

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Sep 16, 2017

From @jkeenan

On Sat, 16 Sep 2017 12​:17​:34 GMT, ntyni@​debian.org wrote​:

This is a bug report for perl from Niko Tyni <ntyni@​debian.org>,
generated with the help of perlbug 1.40 running under perl 5.27.4.

-----------------------------------------------------------------
[Please describe your issue here]

As reported by Jacub Wilk in https://bugs.debian.org/875361
the newish diagnostic "Unable to flush stdout" doesn't have
a newline appended.

Trivial patch attached.

1. Is there any way we could compose a regression test from this?

#####
$ perl -E'say 42' >/dev/full || echo '<-- missing newline here'
Unable to flush stdout​: No space left on device<-- missing newline here
#####

2. The patch itself appears to be correct. Is there any reason (other than lack of test) why it should not be applied?

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Sep 16, 2017

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Sep 16, 2017

From @jkeenan

On Sat, 16 Sep 2017 12​:17​:34 GMT, ntyni@​debian.org wrote​:

This is a bug report for perl from Niko Tyni <ntyni@​debian.org>,
generated with the help of perlbug 1.40 running under perl 5.27.4.

-----------------------------------------------------------------
[Please describe your issue here]

As reported by Jacub Wilk in https://bugs.debian.org/875361
the newish diagnostic "Unable to flush stdout" doesn't have
a newline appended.

Similar error messages​:

#####
$ grep -nA2 'PerlIO_printf(PerlIO_stderr()' *.c
malloc.c​:1090​: if (PerlIO_printf(PerlIO_stderr(),
malloc.c-1091- "assertion botched (%s?)​: %s %s​:%d\n",
malloc.c-1092- diag, s, file, line) != 0) {
--
malloc.c​:1312​: PerlIO_printf(PerlIO_stderr(),
malloc.c-1313- "Unaligned pointer in the free chain 0x%" UVxf "\n",
malloc.c-1314- PTR2UV(p));
--
malloc.c​:1319​: PerlIO_printf(PerlIO_stderr(),
malloc.c-1320- "Unaligned \"next\" pointer in the free "
malloc.c-1321- "chain 0x%" UVxf " at 0x%" UVxf "\n",
--
perl.c​:677​: PerlIO_printf(PerlIO_stderr(), "Unable to flush stdout​: %s",
perl.c-678- Strerror(errno));
perl.c-679- if (!STATUS_UNIX)
#####

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Sep 16, 2017

From @cpansprout

On Sat, 16 Sep 2017 07​:27​:02 -0700, jkeenan wrote​:

1. Is there any way we could compose a regression test from this?

#####
$ perl -E'say 42' >/dev/full || echo '<-- missing newline here'
Unable to flush stdout​: No space left on device<-- missing newline
here
#####

/dev/full is not portable. Maybe you could check for the existence of /dev/full and skip the test otherwise. On some systems (such as Windows), it may be good to skip it unconditionally, since there is nothing to prevent someone from creating a file with that name.

2. The patch itself appears to be correct. Is there any reason (other
than lack of test) why it should not be applied?

I think not.

--

Father Chrysostomos

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jan 2, 2018

From zefram@fysh.org

Niko Tyni wrote​:

Trivial patch attached.

Applied as commit 3753712.

-zefram

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jan 3, 2018

@xsawyerx - Status changed from 'open' to 'pending release'

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jun 23, 2018

From @khwilliamson

Thank you for filing this report. You have helped make Perl better.

With the release yesterday of Perl 5.28.0, this and 185 other issues have been
resolved.

Perl 5.28.0 may be downloaded via​:
https://metacpan.org/release/XSAWYERX/perl-5.28.0

If you find that the problem persists, feel free to reopen this ticket.

@p5pRT p5pRT closed this as completed Jun 23, 2018
@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jun 23, 2018

@khwilliamson - Status changed from 'pending release' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant