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

t/op/sprintf.t fails one test on FreeBSD 4.6 #12092

Closed
p5pRT opened this issue May 8, 2012 · 6 comments
Closed

t/op/sprintf.t fails one test on FreeBSD 4.6 #12092

p5pRT opened this issue May 8, 2012 · 6 comments

Comments

@p5pRT
Copy link

p5pRT commented May 8, 2012

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

Searchable as RT112820$

@p5pRT
Copy link
Author

p5pRT commented May 8, 2012

From @nwc10

Created by @nwc10

t/op/sprintf.t fails one test on FreeBSD 4.6
*Everything* else passes. This is a pleasant surprise.

Patch adds a skip for FreeBSD 4, and should not skip on FreeBSD 5 and later.
Tested on FreeBSD 7 too. Due to the way versions don't map to real numbers,
4.6 > 4.11, whereas 4.6 <= 4.9 (and 4.9 <= 4.9, 4.10 <= 4.9 and 4.11 <= 4.9)
so the skip skips for all releases of FreeBSD 4.

Inline Patch
diff --git a/t/op/sprintf.t b/t/op/sprintf.t
index 9c942b4..34086c8 100644
--- a/t/op/sprintf.t
+++ b/t/op/sprintf.t
@@ -399,7 +399,7 @@ __END__
 > %.0g<     >[]<          > 0 MISSING<
 >%.2g<      >[]<          >0 MISSING<
 >%.2gC<      >[]<          >0C MISSING<
->%.0g<      >-0.0<        >-0<		   >C99 standard mandates minus sign but C89 does not skip: MSWin32 VMS hpux:10.20 openbsd netbsd:1.5 irix darwin<
+>%.0g<      >-0.0<        >-0<		   >C99 standard mandates minus sign but C89 does not skip: MSWin32 VMS hpux:10.20 openbsd netbsd:1.5 irix darwin freebsd:4.9<
 >%.0g<      >12345.6789<  >1e+04<
 >%#.0g<     >12345.6789<  >1.e+04<
 >%.2g<      >12345.6789<  >1.2e+04<


Nicholas Clark
Perl Info

Flags:
    category=core
    severity=low

Site configuration information for perl 5.15.9:

Configured by nick at Mon May  7 09:37:52 BST 2012.

Summary of my perl5 (revision 5 version 15 subversion 9) configuration:
   
  Platform:
    osname=freebsd, osvers=4.6-release, archname=i386-freebsd
    uname='freebsd thinking-cap.moo 4.6-release freebsd 4.6-release #0: sat jul 13 18:39:23 gmt 2002 nick@thinking-cap.moo:usrlocalobjusrsrcsysthinkingcap i386 '
    config_args='-Dusedevel -Dcc=ccache cc -Dld=cc -Doptimize=-Os -Dprefix=/usr/local/blead -de'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='ccache cc', ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include',
    optimize='-Os',
    cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='2.95.3 20010315 (release) [FreeBSD]', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    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,-E  -L/usr/local/lib'
    libpth=/usr/lib /usr/local/lib
    libs=-lm -lcrypt -lutil -lc
    perllibs=-lm -lcrypt -lutil -lc
    libc=, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-DPIC -fPIC', lddlflags='-shared  -L/usr/local/lib'

Locally applied patches:
    


@INC for perl 5.15.9:
    lib
    /usr/local/blead/lib/perl5/site_perl/5.15.9/i386-freebsd
    /usr/local/blead/lib/perl5/site_perl/5.15.9
    /usr/local/blead/lib/perl5/5.15.9/i386-freebsd
    /usr/local/blead/lib/perl5/5.15.9
    .


Environment for perl 5.15.9:
    HOME=/home/nick
    LANG (unset)
    LANGUAGE (unset)
    LC_CTYPE=en_GB.ISO_8859-1
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/nick/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/home/nick/bin:/sbin:/usr/sbin:/usr/local/sbin
    PERL_BADLANG (unset)
    SHELL=/usr/local/bin/bash

@p5pRT
Copy link
Author

p5pRT commented May 8, 2012

From @nwc10

On Tue, May 08, 2012 at 01​:47​:10PM -0700, Nicholas Clark wrote​:

t/op/sprintf.t fails one test on FreeBSD 4.6
*Everything* else passes. This is a pleasant surprise.

Site configuration information for perl 5.15.9​:

Configured by nick at Mon May 7 09​:37​:52 BST 2012.

Summary of my perl5 (revision 5 version 15 subversion 9) configuration​:

Locally applied patches​:

---

This isn't exactly true. It's a tarball made from a clean git checkout
of the branch nicholas/build-trim (which contains a proposed small
refactoring of mktables to drop memory usage by 7%), and then this patch
for sv.c too​:

