You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Neil Gunton <ne...@nilspace.com> on 2003/07/02 20:21:12 UTC

Nested
Bug in 2.0b9

Hi Gerald, still testing 2.0b9 on my crazyguyonabike codebase - good
news, a few pages now seem to work, so progress being made! However, one
of my pages caused my machine to lock up completely - turned out that
the Apache process was taking up 100% of CPU and eventually exhausted
all virtual memory too. Not good! It took a little while, but I think
I've narrowed down what causes this to happen. The following code seems
to be a minimal case for making the bug manifest:

[- $count = 0 -]
<DL>
     [$ while $count < 10 $]
        <DL>
	<DD>[- print OUT $count; -]
	</DL>
	[- $count++ -]
     [$ endwhile $]
</DL>

The key things here are that if I take out the inner nested <DL> then it
works ok. And if I take out the [$ while $] loop it also works ok...
when I have the nested <DL> inside the [$ while $] loop it loops
forever. The 'print OUT' also seems to be necessary for the bug to show
itself - if I replace it with [+ $count +] then the code works ok.

This is running under Embperl::Object on RedHat 7.3, Apache/1.3.27,
mod_perl/1.27.

Hope this helps,

-Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Nested
Bug in 2.0b9

Posted by Neil Gunton <ne...@nilspace.com>.
Neil Gunton wrote:
> More seriously, I am now encountering a problem with one of my pages,
> where the apache process runs away and fills up all the computer memory
> and swap space very quickly. The only way to recover is to shut down
> apache. I am still trying to nail down why this happens - it seems to
> have something to do with a [$sub$] calling a perl subroutine, which
> calls another [$sub$]. This is all using Embperl::Object. Thing is, I
> can switch things around and comment bits out and there is no one piece
> of code that seems to cause the problem. At first I thought I had it
> down to a loop which was outputting records from a database query, but
> then I tried commenting out a different piece of code a little later in
> the same [$sub$], and now the database loop works! I have a feeling that
> it's something related to nested calls between [$sub$] and Perl subs,
> but I can't as yet nail down the minimal case that makes it happen. I'll
> try and experiment more, but if you have ideas for capturing what's
> happening from logfiles as it runs wild, then tell me what to do and
> I'll try to generate some results for you. Meanwhile, I'll keep
> experimenting to get a minimal case for you.

Gerald, this is proving quite difficult to nail down to a simple minimal
case. For me, however, this code seems to produce the effect. If I
remove or change an part (e.g. remove one of the innermost tables) then
it works fine. But, for me, it runs away and fills up memory rapidly.

The xxxx and yyyy subs are in a file of subs named Directory.epl, which
is executed from base.epl. The routines are called from
/directory/index.html. There is Directory.epl in the base dir, and
Directory.epl in the /directory dir. There is only one version of xxxx
and yyyy, both in /directory/Directory.epl.

[$ sub yyyy $]

   [- ($self) = @_; -]

[$ endsub $]

[$ sub xxxx $]

   [- ($self) = @_; -]

   <TABLE>

   <TR>
      <TD>
	 <TABLE>
	    <TR>
	       <TD>
		  [- $x = 1; -]
		  [$ while $x < 10 $]
		    [+ $x +]
		    [- $x += 1; -]
		  [$ endwhile $]
	       </TD>
	    </TR>
	 </TABLE>
      </TD>

      <TD>
	 <TABLE>
	    <TR>
	       <TD>
	           <TABLE>
			[- $self->yyyy(); -]
		   </TABLE>
	       </TD>
	    </TR>
         </TABLE>
      </TD>

   </TR>
   </TABLE>

[$ endsub $]

The problem certainly seems to be related to embedded tables. Anyway,
let me know if this setup causes a runaway on your system, if not then
I'll try and nail it down to a simpler case.

Thanks,

-Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Nested
Bug in 2.0b9

Posted by Gerald Richter <ri...@ecos.de>.
>
> Gerald, this is proving quite difficult to nail down to a simple
> minimal case. For me, however, this code seems to produce the effect.
> If I

Appended is a patch that should fix the problem (at least it does for me).
You can also fetch it from the CVS

Gerald


