On ActiveState Perl v5.8.4 build #810 for MSWin32-x86-multi-thread, the code prints 1543569414 when I run it first, then 28281972, followed by many 0's. After several runs it printed: 0, 0, 28285736, 671333136, 0, 0, 0, 0..., 28285508, 1550450694. I'm running it within a command-line interpreter on an AMD64 Compaq R3140 laptop (but in 32-bit Windows), all in the same command-line window.

Whether it prints 0 or a huge number seems quite random, but I noticed most of the numbers have some sort of pattern, i.e., 28281972 and 28285736, as well as 1543569414 and 1550450694. It appears to be based on timing. Running it in a for(0..100) loop, I prints 0's most of the time, but this time I it printed all 28294632's. Ran it inside a for(0..1000) loop and it printed one thousand 28276956's, and just now a thousand 1617166510's, and 671333136's. That's the second time it printed 671333136. The numbers I'm getting apparently always are 7 to 9 hexadecimal digits (except for 0, of course). Wild guess: is the array length overwritten with a memory address?

Interesting bug, I hope someone finds an explanation. My Perl version:

Update: changed PRE to CODE

Update 2: On perl, v5.6.1 built for sun4-solaris-64int, it prints 0 most of the time but sometimes 5184 inside the interpreter. Inside tcsh with the command perl -e'$string="abc";while($string=~/b/g){print $#-,"\n"}', it consistently prints -13511196. However, adding use strict;use warnings;my $string=... consistently prints 0.

C:\Documents and Settings\Jeff>perl -V Summary of my perl5 (revision 5 version 8 subversion 4) configuration: Platform: osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef usethreads=undef use5005threads=undef useithreads=define usemultip +licity=def ine useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D +_CONSOLE - DNO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DPERL_IMPLICIT_CONTEXT - +DPERL_IMPL ICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX', optimize='-MD -Zi -DNDEBUG -O1', cppflags='-DWIN32' ccversion='', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64 +', lseeksi ze=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -l +ibpath:"C: \Perl\lib\CORE" -machine:x86' libpth=C:\PROGRA~1\MICROS~3\VC98\lib libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib + comdlg32 .lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uui +d.lib wsoc k32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt. +lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool +.lib comd lg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib + uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msv +crt.lib libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib gnulibc_version='undef' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt: +ref,icf - libpath:"C:\Perl\lib\CORE" -machine:x86' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL +_IMPLICIT_ CONTEXT PERL_IMPLICIT_SYS Locally applied patches: ActivePerl Build 810 22751 Update to Test.pm 1.25 21540 Fix backward-compatibility issues in if.pm Built under MSWin32 Compiled at Jun 1 2004 11:52:21 @INC: C:/Perl/lib C:/Perl/site/lib . C:\Documents and Settings\Jeff>

This is perl, v5.6.1 built for sun4-solaris-64int (with 48 registered patches, see perl -V for more detail):

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuratio +n: Platform: osname=solaris, osvers=2.9, archname=sun4-solaris-64int uname='sunos localhost 5.9 sun4u sparc sunw,ultra-1' config_args='' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultipl +icity=undef useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef use64bitint=define use64bitall=undef uselongdouble=undef Compiler: cc='cc', ccflags ='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-xO3 -xdepend', cppflags='' ccversion='Sun WorkShop', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=87654321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +6 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='of +f_t', lseeksize=8 alignbytes=8, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags ='' libpth=/lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -ldl -lm -lc perllibs=-lsocket -lnsl -ldl -lm -lc libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-R /usr/ +perl5/5.6.1/lib/sun4-solaris-64int/CORE' cccdlflags='-KPIC', lddlflags='-G' Characteristics of this binary (from libperl): Compile-time options: USE_64_BIT_INT USE_LARGE_FILES Locally applied patches: 9676 Port the OpenBSD glob() security patch 9678 Addendum to #9676: some missing changes from OpenBSD glob.c 9679 Up $File::Glob::VERSION, add OpenBSD glob version note 9693 $VERSION and Version() on same line provokes CPAN.pm warning 9706 #7210 broke .packlist generation 9707 ExtUtils::Installed doesn't quote regex metacharacters in pa +ths 9775 Typo in utf8.h 9950 Revert integration of #8254,#8255 in #8620 (causes coredump) 10021 Insecure regexes 10091 $ref1 == $ref2 behaves unpredictably if not NV_PRESERVES_UV 10093 Incorrect line numbers in AutoSplit 10100 [20010514.027] PL_last_in_gv may not be GV if stale filehand +le 10145 [20010515.004] Segfaults from premature GC 10203 Don't think about UTF8 10250 [20010422.005] perl -e '{s//${}/; //}' segfaults 10394 Leakage of file scope lexicals into predeclared subroutines 10404 eval.t was relying on pre-#10394 buggy behavior 10412 Rationalize locale handling to fix bugs uncovered by #10394 10422 Potential buffer overrun if the radix separator > 1 byte 10448 Lexicals outside eval weren't resolved correctly pre-#10394 10450 Optimize #10448 slightly 10543 Add LC_MESSAGES constant to POSIX module 10667 #10449 broke visibility of lexicals inside DB::DB() 10739 C<eval "/x$\r\n/x"> fails to compile correctly 10939 Proposed fix for Pod::Man 11169 Doc patch for Tie::Hash 11374 Make h2ph grok ccsymbols fo the form 1234L, 1234ULL etc 11427 t/harness wasn't picking up all the tests 11428 run/runenv.t needs fflushNULL sanity 11431 pod/*.t tests not picked up by t/TEST either 11510 eval 'format foo=' would loop indefinitely 11713 UTF8 wasn't printing for PVMGs 11716 UTF8 flag should be meaningful only when POK 11808 [20010831.002] Bug in Term::Cap on Solaris ansi terminal 11847 Typo in perl_clone() code causes local(*foo) breakage 12005 [20010912.007] substr reference core dump 12024 Fix local() precedence bug in #8311 12303 Fix 'local $!=0;undef*STDOUT;' segfault 12304 Pod::Html makes a poor guess at author 12350 Typo in IO::Seekable doc 12496 Carp::shortmess_heavy() doesn't notice trailing newline 12549 readline() doesn't work with 'our' variables 12550 #12549 wasn't aware of strictures 12752 croak(Nullch) wasn't printing the contents of ERRSV 12811 [20011101.069] \stat('.') gives 'free unref scalar' error 12812 Slight modification of #12811 13149 Integrate #13147 from mainline (fixes nit in #10091) 13261 Integrate #8340,#13260 from mainline Built under solaris Compiled at Apr 6 2002 14:45:34 @INC: /usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib /usr/perl5/site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int /usr/perl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl . 0

In reply to Re: @- Bug on the loose, lets isolate it by shibboleth
in thread @- Bug on the loose, lets isolate it by davido

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.