Max Kanat-Alexander | 1 Jul 2006 01:10
Gravatar

Re: [QUESTION] pnotes, Template-Toolkit, and a memory leak

On Fri, 2006-06-30 at 18:49 -0400, Jonathan Vanasco wrote:
> I think its more likely that the bug is in the way Bugzilla uses TT  
> -- a some reference to the template object is getting stored  
> persistently ( i think everyone has made a similar mistake ).  I've  
> never had a problem with a pnote living on after a request, and your  
> issue is either the pnote is still around or the object the pnote  
> references is linked elsewhere.

	Yeah, I suspected that too, but it couldn't be--because the cleanup
happens correctly if I delete that *one* reference, and it doesn't
happen correctly if I don't delete that *one* reference. So it doesn't
have anything to do with anything else holding on to a reference.

> I think the easiest fix, for now, would be to toss in a cleanup  
> handler that just undefs the pnote if its defined.  if you're only  
> using the pnote within a single handler stage, i'd just undef it at  
> the end of the handler after all the output is generated.  i do tons  
> of 'just in case' cleanup things.

	Okay. Yeah, that's probably what I'll do, is just call delete on all
the pnote keys.

	But one way or another, this does seem like a bug. That DESTROY handler
ought to get called.

	-Max
--

-- 
http://www.everythingsolved.com/
Competent, Friendly Bugzilla Services. And Everything Else, too.

(Continue reading)

Philip M. Gollucci | 1 Jul 2006 01:36

Re: Is Apache::DB still the way to interactively debug via MP2

Boysenberry Payne wrote:
> That helped me get the Debugger working thank you.
> 
> Now its cutting out with this error in the error log:
> [Fri Jun 30 17:55:23 2006] [error] [client 127.0.0.1] 
> install_driver(mysql) failed: Insecure $ENV{PATH} while running setgid 
> at /Library/Perl/5.8.1/darwin-thread-multi-2level/Term/ReadKey.pm line 
> 334.\nCompilation failed in require at 
> /Library/Perl/5.8.1/Term/ReadLine/Perl.pm line 58.\n\n at 
> /Users/boysie/habitat/perl/modules/Habitat/Apache2/DB.pm line 39\n
> 
> How come its saying the $ENV{PATH} is insecure?
> Any ideas?
perldoc perlsec.

By default path is tainted unless you untaint it.

I'm not sure what your doing that you need to be running setgid though.

--

-- 
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci <at> p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"In all that I've done wrong I know I must have done something right to
deserve a hug every morning and butterfly kisses at night."

(Continue reading)

Philip M. Gollucci | 1 Jul 2006 01:41

Re: [QUESTION] pnotes, Template-Toolkit, and a memory leak

Max Kanat-Alexander wrote:
> 	But one way or another, this does seem like a bug. That DESTROY handler
> ought to get called.
By saying go out of scope, or holding a reference, he is implying that the reference count is not = 0
ever.  When a "object"'s ref count reaches 0, DESTROY is called.

