Skip Menu |

This queue is for tickets about the Clone-More CPAN distribution.

Report information
The Basics
Id: 21151
Status: open
Priority: 0/
Queue: Clone-More

People
Owner: Nobody in particular
Requestors: hpham [...] re-trac.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.90.2
Fixed in: (no value)



Subject: Segfault in mod_perl
I've seen a few Apache segfault that might have been caused by Clone::More. This is the error message in the log file: Free to wrong pool 1d7a338 not 2189fb8 at C:/Perl/site/lib/Clone/ More.pm line 30. My env. is active perl 5.8.8 modperl 2.0.2, Apache 2.0.58 and Windows XP.
Very interesting - and thank you for filing a bug. I was wondering if you might be able to answer a few questions for me that may help me understand more about the issue: - What functions are you using (I will assume clone()) - Are you using any of the provided Hooks? - What is the general structure of the data structures you are attempting to clone (again, assuming Clone::More::clone). Thank you again for the bug report, and I'll be awaiting your response. On Wed Aug 23 10:39:01 2006, hpham wrote: Show quoted text
> I've seen a few Apache segfault that might have been caused by > Clone::More. This is the error message in the log file: > > Free to wrong pool 1d7a338 not 2189fb8 at C:/Perl/site/lib/Clone/ > More.pm line 30. > > My env. is active perl 5.8.8 modperl 2.0.2, Apache 2.0.58 and Windows > XP.
From: WAZZUTEKE [...] cpan.org
As I have been researching this error, I have another question to append to my previous list: Are you using threads in mod_perl? Thanks! On Wed Aug 23 16:30:30 2006, WAZZUTEKE wrote: Show quoted text
> Very interesting - and thank you for filing a bug. > > I was wondering if you might be able to answer a few questions for me > that may help me understand more about the issue: > > - What functions are you using (I will assume clone()) > - Are you using any of the provided Hooks? > - What is the general structure of the data structures you are > attempting to clone (again, assuming Clone::More::clone). > > Thank you again for the bug report, and I'll be awaiting your response. > > On Wed Aug 23 10:39:01 2006, hpham wrote:
> > I've seen a few Apache segfault that might have been caused by > > Clone::More. This is the error message in the log file: > > > > Free to wrong pool 1d7a338 not 2189fb8 at C:/Perl/site/lib/Clone/ > > More.pm line 30. > > > > My env. is active perl 5.8.8 modperl 2.0.2, Apache 2.0.58 and Windows > > XP.
> >
From: hpham [...] re-trac.com
Sorry, I got your email but was tied up with some other stuff. I was using clone without any Hooks. The data structure looks like this: [ { id => 1, modules => [ { id => 10, pages => { a => 1, b => 2 }, }, { id => 11, pages => { a => 3, c => 4 }, } ] }, { id => 2, modules => [ ... similar to above ] } ] I don't use thread in my webapp, but mod_perl does require that the intepreter and the application code have to be thread-safe. mod_perl may clone additional interpreters per user configuration. You can read more on mod_perl's thread requirement here: http://perl.apache.org/docs/2.0/user/intro/overview.html#Threads_Support Thanks. On Thu Aug 24 12:26:08 2006, WAZZUTEKE wrote: Show quoted text
> As I have been researching this error, I have another question to
append Show quoted text
> to my previous list: > > Are you using threads in mod_perl? > > Thanks!
From: hpham [...] re-trac.com
umm... you may want to see the text/plain version as that one will retain the whitespace (reg. the data structure indentation).
Subject: Re: [rt.cpan.org #21151] Segfault in mod_perl
Date: Sat, 26 Aug 2006 20:59:50 -0700
To: bug-Clone-More [...] rt.cpan.org
From: "Trevor Hall" <hallta [...] gmail.com>
Thank you for your quick respose. I understand that you will (might) need thread-safe Perl to run mod_perl in some environments (ie. if you have a threadded MPM versus forked MPM), and I suppose my question was more general than Perl. Subsequently, I have a few more questions that would help in my troubleshooting: 1. I understand you are not running a muti-threadded application in Perl, though is your Apache compiled to run with thread or fork based MPMs? I know you are running Windows XP, so I will assume threadded MPMs versus forked. 2. I fully understand the constraints of providing too much infomration, but I was hoping I could get more infomation on your application. Such as: * What other modules are you running * How are you using Clone::More::clone? IE Can you give me a quick code example of your implementation. The more information you can give, the better. I have never seen this module segfault and I have seen the module implemented in very large and heavily used environments; though never in Windows - I think the threadded MPMs may be the culperate. Given your data structure, I see nothing that would lend to the idea that you are stretching the bounds of Clone::More; it's best at A(o[AH])+. Thank you again for working with me on this - I will do what I can to patch this issue for you as soon as I can duplicate it or otherwise figure it out. On 8/24/06, Hai Pham via RT <bug-Clone-More@rt.cpan.org> wrote: Show quoted text
> > > Queue: Clone-More > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=21151 > > > umm... you may want to see the text/plain version as that one will > retain the whitespace (reg. the data structure indentation). >
From: hpham [...] re-trac.com
Trevor, 1. Yes, it is threaded MPM. 2. We don't use a lot of other external modules. Here is our full list: - DBI - DBD-MySQL - GD - GDGraph - Template-Toolkit - MIME-Lite - Digest-SHA - TimeDate - Test-Class (developer machine only) - Log-Log4perl - Class-Singleton - Apache-DBI - Apache-Session - Session And here is the method that use clone: sub filter_empty_modules { my ($sectors) = @_; my $ar = []; foreach my $sec ( @$sectors ) { my $sector = clone($sec); my $modules = []; foreach my $mod ( @{$$sec{modules}} ) { my $pages = $$mod{pages} or next; push(@$modules, $mod) if $$pages{has_program}; } next if @$modules == 0; $$sector{modules} = $modules; push @$ar, $sector; } return $ar; } The problem with mod_perl env. is that you don't know when the problem will occur; could be after 100 hits or a thousand hit. I really appreciate that you are looking into this prob. Thanks. On Sun Aug 27 00:00:05 2006, hallta@gmail.com wrote: Show quoted text
> Thank you for your quick respose. > > I understand that you will (might) need thread-safe Perl to run
mod_perl in Show quoted text
> some environments (ie. if you have a threadded MPM versus forked
MPM), and I Show quoted text
> suppose my question was more general than Perl. Subsequently, I have
a few Show quoted text
> more questions that would help in my troubleshooting: > > 1. I understand you are not running a muti-threadded application in
Perl, Show quoted text
> though is your Apache compiled to run with thread or fork based
MPMs? I Show quoted text
> know you are running Windows XP, so I will assume threadded MPMs
versus Show quoted text
> forked. > > 2. I fully understand the constraints of providing too much
infomration, but Show quoted text
> I was hoping I could get more infomation on your application. Such
as: Show quoted text
> > * What other modules are you running > * How are you using Clone::More::clone? IE Can you give me a quick
code Show quoted text
> example of your implementation. > > The more information you can give, the better. I have never seen this > module segfault and I have seen the module implemented in very large
and Show quoted text
> heavily used environments; though never in Windows - I think the
threadded Show quoted text
> MPMs may be the culperate. > > Given your data structure, I see nothing that would lend to the idea
that Show quoted text
> you are stretching the bounds of Clone::More; it's best at A(o[AH])+. > > Thank you again for working with me on this - I will do what I can to
patch Show quoted text
> this issue for you as soon as I can duplicate it or otherwise figure
it out. Show quoted text
>
Subject: Re: [rt.cpan.org #21151] Segfault in mod_perl
Date: Fri, 8 Sep 2006 06:05:53 -0700
To: bug-Clone-More [...] rt.cpan.org
From: "Trevor Hall" <hallta [...] gmail.com>
Thank you for this infomration. I think I can use this to move forward to see what the issue might be. Thanks again! On 8/29/06, Hai Pham via RT <bug-Clone-More@rt.cpan.org> wrote: Show quoted text
> > > Queue: Clone-More > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=21151 > > > Trevor, > > 1. Yes, it is threaded MPM. > > > 2. We don't use a lot of other external modules. Here is our full list: > - DBI > - DBD-MySQL > - GD > - GDGraph > - Template-Toolkit > - MIME-Lite > - Digest-SHA > - TimeDate > - Test-Class (developer machine only) > - Log-Log4perl > - Class-Singleton > - Apache-DBI > - Apache-Session > - Session > > And here is the method that use clone: > > sub filter_empty_modules > { > my ($sectors) = @_; > > my $ar = []; > > foreach my $sec ( @$sectors ) > { > my $sector = clone($sec); > my $modules = []; > > foreach my $mod ( @{$$sec{modules}} ) > { > my $pages = $$mod{pages} or next; > push(@$modules, $mod) if $$pages{has_program}; > } > > next if @$modules == 0; > > $$sector{modules} = $modules; > push @$ar, $sector; > } > > return $ar; > } > > The problem with mod_perl env. is that you don't know when the problem > will occur; could be after 100 hits or a thousand hit. > > I really appreciate that you are looking into this prob. > > Thanks. > > On Sun Aug 27 00:00:05 2006, hallta@gmail.com wrote:
> > Thank you for your quick respose. > > > > I understand that you will (might) need thread-safe Perl to run
> mod_perl in
> > some environments (ie. if you have a threadded MPM versus forked
> MPM), and I
> > suppose my question was more general than Perl. Subsequently, I have
> a few
> > more questions that would help in my troubleshooting: > > > > 1. I understand you are not running a muti-threadded application in
> Perl,
> > though is your Apache compiled to run with thread or fork based
> MPMs? I
> > know you are running Windows XP, so I will assume threadded MPMs
> versus
> > forked. > > > > 2. I fully understand the constraints of providing too much
> infomration, but
> > I was hoping I could get more infomation on your application. Such
> as:
> > > > * What other modules are you running > > * How are you using Clone::More::clone? IE Can you give me a quick
> code
> > example of your implementation. > > > > The more information you can give, the better. I have never seen this > > module segfault and I have seen the module implemented in very large
> and
> > heavily used environments; though never in Windows - I think the
> threadded
> > MPMs may be the culperate. > > > > Given your data structure, I see nothing that would lend to the idea
> that
> > you are stretching the bounds of Clone::More; it's best at A(o[AH])+. > > > > Thank you again for working with me on this - I will do what I can to
> patch
> > this issue for you as soon as I can duplicate it or otherwise figure
> it out.
> >
> >