in reply to Here's strange for you!

...seek & read have now succeeded. Just because you printed the value of $offset.

Do you get the same effect when you avoid implicit stringification (and the associated caching of the PV value — do a Devel::Peek dump before and after the print) by writing

print $offset, "\n";

instead of

print "$offset\n";

Don't really know why this would influence seek's behaviour, but for the moment that's the only normal side effect of your print that I can think of...

Replies are listed 'Best First'.
Re^2: Here's strange for you!
by BrowserUk (Patriarch) on Apr 13, 2010 at 17:29 UTC

    The problem is, not too many tools are available at that point during the build.

    What I've determined so far is:

    • The problem only occurs when running exetype.pl with miniperl.exe.
    • Quoting the variables $offset & $size that contain unpacked numeric values entirely fixes the problem:
      # <perl>/win32/bin/exetype.pl ... 37: seek EXE, "$offset", 0; ... 43:die "Optional header is neither in NT32 nor in NT64 format" 44: unless ("$size" == 224 && $magic == 0x10b) || # ... 45: ("$size" == 240 && $magic == 0x20b); # ...

      Nmake test is still running, but is sufficiently far through that I don;t expect (extra) failures now.

    • Using 0+$offset & 0+$size doesn't effect a cure.

    My speculation is that unpack in miniperl is setting SvIOK when it shouldn't be.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      The problem is, not too many tools are available at that point during the build

      Do you have gdb? You could set a breakpoint on pp_seek and call sv_dump on the sv.

      My speculation is that unpack in miniperl is setting SvIOK when it shouldn't be.

      But IOK should be set for unpack L. Maybe it's some bad combo of IOK and pIOK.