> remove or change an part (e.g. remove one of the innermost tables)
> then it works fine. But, for me, it runs away and fills up memory
> rapidly.
>
> The xxxx and yyyy subs are in a file of subs named Directory.epl,
> which is executed from base.epl. The routines are called from
> /directory/index.html. There is Directory.epl in the base dir, and
> Directory.epl in the /directory dir. There is only one version of xxxx
> and yyyy, both in /directory/Directory.epl.
>
> [$ sub yyyy $]
>
>    [- ($self) = @_; -]
>
> [$ endsub $]
>
> [$ sub xxxx $]
>
>    [- ($self) = @_; -]
>
>    <TABLE>
>
>    <TR>
>       <TD>
> <TABLE>
>     <TR>
>        <TD>
>   [- $x = 1; -]
>   [$ while $x < 10 $]
>     [+ $x +]
>     [- $x += 1; -]
>   [$ endwhile $]
>        </TD>
>     </TR>
> </TABLE>
>       </TD>
>
>       <TD>
> <TABLE>
>     <TR>
>        <TD>
>            <TABLE>
> [- $self->yyyy(); -]
>    </TABLE>
>        </TD>
>     </TR>
>          </TABLE>
>       </TD>
>
>    </TR>
>    </TABLE>
>
> [$ endsub $]
>
> The problem certainly seems to be related to embedded tables. Anyway,
> let me know if this setup causes a runaway on your system, if not then
> I'll try and nail it down to a simpler case.
>
> Thanks,
>
> -Neil
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org

--------------------------------------------------------------
Gerald Richter     ecos electronic communication services gmbh
IT-Securitylösungen * dynamische Webapplikationen * Consulting

Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de          Voice:   +49 6133 939-122
WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
--------------------------------------------------------------
|
|   ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
|
+-------------------------------------------------------------

Re: Nested
Bug in 2.0b9

Posted by Gerald Richter <ri...@ecos.de>.
Hi Neil,

thanks for the test code
>
> The problem certainly seems to be related to embedded tables. Anyway,
> let me know if this setup causes a runaway on your system, if not then
> I'll try and nail it down to a simpler case.
>

Yes, it does and endless loop here also. I try to find the bug and fix it
now...

Gerald

--------------------------------------------------------------
Gerald Richter     ecos electronic communication services gmbh
IT-Securitylösungen * dynamische Webapplikationen * Consulting

Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de          Voice:   +49 6133 939-122
WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
--------------------------------------------------------------
|
|   ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
|
+-------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Nested
Bug in 2.0b9

Posted by Neil Gunton <ne...@nilspace.com>.
Neil Gunton wrote:
> More seriously, I am now encountering a problem with one of my pages,
> where the apache process runs away and fills up all the computer memory
> and swap space very quickly. The only way to recover is to shut down
> apache. I am still trying to nail down why this happens - it seems to
> have something to do with a [$sub$] calling a perl subroutine, which
> calls another [$sub$]. This is all using Embperl::Object. Thing is, I
> can switch things around and comment bits out and there is no one piece
> of code that seems to cause the problem. At first I thought I had it
> down to a loop which was outputting records from a database query, but
> then I tried commenting out a different piece of code a little later in
> the same [$sub$], and now the database loop works! I have a feeling that
> it's something related to nested calls between [$sub$] and Perl subs,
> but I can't as yet nail down the minimal case that makes it happen. I'll
> try and experiment more, but if you have ideas for capturing what's
> happening from logfiles as it runs wild, then tell me what to do and
> I'll try to generate some results for you. Meanwhile, I'll keep
> experimenting to get a minimal case for you.

Gerald, this is proving quite difficult to nail down to a simple minimal
case. For me, however, this code seems to produce the effect. If I
remove or change an part (e.g. remove one of the innermost tables) then
it works fine. But, for me, it runs away and fills up memory rapidly.

The xxxx and yyyy subs are in a file of subs named Directory.epl, which
is executed from base.epl. The routines are called from
/directory/index.html. There is Directory.epl in the base dir, and
Directory.epl in the /directory dir. There is only one version of xxxx
and yyyy, both in /directory/Directory.epl.

[$ sub yyyy $]

   [- ($self) = @_; -]

[$ endsub $]

