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

Possible bugs in printf '%a' format results #15074

Closed
p5pRT opened this issue Dec 5, 2015 · 10 comments
Closed

Possible bugs in printf '%a' format results #15074

p5pRT opened this issue Dec 5, 2015 · 10 comments

Comments

@p5pRT
Copy link

p5pRT commented Dec 5, 2015

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

Searchable as RT126822$

@p5pRT
Copy link
Author

p5pRT commented Dec 5, 2015

From gdg@zplane.com

Created by gdg@zplane.com

This perlbug is related to this p5p thread​:

  http​://www.nntp.perl.org/group/perl.perl5.porters/2015/11/msg232956.html

regarding some peculiar/inconsistent behavior of the printf '%a' format
specifier. I'm not sure that any of the behaviors described therein are
actually bugs, but since the post asked for guidance in that regard and no
response was received, figured might as well just submit it as a perlbug
anyway so that the issue doesn't fall in a crack. My bad if they're not
really bugs.

Perl Info

Flags:
    category=core
    severity=medium

Site configuration information for perl 5.22.0:

Configured by builduser at Tue Jun  2 09:41:38 CEST 2015.

Summary of my perl5 (revision 5 version 22 subversion 0) configuration:
   
  Platform:
    osname=linux, osvers=4.0.4-2-arch, archname=i686-linux-thread-multi
    uname='linux flo-32 4.0.4-2-arch #1 smp preempt fri may 22 03:05:23 utc 2015 i686 gnulinux '
    config_args='-des -Dusethreads -Duseshrplib -Doptimize=-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -Dprefix=/usr -Dvendorprefix=/usr -Dprivlib=/usr/share/perl5/core_perl -Darchlib=/usr/lib/perl5/core_perl -Dsitelib=/usr/share/perl5/site_perl -Dsitearch=/usr/lib/perl5/site_perl -Dvendorlib=/usr/share/perl5/vendor_perl -Dvendorarch=/usr/lib/perl5/vendor_perl -Dscriptdir=/usr/bin/core_perl -Dsitescript=/usr/bin/site_perl -Dvendorscript=/usr/bin/vendor_perl -Dinc_version_list=none -Dman1ext=1perl -Dman3ext=3perl -Dlddlflags=-shared -Wl,-O1,--sort-common,--as-needed,-z,relro -Dldflags=-Wl,-O1,--sort-common,--as-needed,-z,relro'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion='', gccversion='5.1.0', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234, doublekind=3
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12, longdblkind=3
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags ='-Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib/gcc/i686-pc-linux-gnu/5.1.0/include-fixed /usr/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.21.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.21'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE'
    cccdlflags='-fPIC', lddlflags='-shared -Wl,-O1,--sort-common,--as-needed,-z,relro -L/usr/local/lib -fstack-protector-strong'



@INC for perl 5.22.0:
    /home/XXXXX/locperl/lib/perl5/i686-linux-thread-multi
    /home/XXXXX/locperl/lib/perl5
    /home/XXXXX/lib/perllib
    /usr/lib/perl5/site_perl
    /usr/share/perl5/site_perl
    /usr/lib/perl5/vendor_perl
    /usr/share/perl5/vendor_perl
    /usr/lib/perl5/core_perl
    /usr/share/perl5/core_perl
    .


Environment for perl 5.22.0:
    HOME=/home/XXXXX
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LC_ALL=en_US
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/XXXXX/bin:/usr/local/bin:/usr/bin:.:/usr/bin/core_perl:/usr/bin/vendor_perl:/opt/bin32-jre/jre/bin
    PERL5LIB=/home/XXXXX/locperl/lib/perl5:/home/XXXXX/lib/perllib
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Dec 6, 2015

From @tonycoz

On Sat Dec 05 10​:13​:31 2015, gdg@​zplane.com wrote​:

This perlbug is related to this p5p thread​:

http​://www.nntp.perl.org/group/perl.perl5.porters/2015/11/msg232956.html

regarding some peculiar/inconsistent behavior of the printf '%a'
format
specifier. I'm not sure that any of the behaviors described therein
are
actually bugs, but since the post asked for guidance in that regard
and no
response was received, figured might as well just submit it as a
perlbug
anyway so that the issue doesn't fall in a crack. My bad if they're
not
really bugs.

It looks like Jarkko has already fixed these in​:

commit 4755cf0
Author​: Jarkko Hietaniemi <jhi@​iki.fi>
Date​: Sat Nov 28 17​:45​:19 2015 -0500

  hexfp​: printf %a for negative zero.

commit 454ce66
Author​: Jarkko Hietaniemi <jhi@​iki.fi>
Date​: Sat Nov 28 22​:22​:25 2015 -0500

  hexfp​: printf %.13a 1.0

commit 798a7a5
Author​: Jarkko Hietaniemi <jhi@​iki.fi>
Date​: Sat Nov 28 22​:56​:29 2015 -0500

  hexfp​: printf %.13a 0.0

tony@​mars​:.../git/perl$ ./perl -e '@​vals = ( +1, +0.0, -0.0, -1); for (@​vals) { printf "%+f\n", $_; } for (@​vals) { printf "%+-.13a\n", $_ }'
+1.000000
+0.000000
-0.000000
-1.000000
+0x1.0000000000000p+0
+0x0.0000000000000p+0
-0x0.0000000000000p+0
-0x1.0000000000000p+0

Tony

@p5pRT
Copy link
Author

p5pRT commented Dec 6, 2015

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

@p5pRT
Copy link
Author

p5pRT commented Dec 7, 2015

From gdg@zplane.com

Tony Cook via RT <perlbug-followup@​perl.org> [2015-12-06 14​:52​:16 -0800]​:

