in reply to Re: Is this a bug in perl or a bug in me?
in thread Is this a bug in perl or a bug in me?

Looking at memread in http://cpansearch.perl.org/src/MHX/IPC-SysV-2.03/SysV.xs, my guess is that the IV field of the variable remains untouched when reading/writing the string portion of the shared memory:

... SvPV_force_nolen(sv); dst = SvGROW(sv, (STRLEN) size + 1); Copy(caddr + pos, dst, size, char); SvCUR_set(sv, size); ...

(assuming that none of the macros actually reset the IV slot). I think this could be construed as a bug.

Replies are listed 'Best First'.
Re^3: Is this a bug in perl or a bug in me?
by Wheely (Acolyte) on Sep 05, 2011 at 19:37 UTC

    This is interesting stuff but I have to admit my knowledge of the perl source extends to more /0īs than shmwrite is padding my $message with :). I had intended to try and copy the variables while I was thinking about this on the train home but then forgot about it :)

    I very much appreciate your input on this though. Having not been using perl or unix for a while I was a bit apprehensive about submitting a bug report on this but I think now, I will.

    Thanks again

      “Zed, we have a bug!"
      -- Men In Black

Re^3: Is this a bug in perl or a bug in me?
by JavaFan (Canon) on Sep 05, 2011 at 23:22 UTC
    Not touching the IV slot should be fine (and the right thing to do). But it should turn off the pOK and pIOK flags. I'm not familiar enough with the SV* macros called in memread to know whether it does or not.