[$ sub xxxx $]

   [- ($self) = @_; -]

   <TABLE>

   <TR>
      <TD>
	 <TABLE>
	    <TR>
	       <TD>
		  [- $x = 1; -]
		  [$ while $x < 10 $]
		    [+ $x +]
		    [- $x += 1; -]
		  [$ endwhile $]
	       </TD>
	    </TR>
	 </TABLE>
      </TD>

      <TD>
	 <TABLE>
	    <TR>
	       <TD>
	           <TABLE>
			[- $self->yyyy(); -]
		   </TABLE>
	       </TD>
	    </TR>
         </TABLE>
      </TD>

   </TR>
   </TABLE>

[$ endsub $]

The problem certainly seems to be related to embedded tables. Anyway,
let me know if this setup causes a runaway on your system, if not then
I'll try and nail it down to a simpler case.

Thanks,

-Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Nested
Bug in 2.0b9

Posted by Neil Gunton <ne...@nilspace.com>.
Gerald Richter wrote:
> 
> Hi,
> 
> > No, I don't have any ClearModuleList in httpd.conf...
> >
> 
> ok
> 
> > Let me know if there's anything else I can do to help track it down...
> >
> 
> Could you please try things without preloading on startup and see if it
> works or if you still get the segfault

Ok, it seems to work better without preloading the modules. Apache
starts without error, and I can successfully access many pages on my
sites. There were some problems with 

[+ local $escmode; $something +]

which I fixed by converting to

[+ do {local $escmode; $something} +]

And there seems to be a problem with [$ sub $] if it contains a <DL> or
</DL> that doesn't match up - I have three [$ sub $] routines,
begin_help(), help_heading() and end_help(). The point is that I use
nested DL tags to indent the text, and the begin_help() starts the DL,
the help_heading() puts out a heading and also increases or decreases
the indentation as indicated by the input parms, and the end_help()
closes down all the DL lists (by using a global note of the depth). This
appears to break under Embperl 2.0, since it sees that the DL and /DL
tags don't cleanly match up in the same [$ sub $]. I fixed this by
converting the subs to standard perl subs instead, using print OUT to do
the HTML, and that seems to work now. It was a small enough change that
it wasn't too much bother to change, but I just thought you would still
like to know about a case where it might be desirable to have HTML
inside [$ sub $] that doesn't necessarily match up.

More seriously, I am now encountering a problem with one of my pages,
where the apache process runs away and fills up all the computer memory
and swap space very quickly. The only way to recover is to shut down
apache. I am still trying to nail down why this happens - it seems to
have something to do with a [$sub$] calling a perl subroutine, which
calls another [$sub$]. This is all using Embperl::Object. Thing is, I
can switch things around and comment bits out and there is no one piece
of code that seems to cause the problem. At first I thought I had it
down to a loop which was outputting records from a database query, but
then I tried commenting out a different piece of code a little later in
the same [$sub$], and now the database loop works! I have a feeling that
it's something related to nested calls between [$sub$] and Perl subs,
but I can't as yet nail down the minimal case that makes it happen. I'll
try and experiment more, but if you have ideas for capturing what's
happening from logfiles as it runs wild, then tell me what to do and
I'll try to generate some results for you. Meanwhile, I'll keep
experimenting to get a minimal case for you.

This version seems greatly improved, Gerald - I would say, after a small
amount of testing, that many pages in crazyguyonabike work now. There
are still some other errors I saw which I haven't determined yet, but
I'll let you know when I do.

The module preloading issue is still a problem, but maybe I am doing
something wrong or inappropriate for 2.0 in my startup.pl?

Thanks again, Gerald,

-Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Nested
Bug in 2.0b9

Posted by Gerald Richter <ri...@ecos.de>.
Hi,

> No, I don't have any ClearModuleList in httpd.conf...
>

ok

> Let me know if there's anything else I can do to help track it down...
>

Could you please try things without preloading on startup and see if it
works or if you still get the segfault

Gerald


--------------------------------------------------------------
Gerald Richter     ecos electronic communication services gmbh
IT-Securitylösungen * dynamische Webapplikationen * Consulting

Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de          Voice:   +49 6133 939-122
WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
--------------------------------------------------------------
|
|   ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
|
+-------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Nested
Bug in 2.0b9

