develooper Front page | perl.perl5.porters | Postings from April 2003

Re: Smoke [5.9.0] 19094 FAIL(F) linux 2.4.18-3 (i686/1 cpu)

From:
Nicholas Clark
Date:
April 2, 2003 14:01
Subject:
Re: Smoke [5.9.0] 19094 FAIL(F) linux 2.4.18-3 (i686/1 cpu)
Message ID:
20030402215644.GI272@Bagpuss.unfortu.net
On Wed, Apr 02, 2003 at 11:27:18PM +0200, Abe Timmerman wrote:
> Op een frisse lentedag (Monday 31 March 2003 23:29), schreef Abe Timmerman:
> 
> > Op een frisse lentedag (Monday 31 March 2003 21:45), schreef Nicholas Clark:
> > > On Mon, Mar 31, 2003 at 11:42:00AM +0200, Abe Timmerman wrote:
> > > > O O O O O F  -Accflags='-DPERL_COPY_ON_WRITE'
> > > >
> > > > O O O O O F  -Duseithreads -Accflags='-DPERL_COPY_ON_WRITE'
> > > >
> > > > linux       [locale:nl_NL]-DDEBUGGING -Accflags='-DPERL_COPY_ON_WRITE'
> > > > linux       [locale:nl_NL]-DDEBUGGING -Duseithreads
> > > >               (cont) -Accflags='-DPERL_COPY_ON_WRITE'
> > > >     lib/locale...........................FAILED at test 99
> > >
> > > I don't seem to be able to replicate this:
> > >
> > > $ LC_ALL=nl_NL.UTF-8 ./perl harness ../lib/locale.t
> >
> > Ahah, this is not what Test::Smoke does, it's more like:
> >
> > 	$ PERL_UNICODE='' LC_ALL=nl_NL.utf8 ./perl harness ../lib/locale.t
> 
> Okay this is for: 
> 	linux [locale:nl_NL]-DDEBUGGING -Accflags='-DPERL_COPY_ON_WRITE'
> 
> 	$ PERL_UNICODE='' LC_ALL=nl_NL.utf8 ./perl harness -v ../lib/locale.t
> ok 98
> # Scanning for locales...
> Assertion ((sstr)->sv_flags & 0x00040000) failed: file "sv.c", line 4160 at 
> ../lib/locale.t line 311.
> dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 99-117
>         Failed 19/117 tests, 83.76% okay
> Failed Test     Stat Wstat Total Fail  Failed  List of Failed
> -------------------------------------------------------------------------------
> ../lib/locale.t  255 65280   117   38  32.48%  99-117
> Failed 1/1 test scripts, 0.00% okay. 19/117 subtests failed, 83.76% okay.

Thanks. I could replicate that some of the time. But I wasn't sure if it
was that, errors about malformed UTF8 (from forcing unicode and then
the test prints the bytes "bokmål", or valgrind reporting this:

==6124== Use of uninitialised value of size 4
==6124==    at 0x402A3477: strxfrm (in /lib/libc-2.3.1.so)
==6124==    by 0x80484B6: main (in /home/nick/test/test_strxfrm)
==6124==    by 0x4024AA51: __libc_start_main (in /lib/libc-2.3.1.so)
==6124==    by 0x804838D: (within /home/nick/test/test_strxfrm)
==6124==
==6124== Use of uninitialised value of size 4
==6124==    at 0x402A36E0: strxfrm (in /lib/libc-2.3.1.so)
==6124==    by 0x80484B6: main (in /home/nick/test/test_strxfrm)
==6124==    by 0x4024AA51: __libc_start_main (in /lib/libc-2.3.1.so)
==6124==    by 0x804838D: (within /home/nick/test/test_strxfrm)

for strxfrm of "aa".
(Seems to be a bug in the glibc locale; I've reported it to Debian)

Or something else that I didn't know about.

So what I'm curious about is how ${^OPEN} can have something hanging from
MAGIC *without* any magic flags set. The assertion fail is due to ${^OPEN}
It starts going wrong here:

$ ./perl -DC -C16 -e '$a = ${^OPEN}'
Copy on write: sstr --> dstr
SV = PVMG(0x813e480) at 0x813ec3c
  REFCNT = 1
  FLAGS = (POK,pPOK)
  IV = 0
  NV = 0
  PV = 0x812ef70 "\0:utf8"\0
  CUR = 6
  LEN = 7
  MAGIC = 0x813d880
    MG_VIRTUAL = &PL_vtbl_sv
    MG_TYPE = PERL_MAGIC_sv(\0)
    MG_OBJ = 0x813ec30
    MG_LEN = 4
    MG_PTR = 0x812ef60 "\17PEN"
SV = PVMG(0x813e4a0) at 0x813ec48
  REFCNT = 1
  FLAGS = ()
  IV = 0
  NV = 0
  PV = 0


which is the SvSETMAGIC(sv) call in this bit of perl.c:

	      if ((PL_unicode & PERL_UNICODE_INOUT_FLAG) &&
		  (sv = GvSV(gv_fetchpv("\017PEN", TRUE, SVt_PV)))) {
		   U32 in  = PL_unicode & PERL_UNICODE_IN_FLAG;
		   U32 out = PL_unicode & PERL_UNICODE_OUT_FLAG;
		   if (in) {
			if (out)
			     sv_setpvn(sv, ":utf8\0:utf8", 11);
			else
			     sv_setpvn(sv, ":utf8\0", 6);
		   }
		   else if (out)
			sv_setpvn(sv, "\0:utf8", 6);
		   SvSETMAGIC(sv);
	      }

At this point ${^OPEN} has no GMG or SMG flag bits set. How come?
I think if it had them, then there would be no assertion problem.


IIRC Jarkko had one word of advice on locales - "avoid"
It seems to be very good advice - why are we ignoring it? :-(

Nicholas Clark



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About