On Sat Dec 05 10​:13​:31 2015, gdg@​zplane.com wrote​:

This perlbug is related to this p5p thread​:

http​://www.nntp.perl.org/group/perl.perl5.porters/2015/11/msg232956.html

regarding some peculiar/inconsistent behavior of the printf '%a'
format
specifier. I'm not sure that any of the behaviors described therein
are
actually bugs, but since the post asked for guidance in that regard
and no
response was received, figured might as well just submit it as a
perlbug
anyway so that the issue doesn't fall in a crack. My bad if they're
not
really bugs.

It looks like Jarkko has already fixed these in​:

[ ... ]

Ok thanks, looks good. Must've missed Jarkko's post on the original thread.
Sorry for the noise.

Glenn

@p5pRT
Copy link
Author

p5pRT commented Dec 7, 2015

From @steve-m-hay

On Sun Dec 06 17​:10​:57 2015, gdg@​zplane.com wrote​:

Tony Cook via RT <perlbug-followup@​perl.org> [2015-12-06 14​:52​:16 -0800]​:

On Sat Dec 05 10​:13​:31 2015, gdg@​zplane.com wrote​:

This perlbug is related to this p5p thread​:

http​://www.nntp.perl.org/group/perl.perl5.porters/2015/11/msg232956.html

regarding some peculiar/inconsistent behavior of the printf '%a'
format
specifier. I'm not sure that any of the behaviors described therein
are
actually bugs, but since the post asked for guidance in that regard
and no
response was received, figured might as well just submit it as a
perlbug
anyway so that the issue doesn't fall in a crack. My bad if they're
not
really bugs.

It looks like Jarkko has already fixed these in​:

[ ... ]

Ok thanks, looks good. Must've missed Jarkko's post on the original thread.
Sorry for the noise.

Apologies required from us, not from you​: In the flurry of activity in getting these bugs fixed, tested and a new RC made with the fixes in, we seem to have forgotten to reply to your post to inform you of this.

So please accept our apologies for that, and thank you for reporting the bugs -- twice, in fact! :-)

Marking this ticket as 'pending release' now, since the bugs are indeed fixed.

@p5pRT
Copy link
Author

p5pRT commented Dec 7, 2015

@steve-m-hay - Status changed from 'open' to 'pending release'

@p5pRT
Copy link
Author

p5pRT commented Dec 9, 2015

From gdg@zplane.com

Steve Hay via RT <perlbug-followup@​perl.org> [2015-12-06 17​:17​:56 -0800]​:

It looks like Jarkko has already fixed these in​:

[ ... ]

Ok thanks, looks good. Must've missed Jarkko's post on the original
thread. Sorry for the noise.

Apologies required from us, not from you​: In the flurry of activity in
getting these bugs fixed, tested and a new RC made with the fixes in, we
seem to have forgotten to reply to your post to inform you of this.

No problemo, glad the report was useful.

This brings up a side question though​: Is it ok to file a perlbug solely for
the purpose of acting as a reminder about an ongoing thread discussion that
has not yet been resolved? Just to keep it on the radar at some level so that
it doesn't fall in a crack.

For example, this thread was started about six months ago with a query I had
on a doc issue

  http​://www.nntp.perl.org/group/perl.perl5.porters/2015/05/msg227897.html

It ran for a while, generated some debate, then lapsed into a coma. I pinged it
out, it went for a few more rounds, then fell back to sleep. Rather than being
a bi-yearly gadfly about it on the list, would it be better to just file the
issue as a perlbug with a link to the thread and a short description of the
issue?

@p5pRT
Copy link
Author

p5pRT commented Dec 9, 2015

From @steve-m-hay

On 9 December 2015 at 14​:01, Glenn Golden <gdg@​zplane.com> wrote​:

Steve Hay via RT <perlbug-followup@​perl.org> [2015-12-06 17​:17​:56 -0800]​:

It looks like Jarkko has already fixed these in​:

[ ... ]

Ok thanks, looks good. Must've missed Jarkko's post on the original
thread. Sorry for the noise.

Apologies required from us, not from you​: In the flurry of activity in
getting these bugs fixed, tested and a new RC made with the fixes in, we
seem to have forgotten to reply to your post to inform you of this.

No problemo, glad the report was useful.

This brings up a side question though​: Is it ok to file a perlbug solely for
the purpose of acting as a reminder about an ongoing thread discussion that
has not yet been resolved? Just to keep it on the radar at some level so that
it doesn't fall in a crack.

For example, this thread was started about six months ago with a query I had
on a doc issue

http&#8203;://www\.nntp\.perl\.org/group/perl\.perl5\.porters/2015/05/msg227897\.html

It ran for a while, generated some debate, then lapsed into a coma. I pinged it
out, it went for a few more rounds, then fell back to sleep. Rather than being
a bi-yearly gadfly about it on the list, would it be better to just file the
issue as a perlbug with a link to the thread and a short description of the
issue?

Yes, I would say it's fine to perlbug anything that you feel a
discussion over hasn't yet reached a firm conclusion. It's easier to
keep tabs on such things in the RT queue than having to cite links in
the p5p archives.

@p5pRT
Copy link
Author

p5pRT commented May 13, 2016

From @khwilliamson

Thank you for submitting this report. You have helped make Perl better.
 
With the release of Perl 5.24.0 on May 9, 2016, this and 149 other issues have been resolved.

Perl 5.24.0 may be downloaded via https://metacpan.org/release/RJBS/perl-5.24.0

@p5pRT p5pRT closed this as completed May 13, 2016
@p5pRT
Copy link
Author

p5pRT commented May 13, 2016

@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