Posted by Neil Gunton <ne...@nilspace.com>.
Gerald Richter wrote:
> > so I am testing with that. However I've
> > immediately run into a problem with starting Apache. I'm running
> > 1.3.29, mod_perl 1.29, compiled with gcc 3.3.2 (from source) and Red
> > Hat 7.3 (fully patched).
> >
> > When I start apache, I get the following errors from startup.pl:
> >
> > [7748]ERR:  56: : Unknown Provider epcompile
> > Embperl::Execute /www/vhosts/www.neilgunton.com/htdocs/index.html
> 
> Do you have a
> 
> ClearModuleList
> 
> in your httpd.conf, if yes please try without it.
> 
> Somebody else reported a similar problem some days before, but I not yet
> sure what the reason is.

No, I don't have any ClearModuleList in httpd.conf...

Let me know if there's anything else I can do to help track it down... 

Thanks, Gerald, for all your work on this!

-Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Nested
Bug in 2.0b9

Posted by Gerald Richter <ri...@ecos.de>.
>
> I assume that this patch is in the latest 2.0b10 (which was announced
> the day after this bugfix),

Yes

> so I am testing with that. However I've
> immediately run into a problem with starting Apache. I'm running
> 1.3.29, mod_perl 1.29, compiled with gcc 3.3.2 (from source) and Red
> Hat 7.3 (fully patched).
>
> When I start apache, I get the following errors from startup.pl:
>
> [7748]ERR:  56: : Unknown Provider epcompile
> Embperl::Execute /www/vhosts/www.neilgunton.com/htdocs/index.html

Do you have a

ClearModuleList

in your httpd.conf, if yes please try without it.

Somebody else reported a similar problem some days before, but I not yet
sure what the reason is.

Gerald


--------------------------------------------------------------
Gerald Richter     ecos electronic communication services gmbh
IT-Securitylösungen * dynamische Webapplikationen * Consulting

Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de          Voice:   +49 6133 939-122
WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
--------------------------------------------------------------
|
|   ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
|
+-------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Nested
Bug in 2.0b9

Posted by Neil Gunton <ne...@nilspace.com>.
Gerald Richter wrote:
> 
> H Neil,
> 
> > following code seems to be a minimal case for making the bug manifest:
> >
> > [- $count = 0 -]
> > <DL>
> >      [$ while $count < 10 $]
> >         <DL>
> > <DD>[- print OUT $count; -]
> > </DL>
> > [- $count++ -]
> >      [$ endwhile $]
> > </DL>
> >
> 
> Also you might believe that it never will happen, the DL nesting bug is now
> fixed in the CVS version.
> 
> Sorry, for the very long delay.I try to be quicker the next time you report
> a bug :-)
> 
> Gerald

Hi Gerald,

I assume that this patch is in the latest 2.0b10 (which was announced
the day after this bugfix), so I am testing with that. However I've
immediately run into a problem with starting Apache. I'm running 1.3.29,
mod_perl 1.29, compiled with gcc 3.3.2 (from source) and Red Hat 7.3
(fully patched).

When I start apache, I get the following errors from startup.pl:

[7748]ERR:  56: : Unknown Provider epcompile 
Embperl::Execute /www/vhosts/www.neilgunton.com/htdocs/index.html
[7748]ERR:  56: : Unknown Provider epcompile 
Embperl::Execute /www/vhosts/www.neilgunton.com/htdocs/test.html
etc

This is caused by startup.epl attempting to preload all my modules (in
order to share as much memory as possible between the apache children).
This works fine under 1.3.6. After the whole string of errors like the
ones above for every module, the message is that Apache has started, and
I can see the child processes, but when I try to access any page, I get
a segmentation fault:

[Sat Jan 24 17:59:12 2004] [notice] child pid 7790 exit signal
Segmentation fault (11)

These may well be two separate issues - I would just like to know if the
first 'Unknown Provider epcompile' is anything you've seen before? Below
is the startup.pl that causes this error.

What would you like me to do regarding the segfault?

Thanks,

-Neil

#!/usr/bin/perl

# First modify the include path
BEGIN
{
    use strict;
    use Apache ();
    use lib '/www/lib/perl';
}