Inline Patch
diff --git a/sv.c b/sv.c
index 3ac2fd8..5d0f961 100644
--- a/sv.c
+++ b/sv.c
@@ -1507,7 +1507,7 @@ Perl_sv_grow(pTHX_ register SV *const sv, register STRLEN newlen)
 
     if (newlen > SvLEN(sv)) {		/* need more room? */
 	STRLEN minlen = SvCUR(sv);
-	minlen += (minlen >> PERL_STRLEN_EXPAND_SHIFT) + 10;
+	minlen += (minlen >> PERL_STRLEN_EXPAND_SHIFT);
 	if (newlen < minlen)
 	    newlen = minlen;
 #ifndef Perl_safesysmalloc_size

which drops memory usage by a further 2.5% on x86 FreeBSD! \(And doesn't change memory usage on x86 Linux\. FreeBSD's malloc is more frugal\, but seems to pay for it on repeated reallocs\)

Why?

Because without that I ran out of swap. With the above, I can build in 96M
of swap. (Only 16M of real RAM). I also ran out of swap [just :-(] running
t/harness. t/TEST gets through. It all takes a bit of time, mind you, and
makes a heck of a racket, given that there's swap on all 4 hard drives :-)

"The marvel is not that the bear dances well, but that the bear dances at all."

I think that this means that blead would probably build and test OK within
the hardware of a typical smartphone (without swapping), if they actually
had native toolchains. Which they don't.

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented May 8, 2012

From @tonycoz

On Tue, May 08, 2012 at 10​:04​:01PM +0100, Nicholas Clark wrote​:

I think that this means that blead would probably build and test OK within
the hardware of a typical smartphone (without swapping), if they actually
had native toolchains. Which they don't.

The pogoplug I do ARM builds on has less RAM than my now fairly dated
Nexus One.

I don't do parallel builds or tests on it.

Tony

perlsmoke@​iapetus​:~/smoke-me/smoke$ free
  total used free shared buffers cached
Mem​: 255672 236260 19412 0 5572 151336
-/+ buffers/cache​: 79352 176320
Swap​: 506036 58492 447544
perlsmoke@​iapetus​:~/smoke-me/smoke$ uname -a
Linux iapetus 2.6.32-5-kirkwood #1 Tue Jun 14 23​:05​:32 UTC 2011 armv5tel GNU/Linux
perlsmoke@​iapetus​:~/smoke-me/smoke$ cat /proc/cpuinfo
Processor : Feroceon 88FR131 rev 1 (v5l)
BogoMIPS : 1192.75
Features : swp half thumb fastmult edsp
CPU implementer : 0x56
CPU architecture​: 5TE
CPU variant : 0x2
CPU part : 0x131
CPU revision : 1

Hardware : Marvell SheevaPlug Reference Board
Revision : 0000
Serial : 0000000000000000

@p5pRT
Copy link
Author

p5pRT commented May 8, 2012

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

@p5pRT
Copy link
Author

p5pRT commented Jul 5, 2012

From @cpansprout

On Tue May 08 13​:47​:10 2012, Mr. Clark wrote​:

t/op/sprintf.t fails one test on FreeBSD 4.6
*Everything* else passes. This is a pleasant surprise.

Patch adds a skip for FreeBSD 4, and should not skip on FreeBSD 5 and
later.
Tested on FreeBSD 7 too. Due to the way versions don't map to real
numbers,
4.6 > 4.11, whereas 4.6 <= 4.9 (and 4.9 <= 4.9, 4.10 <= 4.9 and 4.11
<= 4.9)
so the skip skips for all releases of FreeBSD 4.

diff --git a/t/op/sprintf.t b/t/op/sprintf.t
index 9c942b4..34086c8 100644
--- a/t/op/sprintf.t
+++ b/t/op/sprintf.t
@​@​ -399,7 +399,7 @​@​ __END__

%.0g< >[]< > 0 MISSING<
%.2g< >[]< >0 MISSING<
%.2gC< >[]< >0C MISSING<
->%.0g< >-0.0< >-0< >C99 standard mandates minus sign
but C89 does not skip​: MSWin32 VMS hpux​:10.20 openbsd netbsd​:1.5 irix
darwin<
+>%.0g< >-0.0< >-0< >C99 standard mandates minus sign
but C89 does not skip​: MSWin32 VMS hpux​:10.20 openbsd netbsd​:1.5 irix
darwin freebsd​:4.9<
%.0g< >12345.6789< >1e+04<
%#.0g< >12345.6789< >1.e+04<
%.2g< >12345.6789< >1.2e+04<

Thank you. Applied as f60cb31.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Jul 5, 2012

@cpansprout - Status changed from 'open' 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