Joe Schaefer <[EMAIL PROTECTED]> writes:

[...]

> Somehow the assignment operator MUST be involved in the leak here.
> (You only get a leak when the *same* reference (*SV) is on both sides 
> of the assignment).

Could someone with modperl 1.2x built using a perl 5.8 release candidate 
please test this out:

<Perl>  
    sub Apache::Request::DESTROY{warn "DEAD: $_[0]\n"}
    sub Apache::DESTROY{warn "Dead: $_[0]\n"}

    use Devel::Peek;
    use Apache:Request;

    package Apache::test;

    sub handler {
        my $r = shift;
        my $apr = Apache::Request->new($r);

        Dump($apr); # OK
        $r = $apr;  # XXX: what's going on here???
        Dump($apr); # fscked

        $r->send_header;
        $r->print('apr test');
        return 200;
    }
    1;
</Perl>

<Location /test>
  SetHandler perl-script
  PerlHandler Apache::test
</Location>



My error log for a request to /test is below.  The above
assignment on the line marked "XXX" is modifying $apr, which
it shouldn't.

I don't have a 5.8-RC handy to test this on, but if somebody 
else sees the same problem on 5.8, I'll file a bug report to p5p.

Thanks alot.

--------------------------------------------------
SV = RV(0x814b154) at 0x82309b8
  REFCNT = 1
  FLAGS = (ROK)
  RV = 0x82472f4
    SV = PVMG(0x8244f58) at 0x82472f4
      REFCNT = 1
      FLAGS = (OBJECT,RMG,IOK,pIOK)
      IV = 136639644
      NV = 0
      PV = 0
      MAGIC = 0x8244f80
        MG_VIRTUAL = 0
        MG_TYPE = '~'
        MG_FLAGS = 0x02
          REFCOUNTED
        MG_OBJ = 0x822dec4
          SV = RV(0x814b14c) at 0x822dec4
            REFCNT = 2
            FLAGS = (PADBUSY,PADMY,ROK)
            RV = 0x82472dc
              SV = PVMG(0x8244f30) at 0x82472dc
                REFCNT = 2
                FLAGS = (OBJECT,IOK,pIOK)
                IV = 136628428
                NV = 0
                PV = 0
                STASH = 0x81420e4       "Apache"
        MG_LEN = -1
        MG_PTR = 0x824c8cc ???? - please notify IZ
      STASH = 0x8224a18 "Apache::Request"
SV = RV(0x814b154) at 0x82309b8
  REFCNT = 1
  FLAGS = (ROK)
  RV = 0x82472f4
    SV = PVMG(0x8244f58) at 0x82472f4
      REFCNT = 2
      FLAGS = (OBJECT,RMG,IOK,pIOK)
      IV = 136639644
      NV = 0
      PV = 0
      MAGIC = 0x8244f80
        MG_VIRTUAL = 0
        MG_TYPE = '~'
        MG_FLAGS = 0x02
          REFCOUNTED
        MG_OBJ = 0x822dec4
          SV = RV(0x814b14c) at 0x822dec4
            REFCNT = 2
            FLAGS = (PADBUSY,PADMY,ROK)
            RV = 0x82472f4
              SV = PVMG(0x8244f58) at 0x82472f4
                REFCNT = 2

                FLAGS = (OBJECT,RMG,IOK,pIOK)
                IV = 136639644
                NV = 0
                PV = 0
                MAGIC = 0x8244f80
                  MG_VIRTUAL = 0
                  MG_TYPE = '~'
                  MG_FLAGS = 0x02
                    REFCOUNTED
                  MG_OBJ = 0x822dec4
                    SV = RV(0x814b14c) at 0x822dec4
                      REFCNT = 2
                      FLAGS = (PADBUSY,PADMY,ROK)
                      RV = 0x82472f4
                  MG_LEN = -1
                  MG_PTR = 0x824c8cc ???? - please notify IZ
                STASH = 0x8224a18       "Apache::Request"
        MG_LEN = -1
        MG_PTR = 0x824c8cc ???? - please notify IZ
      STASH = 0x8224a18 "Apache::Request"
Dead: Apache=SCALAR(0x82472dc)
--------------------------------------------------

-- 
Joe Schaefer

Reply via email to