pnotes() is special in that it doesn't create a copy of the variable (depending on how you use it) it just does
an 
SvREF_inc() on the HV.  So when you delete it from the pnotes, you might be trigger more then you think
(agreeing with 
Johnathna's though that Bugzilla is doing something strange with a pnotes key)

--

-- 
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci <at> p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"In all that I've done wrong I know I must have done something right to
deserve a hug every morning and butterfly kisses at night."

Boysenberry Payne | 1 Jul 2006 08:36

Re: Is Apache::DB still the way to interactively debug via MP2

> I'm not sure what your doing that you need to be running setgid though.

Me either.
Do any of these require setgid that you know of?

use APR::Pool ();
use Apache::DB ();
Apache::DB->init();

use Apache::DBI ();
use Apache2::Connection ();
use Apache2::Const -compile => qw( OK REDIRECT FORBIDDEN );
use Apache2::Cookie ();
use Apache2::Request ();
use Apache2::Upload ();
use APR::Request::Apache2 ();
use Email::Send ();
use HTML::TreeBuilder ();
use Template ();
use URI::Escape ();

I used egrep on all of my custom modules and came up with nothing.
I says during install_driver(mysql)  would it be from changing  
databases,
e.g. starting in one database/user than switching to another  
database/user?

Thanks,
Boysenberry

(Continue reading)

Boysenberry Payne | 1 Jul 2006 20:37

Re: Is Apache::DB still the way to interactively debug via MP2

I'm getting the following error only when I debug:

Can't locate object method "print" via package "Apache2::RequestRec" at  
/Users/boysie/habitat/perl/modules/Habitat/Apache2/Template.pm line  
69.\n

Line 69:
$r->print( $output ) if $output;

Where $r is Apache2::RequestRec

Any ideas?  It was working fine yesterday, the only thing different is  
the debugger now,
and I even have it remarked out and still get this error.  It doesn't  
make any sense to me.
Why would Apache2:RequestRec loose the print subroutine?

Thanks,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Jul 1, 2006, at 1:36 AM, Boysenberry Payne wrote:

>> I'm not sure what your doing that you need to be running setgid  
>> though.
>
> Me either.
> Do any of these require setgid that you know of?
>
(Continue reading)

Boysenberry Payne | 1 Jul 2006 20:40

Re: Is Apache::DB still the way to interactively debug via MP2

To clarify, I get the error now whether I debug or not.
Until I started to debug I wasn't getting the error.
I don't think I changed anything in my code to cause this though...

Thanks,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Jul 1, 2006, at 1:37 PM, Boysenberry Payne wrote:

> I'm getting the following error only when I debug:
>
> Can't locate object method "print" via package "Apache2::RequestRec"  
> at /Users/boysie/habitat/perl/modules/Habitat/Apache2/Template.pm line  
> 69.\n
>
> Line 69:
> $r->print( $output ) if $output;
>
> Where $r is Apache2::RequestRec
>
> Any ideas?  It was working fine yesterday, the only thing different is  
> the debugger now,
> and I even have it remarked out and still get this error.  It doesn't  
> make any sense to me.
> Why would Apache2:RequestRec loose the print subroutine?
>
>
>
(Continue reading)

Boysenberry Payne | 1 Jul 2006 23:41

Re: Is Apache::DB still the way to interactively debug via MP2

print vs $r->print still works.  Is it better to use one over the other?
If I change all of my $r->print statements to read print instead will
I need to expect trouble?

Thanks,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Jul 1, 2006, at 1:40 PM, Boysenberry Payne wrote:

> To clarify, I get the error now whether I debug or not.
> Until I started to debug I wasn't getting the error.
> I don't think I changed anything in my code to cause this though...
>
> Thanks,
> Boysenberry
>
> boysenberrys.com | habitatlife.com | selfgnosis.com
>
> On Jul 1, 2006, at 1:37 PM, Boysenberry Payne wrote:
>
>> I'm getting the following error only when I debug:
>>
>> Can't locate object method "print" via package "Apache2::RequestRec"  
>> at /Users/boysie/habitat/perl/modules/Habitat/Apache2/Template.pm  
>> line 69.\n
>>
>> Line 69:
>> $r->print( $output ) if $output;
(Continue reading)

Philip M. Gollucci | 2 Jul 2006 04:49

Re: Is Apache::DB still the way to interactively debug via MP2

Boysenberry Payne wrote:
> print vs $r->print still works.  Is it better to use one over the other?
> If I change all of my $r->print statements to read print instead will
> I need to expect trouble?
do you have this in the file in question ?
use Apache2::RequestIO ()
use Apache2::RequestRec ()

just because you put in in startup.pl doesn't mean you shouldn't put it in the file itself.

------------------------------------------------------------------------
Philip M. Gollucci (pgollucci <at> p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"In all that I've done wrong I know I must have done something right to
deserve a hug every morning and butterfly kisses at night."

Boysenberry Payne | 2 Jul 2006 15:35

Re: Is Apache::DB still the way to interactively debug via MP2

That fixed the print issue but I'm still getting the following error:

Insecure $ENV{PATH} while running setgid at  
/Library/Perl/5.8.1/darwin-thread-multi-2level/Term/ReadKey.pm line  
334.\nCompilation failed in require at  
/Library/Perl/5.8.1/Term/ReadLine/Perl.pm line 63.\n

How can I tell what is causing the error?
I get it before the first line of code is run in my handler, so I'm  
guessing its
something during compile that causes it.  Am I off base?

Is Apache2 or MP2 compiled improperly maybe?

Any suggestions?

Thanks,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Jul 1, 2006, at 9:49 PM, Philip M. Gollucci wrote:

> Boysenberry Payne wrote:
>> print vs $r->print still works.  Is it better to use one over the  
>> other?
>> If I change all of my $r->print statements to read print instead will
>> I need to expect trouble?
> do you have this in the file in question ?
> use Apache2::RequestIO ()
(Continue reading)

Derek Whitaker | 2 Jul 2006 18:17
Picon
Favicon

Apache segfaults while running 'make test'

-------------8<---------- Start Bug Report
------------8<----------
1. Problem Description:

  Apache segfaults when I run the test suite.

2. Used Components and their Configuration:

*** mod_perl version 2.000002

*** using
/home/derek/mod_perl-2.0.2/lib/Apache2/BuildConfig.pm

*** Makefile.PL options:
  MP_APR_LIB     => aprext
  MP_APXS        => /usr/local/httpd2/bin/apxs
  MP_COMPAT_1X   => 1
  MP_DEBUG       => 1
  MP_GENERATE_XS => 1
  MP_LIBNAME     => mod_perl
  MP_TRACE       => 1
  MP_USE_DSO     => 1

*** /usr/local/httpd2/bin/httpd -V
Server version: Apache/2.2.2
Server built:   Jun  9 2006 08:43:01
Server's Module Magic Number: 20051115:2
Server loaded:  APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture:   32-bit
(Continue reading)


Gmane