# Common modules
use Apache::Constants ();
use Apache::File ();
use Apache::Log ();
use IO::Zlib ();
use Safe ();
use URI::Escape ();
use Log::Logger ();
use File::Copy ();
use File::Path ();
use File::Glob ();
use Time::Zone ();
use CGI qw (-compile :cookie cgi_error header);
use Date::Calc qw(:all);
use Image::Magick ();
use HTML::Embperl ();
use HTML::EmbperlObject ();
use Embperl ();
use Embperl::Object ();
use Mail::Sender;
use LWP::UserAgent;
use HTTP::Request;
use DBI ();
DBI->install_driver('mysql');
use Digest::HMAC_MD5 qw(hmac_md5_hex);
use SOAP::Lite ();
use Text::Wrap;

# My modules
use Apache::BlockAgent ();
use Apache::Nilspace::Main::Access ();
use Apache::Nilspace::Subscription::Access ();
use Apache::Nilspace::Subscription::Handler ();
use Nilspace ();
use Nilspace::Agenda ();
use Nilspace::Commerce ();
use Nilspace::Mail ();

# Apache::VMonitor
use Apache::VMonitor();
$Apache::VMonitor::Config{BLINKING} = 1;
$Apache::VMonitor::Config{REFRESH}  = 0;
$Apache::VMonitor::Config{VERBOSE}  = 0;
$Apache::VMonitor::Config{SYSTEM}   = 1;
$Apache::VMonitor::Config{APACHE}   = 1;
$Apache::VMonitor::Config{PROCS}    = 1;
$Apache::VMonitor::Config{MOUNT}    = 1;
$Apache::VMonitor::Config{FS_USAGE} = 1;
$Apache::VMonitor::Config{SORT_BY}  = 'size';
$Apache::VMonitor::PROC_REGEX = join "\|", qw(httpd_proxy httpd_perl
mysql );

# For handling the remote ip address through mod_proxy reverse proxy
sub My::ProxyRemoteAddr ($)
{
    my $r = shift;
                                    
    # we'll only look at the X-Forwarded-For header if the requests
    # comes from our proxy at localhost
    return Apache::Constants::OK 
	unless ($r->connection->remote_ip eq "127.0.0.1") 
	and $r->header_in('X-Forwarded-For');
                                   
    # Select last value in the chain -- original client's ip
    if (my ($ip) = $r->headers_in->{'X-Forwarded-For'} =~ /([^,\s]+)$/)
    {
	$r->connection->remote_ip($ip);
    }
    
    return Apache::Constants::OK;
}

