You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Jochen Topf <jo...@remote.org> on 2002/03/18 11:15:07 UTC
2.0b6 namespace HTML vs. non HTML
Hi!
I tried to install 2.0b6 but got some problems with it. The release notes
say
> - Embperl have move from the namespace HTML::Embperl to Embperl.
> This is because Embperl is no longer only a HTML framework,
> but is suitable for other formats like XML too. Also this allows
> to install Embperl 1.x and 2.x on the same machine without
> conflicts, to make a smooth upgrade.
but there are still several references to HTML::Embperl in 2.0b6 and now I
get some error messages like "Can't locate HTML/Embperl.pm in @INC..."
Jochen
--
Jochen Topf jochen@remote.org http://www.remote.org/jochen/ +49-721-388298
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: write module for Embperl and HTML::Embperl namespace (was: 2.0b6 namespace HTML vs. non HTML)
Posted by Gerald Richter <ri...@ecos.de>.
>
> That's fine, but how do I tell which one called me? The joys of
> object-oriented programming--my module is two deep down to easily be
> passed the information.
>
If only one module of both is loaded, you can simply test for existens for
some symbol you now that should exist e.g.
if (define(&Embperl::handler))
.....
if both are used in the same server that won't work, and you have to walk up
your call stack using the caller function, to see from where you are called
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: write module for Embperl and HTML::Embperl namespace (was:
2.0b6 namespace HTML vs. non HTML)
Posted by Kee Hinckley <na...@somewhere.com>.
At 9:09 PM +0100 3/18/02, Gerald Richter wrote:
> > I have some perl libraries that check to see if they are running in
>> Embperl so they can use certain things (typically OUT and escmode).
>> What's the best way to make it possible for them to run under either
>> environment?
>
>Instead of using Embperl::OUT etc. directly, make an alias into your
>package. You can make this alias to HTML::Embperl or Embperl, depending from
>where you are called, e.g.:
That's fine, but how do I tell which one called me? The joys of
object-oriented programming--my module is two deep down to easily be
passed the information.
--
Kee Hinckley - Somewhere.Com, LLC
http://consulting.somewhere.com/
nazgul@somewhere.com
I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: write module for Embperl and HTML::Embperl namespace (was: 2.0b6 namespace HTML vs. non HTML)
Posted by Gerald Richter <ri...@ecos.de>.
> I have some perl libraries that check to see if they are running in
> Embperl so they can use certain things (typically OUT and escmode).
> What's the best way to make it possible for them to run under either
> environment?
Instead of using Embperl::OUT etc. directly, make an alias into your
package. You can make this alias to HTML::Embperl or Embperl, depending from
where you are called, e.g.:
*OUT = \*Embperl::OUT ;
*fdat = \%Embperl::fdat ;
or if you want to have compatibility, you can create the alias in
HTML::Embperl namespace:
*HTML::Embperl::OUT = \*Embperl::OUT ;
*HTML::Embperl::fdat = \%Embperl::fdat ;
but this will not work if you use 1.3 and 2.0b6+ on the same Apache server.
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: 2.0b6 namespace HTML vs. non HTML
Posted by Kee Hinckley <na...@somewhere.com>.
I have some perl libraries that check to see if they are running in
Embperl so they can use certain things (typically OUT and escmode).
What's the best way to make it possible for them to run under either
environment?
--
Kee Hinckley - Somewhere.Com, LLC
http://consulting.somewhere.com/
nazgul@somewhere.com
I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: 2.0b6 namespace HTML vs. non HTML
Posted by Jochen Topf <jo...@remote.org>.
On Wed, Mar 20, 2002 at 09:23:11AM +0100, Gerald Richter wrote:
> From: "Gerald Richter" <ri...@ecos.de>
> To: "Jochen Topf" <jo...@remote.org>, <em...@perl.apache.org>
> Subject: Re: 2.0b6 namespace HTML vs. non HTML
> Date: Wed, 20 Mar 2002 09:23:11 +0100
>
> >
> > I am pretty sure, I am not using any globals.
> >
>
> This must be not a global, could be some other reference that still holds
> the request object.
>
> I fixed the problem, so Embperl won't segfault anymore in this situation.
> Please try the appended new version of epinit.c
Works great! This fixes the segfaults and also the "Attempt to free
unreferenced scalar" problem. So I am happy now! :-)
Jochen
--
Jochen Topf jochen@remote.org http://www.remote.org/jochen/ +49-721-388298
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: 2.0b6 namespace HTML vs. non HTML
Posted by Gerald Richter <ri...@ecos.de>.
>
> I am pretty sure, I am not using any globals.
>
This must be not a global, could be some other reference that still holds
the request object.
I fixed the problem, so Embperl won't segfault anymore in this situation.
Please try the appended new version of epinit.c
> BTW what is the preferred way of getting the Apache request object? I am
> using this at the beginning of base.epl:
>
Embperl defines the variable $req_rec for you, which holds the apache
request, starting with 2.0b6 you could also say
> [-
>
> $req = shift;
$apreq = $req -> apache_req;
>
> -]
>
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
Re: 2.0b6 namespace HTML vs. non HTML
Posted by Jochen Topf <jo...@remote.org>.
On Tue, Mar 19, 2002 at 07:16:56PM +0100, Gerald Richter wrote:
> > [Tue Mar 19 16:28:35 2002] [error] [14366]ERR: 24: Error in Perl code:
> Can't upgrade that kind of scalar at /var/www/92/base.epl line 58.
> > [14366]ERR: 67: There is still -1 reference(s) to the request.param
> object, while there shouldn't be any.
>
> Looks like you keep a reference to the EMbperl request object and/or $r ->
> param somewhere. It is cleaned up during the next request when you assign
> the new request object, but at this time the underlying C structure is
> already gone so it crashs. Also you shoudn't keep the object reference,
> Embperl should handle this more gracefully.
>
> Try to find the place where you keep the request object, maybe in a global
I am pretty sure, I am not using any globals.
BTW what is the preferred way of getting the Apache request object? I am
using this at the beginning of base.epl:
[-
$req = shift;
$apreq = Apache->request();
-]
Jochen
--
Jochen Topf jochen@remote.org http://www.remote.org/jochen/ +49-721-388298
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: 2.0b6 namespace HTML vs. non HTML
Posted by Gerald Richter <ri...@ecos.de>.
> [Tue Mar 19 16:28:35 2002] [error] [14366]ERR: 24: Error in Perl code:
Can't upgrade that kind of scalar at /var/www/92/base.epl line 58.
> [14366]ERR: 67: There is still -1 reference(s) to the request.param
object, while there shouldn't be any.
Looks like you keep a reference to the EMbperl request object and/or $r ->
param somewhere. It is cleaned up during the next request when you assign
the new request object, but at this time the underlying C structure is
already gone so it crashs. Also you shoudn't keep the object reference,
Embperl should handle this more gracefully.
Try to find the place where you keep the request object, maybe in a global
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: 2.0b6 namespace HTML vs. non HTML
Posted by Jochen Topf <jo...@remote.org>.
On Tue, Mar 19, 2002 at 01:57:21PM +0100, Gerald Richter wrote:
> > Attempt to free unreferenced scalar at /var/www/92/base.epl line 22.
> >
>
> This shouldn't happen :-(
>
>
> > This line contains this:
> > my $obj = Execute( { 'object' => "$ENV{DOCUMENT_ROOT}/$file", 'import' =>
> 0});
> >
>
> Could you try without the import => 0 (it's not necessary here)
Without the 'import => 0' it seems to work... Also I found that the Execute
seems to normally return something like this:
Embperl::__6=HASH(0x84bddb8)
But sometimes it returns something like this:
UNKNOWN(0x8421c88)
I hope this helps you to track down the problem. If I have the time later
I will try the debugging stuff.
Jochen
--
Jochen Topf jochen@remote.org http://www.remote.org/jochen/ +49-721-388298
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: 2.0b6 namespace HTML vs. non HTML
Posted by Gerald Richter <ri...@ecos.de>.
>
> What happens is this: I restart apache. Some pages work, some result in
> segfault. After clicking around for a while the pages that resulted in
> segfaults suddenly work. This might or might not be related to the
following
> message in the error log:
>
> Attempt to free unreferenced scalar at /var/www/92/base.epl line 22.
>
This shouldn't happen :-(
> This line contains this:
> my $obj = Execute( { 'object' => "$ENV{DOCUMENT_ROOT}/$file", 'import' =>
0});
>
Could you try without the import => 0 (it's not necessary here)
> Very confusing... How would I go about debugging this?
>
run
perl Makefile.PL debug
make install
now you have debugging symbols in your Embperl binary. You can now start
Apache under gdb (with -X for single process mode), something like
gdb /usr/sbin/httpd
set args -f /path/to/httpd.conf -X
r
do your requests...., then the segfault should happen., make a
BT
and send the output to me
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: 2.0b6 namespace HTML vs. non HTML
Posted by Jochen Topf <jo...@remote.org>.
On Mon, Mar 18, 2002 at 03:17:28PM +0100, Gerald Richter wrote:
> > but there are still several references to HTML::Embperl in 2.0b6 and now I
> > get some error messages like "Can't locate HTML/Embperl.pm in @INC..."
> >
>
> Where do you have references to HTML::Embperl? I don't find any...
>
> Maybe the following is your problem: HTML::EmbperlObject was renamed to
> Embperl::Object, but the old EmbperlObject.pm is still in the distribution
> (I forgot to remove it) and it contains refeneces to HTML::Embperl, but it
> won't work anyway anymore. So use Embperl::Object
Ah, ok. That was the problem. Works better now...
But now I have a different problem: Embperl segfaults on certain pages, but
only sometimes...
What happens is this: I restart apache. Some pages work, some result in
segfault. After clicking around for a while the pages that resulted in
segfaults suddenly work. This might or might not be related to the following
message in the error log:
Attempt to free unreferenced scalar at /var/www/92/base.epl line 22.
This line contains this:
my $obj = Execute( { 'object' => "$ENV{DOCUMENT_ROOT}/$file", 'import' => 0});
Very confusing... How would I go about debugging this?
Jochen
--
Jochen Topf jochen@remote.org http://www.remote.org/jochen/ +49-721-388298
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: 2.0b6 namespace HTML vs. non HTML
Posted by Gerald Richter <ri...@ecos.de>.
Hi!
>
>
> but there are still several references to HTML::Embperl in 2.0b6 and now I
> get some error messages like "Can't locate HTML/Embperl.pm in @INC..."
>
Where do you have references to HTML::Embperl? I don't find any...
Maybe the following is your problem: HTML::EmbperlObject was renamed to
Embperl::Object, but the old EmbperlObject.pm is still in the distribution
(I forgot to remove it) and it contains refeneces to HTML::Embperl, but it
won't work anyway anymore. So use Embperl::Object
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org