# Preload Embperl website code
if (lc($ENV{PRELOAD_WEBSITES}) eq 'on')
{
    preload_dir ('/www/lib/perl/Apache', '*.html *.epl');
    preload_dir ('/www/vhosts/www.neilgunton.com/htdocs', '*.html
*.epl');
    preload_dir ('/www/vhosts/www.crazyguyonabike.com/htdocs', '*.html
*.epl');
}

# Recursive directory traversal sub which preloads Embperl files
sub preload_dir
{
    my ($dir,            # The current directory which is to be
processed
	$pattern,        # A pattern identifying files to be processed, e.g.
'*.html *.epl'
	@search_path     # List of paths for giving to Embperl to search for
files
	) = @_;

    @search_path = () if !@search_path;

    # Put the current dir on the search path
    push (@search_path, $dir);

    local *DIR;
    opendir (DIR, $dir) or die "Could not open directory: $dir: $!";

    # First, process files in this directory
    # Pattern consists of a potential list of patterns, separated by
spaces.
    # First we make a list of patterns, and then glob each of these
    foreach my $glob (split (/\s/, $pattern))
    {
	# Iterate through the resulting list of files
	foreach my $file (File::Glob::glob ("$dir/$glob"))
	{
	    if (!(-d $file) && (-e $file))
	    {
		# Build up the paths, starting with the current dir and working back
up to the website root
		my $path = '';
		foreach my $i (1 .. scalar(@search_path))
		{
		    $path .= ':' . $search_path[scalar(@search_path) - $i];
		}
		$path .= ':/www/lib/perl/Apache/';
		$file =~ /\/([^\/]+)$/;
		my $filename = $1;
		print "Embperl::Execute $file\n";
		Embperl::Execute ({inputfile => $file,
				   path => $path,
				   import => 0,
				   escmode => 0,
				   options => 16
			           }) ;
	    }
	}
    }

    # Now, recursively go down into subdirectories
    while (defined(my $subdir = readdir (DIR)))
    {
	# Only recurse on directories, which do not start with ".", and skip
symbolic links
	if (-d "$dir/$subdir" &&
	    !(-l "$dir/$subdir") &&
	    ($subdir !~ /^\.{1,2}$/))
	{
	    
	    preload_dir ("$dir/$subdir", $pattern, @search_path);
	}
    }
}

1;

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Nested
Bug in 2.0b9

Posted by Gerald Richter <ri...@ecos.de>.
H Neil,

> following code seems to be a minimal case for making the bug manifest:
>
> [- $count = 0 -]
> <DL>
>      [$ while $count < 10 $]
>         <DL>
> <DD>[- print OUT $count; -]
> </DL>
> [- $count++ -]
>      [$ endwhile $]
> </DL>
>

Also you might believe that it never will happen, the DL nesting bug is now
fixed in the CVS version.

Sorry, for the very long delay.I try to be quicker the next time you report
a bug :-)

Gerald

--------------------------------------------------------------
Gerald Richter     ecos electronic communication services gmbh
IT-Securitylösungen * dynamische Webapplikationen * Consulting

Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de          Voice:   +49 6133 939-122
WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
--------------------------------------------------------------
|
|   ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
|
+-------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Nested
Bug in 2.0b9

Posted by Gerald Richter <ri...@ecos.de>.
>
> Gerald, this was from 5th July, and I am not sure what the status of the
> bug is. 

Nothing changed since this email :-(

> I know you're pressed for time, but it occurred to me that
> perhaps it would help keep track of Embperl bugs if you used the bug
> tracking system which SourceForge provides.

I use a simple bug tracking system, that's a file called TODO inside the 
Embperl distribution. The most up to date version is always in the CVS.
This keeps tracks of issuse people posted on the list. 

At the moment this seems the easiest way to handle things for me

Gerald

P.S. If a problem is solved it will always apear in the Changes.pod 



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Nested
Bug in 2.0b9

Posted by Neil Gunton <ne...@nilspace.com>.
Gerald Richter wrote:
> 
> >
> > Unfortunately it's not really possible to replace 'print OUT' with [+ +]
> > in my code, because there are subroutines here which are recursive in
> > nature and so cannot be done using [$ sub $] (at least in 1.3),
> 
> Should be also possible in 1.3, also it's more complicated.
> 
> I try to fix the problem as soon as possible
> 
> Gerald

Gerald, this was from 5th July, and I am not sure what the status of the
bug is. I know you're pressed for time, but it occurred to me that
perhaps it would help keep track of Embperl bugs if you used the bug
tracking system which SourceForge provides. We used one version of it on
the last project I did at a large bank, and was very helpful keeping
track of the bugs within the team, prioritizing, commenting and
resolving. I don't know what the current state of that software (or
website) is, but I believe the bank was using the last open source
version before it (I think) became non-GPL in its licensing. The bank
was running it locally on their servers... perhaps other people on the
Embperl list know more about this, and whether it would be a good idea
here? Only, of course, if it would actually help you, rather than just
create more work. Just an idea...

All the best,

-Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Nested
Bug in 2.0b9

Posted by Gerald Richter <ri...@ecos.de>.
> 
> Unfortunately it's not really possible to replace 'print OUT' with [+ +]
> in my code, because there are subroutines here which are recursive in
> nature and so cannot be done using [$ sub $] (at least in 1.3), 

Should be also possible in 1.3, also it's more complicated.

I try to fix the problem as soon as possible

Gerald



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Nested
Bug in 2.0b9

Posted by Neil Gunton <ne...@nilspace.com>.
Gerald Richter wrote:
> 
> Hi Neil,
> 
> I didn't managed to fix the bug so far. The best thing is to use [+ +]
> instead of print OUT, because handling of print OUT is much more complicated
> inside Embperl.

Hi Gerald,

Unfortunately it's not really possible to replace 'print OUT' with [+ +]
in my code, because there are subroutines here which are recursive in
nature and so cannot be done using [$ sub $] (at least in 1.3), but
rather have to be normal Perl subs... and so they have to use 'print
OUT'. For new code it wouldn't be a problem to simply return a string
which is then output using [+ +] instead of doing 'print OUT', but for
the large codebase I am working with I think I'd rather wait for the
bugfix! Meanwhile, I'll try and continue testing other stuff.

Thanks again,

-Neil

p.s. Looking again at my explanation of the bug, I realize that I may
have been somewhat imprecise: When I say that it works when I remove the
inner nested <DL>, I meant the following:

[- $count = 0 -]
<DL>
  [$ while $count < 10 $]
    <DD>[- print OUT $count; -]
    [- $count++ -]
  [$ endwhile $]
</DL>

In other words, I don't mean removing the 'print OUT' makes things work,
but rather that simply removing the nested <DL> aspect of it makes it
work. Hope this helps...




> ----- Original Message -----
> From: "Neil Gunton" <ne...@nilspace.com>
> To: "embperl" <em...@perl.apache.org>
> Sent: Wednesday, July 02, 2003 8:21 PM
> Subject: Nested <DL> Bug in 2.0b9
> 
> > Hi Gerald, still testing 2.0b9 on my crazyguyonabike codebase - good
> > news, a few pages now seem to work, so progress being made! However, one
> > of my pages caused my machine to lock up completely - turned out that
> > the Apache process was taking up 100% of CPU and eventually exhausted
> > all virtual memory too. Not good! It took a little while, but I think
> > I've narrowed down what causes this to happen. The following code seems
> > to be a minimal case for making the bug manifest:
> >
> > [- $count = 0 -]
> > <DL>
> >      [$ while $count < 10 $]
> >         <DL>
> > <DD>[- print OUT $count; -]
> > </DL>
> > [- $count++ -]
> >      [$ endwhile $]
> > </DL>
> >
> > The key things here are that if I take out the inner nested <DL> then it
> > works ok. And if I take out the [$ while $] loop it also works ok...
> > when I have the nested <DL> inside the [$ while $] loop it loops
> > forever. The 'print OUT' also seems to be necessary for the bug to show
> > itself - if I replace it with [+ $count +] then the code works ok.
> >
> > This is running under Embperl::Object on RedHat 7.3, Apache/1.3.27,
> > mod_perl/1.27.
> >
> > Hope this helps,
> >
> > -Neil
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> > For additional commands, e-mail: embperl-help@perl.apache.org
> >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Nested
Bug in 2.0b9

Posted by Gerald Richter <ri...@ecos.de>.
Hi Neil,

I didn't managed to fix the bug so far. The best thing is to use [+ +]
instead of print OUT, because handling of print OUT is much more complicated
inside Embperl.

Gerald

--------------------------------------------------------------
Gerald Richter     ecos electronic communication services gmbh
IT-Securitylösungen * dynamische Webapplikationen * Consulting

Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de          Voice:   +49 6133 939-122
WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
--------------------------------------------------------------
|
|   ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
|
+-------------------------------------------------------------

----- Original Message -----
From: "Neil Gunton" <ne...@nilspace.com>
To: "embperl" <em...@perl.apache.org>
Sent: Wednesday, July 02, 2003 8:21 PM
Subject: Nested <DL> Bug in 2.0b9


> Hi Gerald, still testing 2.0b9 on my crazyguyonabike codebase - good
> news, a few pages now seem to work, so progress being made! However, one
> of my pages caused my machine to lock up completely - turned out that
> the Apache process was taking up 100% of CPU and eventually exhausted
> all virtual memory too. Not good! It took a little while, but I think
> I've narrowed down what causes this to happen. The following code seems
> to be a minimal case for making the bug manifest:
>
> [- $count = 0 -]
> <DL>
>      [$ while $count < 10 $]
>         <DL>
> <DD>[- print OUT $count; -]
> </DL>
> [- $count++ -]
>      [$ endwhile $]
> </DL>
>
> The key things here are that if I take out the inner nested <DL> then it
> works ok. And if I take out the [$ while $] loop it also works ok...
> when I have the nested <DL> inside the [$ while $] loop it loops
> forever. The 'print OUT' also seems to be necessary for the bug to show
> itself - if I replace it with [+ $count +] then the code works ok.
>
> This is running under Embperl::Object on RedHat 7.3, Apache/1.3.27,
> mod_perl/1.27.
>
> Hope this helps,
>
> -Neil
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org