ModPerl2 + Image::Magick
Hello everybody, I have some problems with Image::Magick and modperl 2. Apache 2 gives a segmentation fault if i preload Image::Magick in a preload.pl. Apache 2 continues working, but the httpdcore gets dumped. Apache 2 and Image::Magick are working fine after the apache core gets dumped. The following line occurs very often in the httpd log: Tue Nov 02 12:36:44 2004] [notice] seg fault or similar nasty error detected in the parent process Does anyone else knows about this problem and does somebody have a solution for it??? Thanks in advance. Greetings, Derck Floor E-WISE The Netherlands -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Apache::Cookie->new/bake broken - mod_perl 2
Dan Sully <[EMAIL PROTECTED]> writes: > I'm running into an interesting problem, using Apache::SessionManager. > > My first request to the webpage successfully generates a cookie, and I see it > in my browser's jar. The next response though, the Apache::Cookie->fetch() > gets a truncated cookie (md5 sum), and can't tie to the previous session and > creates a new one. Now, you may think this is a problem with fetching, > and not baking. > > But if I make Apache::SessionManager use CGI::Cookie for the baking, and > continue to use Apache::Cookie for the fetch, everything works fine. A > debug print ->as_string() of the Apache::Cookie->new/bake shows valid data. What is the length of the session cookie you're baking? Set-Cookie headers aren't supposed to exceed 4KB. If that's not the problem, do you notice any difference in the ->as_string() outputs for Apache::Cookie versus CGI::Cookie? -- Joe Schaefer -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Apache::Cookie
Arshavir Grigorian <[EMAIL PROTECTED]> writes: > # WORKS > my $cookie = $ticket->cookie()->as_string(); > $r->err_headers_out->add('Set-Cookie' => $cookie); > > # DOES NOT WORK$ticket->cookie()->bake(); > where $ticket->cookie() is an Apache::Cookie object. This is > the first thing in the response and is followed by: > $r->headers_out->set(Location => '/path/'); > return Apache::REDIRECT;. > > Beside the fact that libapreq2 is still in development, > is there a problem with how I am using the bake() method? Thanks in > advance. libapreq2 is currently using $r->headers_out instead of $r->err_headers_out, which is why you're not seeing the cookie on your redirect response. I think the consensus is that this is a bug in libapreq2-2.04, but I haven't seen any other apreq committers weigh in on the subject, so I'm not sure. -- Joe Schaefer -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Apache::Cookie->new/bake broken - mod_perl 2
* Joe Schaefer <[EMAIL PROTECTED]> shaped the electrons to say... My first request to the webpage successfully generates a cookie, and I see it in my browser's jar. The next response though, the Apache::Cookie->fetch() gets a truncated cookie (md5 sum), and can't tie to the previous session and creates a new one. Now, you may think this is a problem with fetching, and not baking. But if I make Apache::SessionManager use CGI::Cookie for the baking, and continue to use Apache::Cookie for the fetch, everything works fine. A debug print ->as_string() of the Apache::Cookie->new/bake shows valid data. What is the length of the session cookie you're baking? Set-Cookie headers aren't supposed to exceed 4KB. Quite under 4k - it's just a 32bit MD5 hash from Apache::Session::Generate::MD5 If that's not the problem, do you notice any difference in the ->as_string() outputs for Apache::Cookie versus CGI::Cookie? No. Which confuses me all the more. -D -- bacon happens. -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Apache::Cookie
> libapreq2 is currently using $r->headers_out instead > of $r->err_headers_out, which is why you're not seeing the > cookie on your redirect response. I think the consensus > is that this is a bug in libapreq2-2.04, but I haven't seen > any other apreq committers weigh in on the subject, so > I'm not sure. libapreq1 uses error_headers_out, so I think it's proper to follow that well established tradition, fwiw. --Geoff -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: ModPerl2 + Image::Magick
Derck Floor wrote: Hello everybody, I have some problems with Image::Magick and modperl 2. Apache 2 gives a segmentation fault if i preload Image::Magick in a preload.pl. Apache 2 continues working, but the httpdcore gets dumped. Apache 2 and Image::Magick are working fine after the apache core gets dumped. The following line occurs very often in the httpd log: Tue Nov 02 12:36:44 2004] [notice] seg fault or similar nasty error detected in the parent process 1) we need a proper report: http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems 2) We need to see the backtrace to tell: http://perl.apache.org/docs/2.0/devel/debug/c.html#Analyzing_Dumped_Core_Files -- __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Need some help hijacking the page output pipe
Title: Need some help hijacking the page output pipe I have a need to create my own suffix and hijack the output for page rendering code, and then re-output the page with my own OK. I have the O’Reilly book “Practical mod_perl” and there is a great example of this on page 114 in Chapter 4. However, the example is incomplete. The example suggests that we can intercept the request for a page, remove all the HTML tags, and re-output the page. This isn’t exactly what I want to do, but it will server as a great architecture for my needs. I’ve got my directive working perfectly in httpd.conf, but now I need some help intercepting the page request event, re-rendering the page, and then outputting it. I imagine this is like a three line explanation, but I can’t seem to find it anywhere. I imagine it something like this: PerlModule MyPlatform::Converter SetHandler perl-script PerlHandler MyPlatform::HTML2TextConverter MyPlatform:: HTMLContentGenerator I just don’t know how to grab the HTML page text once it gets to my module. STDIN doesn’t have it. So where is it? Suggestions? Thanks! Mark
Re: Need some help hijacking the page output pipe
Mark S Lowe wrote: I have a need to create my own suffix and hijack the output for page rendering code, and then re-output the page with my own OK. I have the O’Reilly book “Practical mod_perl” and there is a great example of this on page 114 in Chapter 4. However, the example is incomplete. The example suggests that we can intercept the request for a page, remove all the HTML tags, and re-output the page. This isn’t exactly what I want to do, but it will server as a great architecture for my needs. I’ve got my directive working perfectly in httpd.conf, but now I need some help intercepting the page request event, re-rendering the page, and then outputting it. I imagine this is like a three line explanation, but I can’t seem to find it anywhere. I imagine it something like this: PerlModule MyPlatform::Converter SetHandler perl-script PerlHandler MyPlatform::HTML2TextConverter MyPlatform:: HTMLContentGenerator I just don’t know how to grab the HTML page text once it gets to my module. STDIN doesn’t have it. So where is it? Suggestions? Thanks! Mark Well you have to read the file yourself: package MyPlatform::HTML2TextConverter MyPlatform:: HTMLContentGenerator; sub handler { # . my $content; local $/ = undef; open( READFILE, |$r->filename| ); $content = ; close( READFILE ); # ... } -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Apache::Cookie
Geoffrey Young wrote: libapreq2 is currently using $r->headers_out instead of $r->err_headers_out, which is why you're not seeing the cookie on your redirect response. I think the consensus is that this is a bug in libapreq2-2.04, but I haven't seen any other apreq committers weigh in on the subject, so I'm not sure. libapreq1 uses error_headers_out, so I think it's proper to follow that well established tradition, fwiw. --Geoff Thanks for the feedback. I guess I am wondering who I would need to talk to in order to get this fixed. Just to understand, why does it need to use the err_headers_out instead of headers_out? There does not seem to be any errors. Am I misinterpreting the function name or is it a misnomer? TIA. Arshavir -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Need some help hijacking the page output pipe
Title: Re: Need some help hijacking the page output pipe Thank you. This worked perfectly. I was also able to add test code from chapter 4 of Writing Apache Modules with Perl and C, and add file tests. I knew my first post to this mailing list had to be stupid. ;-) On 11/11/04 2:21 PM, "Tom Schindl" <[EMAIL PROTECTED]> wrote: Mark S Lowe wrote: > I have a need to create my own suffix and hijack the output for page > rendering code, and then re-output the page with my own OK. I have the > O’Reilly book “Practical mod_perl” and there is a great example of > this on page 114 in Chapter 4. However, the example is incomplete. The > example suggests that we can intercept the request for a page, remove > all the HTML tags, and re-output the page. This isn’t exactly what I > want to do, but it will server as a great architecture for my needs. > > I’ve got my directive working perfectly in httpd.conf, but now > I need some help intercepting the page request event, re-rendering the > page, and then outputting it. I imagine this is like a three line > explanation, but I can’t seem to find it anywhere. I imagine it > something like this: > > PerlModule MyPlatform::Converter > > SetHandler perl-script > PerlHandler MyPlatform::HTML2TextConverter MyPlatform:: > HTMLContentGenerator > > > I just don’t know how to grab the HTML page text once it gets to my > module. STDIN doesn’t have it. So where is it? > > Suggestions? > > Thanks! > > Mark Well you have to read the file yourself: package MyPlatform::HTML2TextConverter MyPlatform:: HTMLContentGenerator; sub handler { # . my $content; local $/ = undef; open( READFILE, |$r->filename| ); $content = ; close( READFILE ); # ... }
Re: Apache::Cookie
Arshavir Grigorian wrote: Geoffrey Young wrote: libapreq2 is currently using $r->headers_out instead of $r->err_headers_out, which is why you're not seeing the cookie on your redirect response. I think the consensus is that this is a bug in libapreq2-2.04, but I haven't seen any other apreq committers weigh in on the subject, so I'm not sure. libapreq1 uses error_headers_out, so I think it's proper to follow that well established tradition, fwiw. Thanks for the feedback. I guess I am wondering who I would need to talk to in order to get this fixed. Just to understand, why does it need to use the err_headers_out instead of headers_out? There does not seem to be any errors. Am I misinterpreting the function name or is it a misnomer? I have run into this in the past, and just rediscovered it again last week. A redirect response is either generally 301 or 302. Since it is not a 200 level response, this could be the reason. that error headers out needs to be set, instead of just the regular headers -- [EMAIL PROTECTED] -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Apache::Cookie
> Thanks for the feedback. I guess I am wondering who I would need to talk > to in order to get this fixed. Joe is the man :) > > Just to understand, why does it need to use the err_headers_out instead > of headers_out? There does not seem to be any errors. Am I > misinterpreting the function name or is it a misnomer? yes, it's something of a misnomer. over in Apache-land, returning anything other than OK, DECLINED, or DONE from a handler is considered an "error." and the err_headers_out table holds response (and entity :) headers that will be sent _even_ (not only) on errors. really, all three of the mod_perl books out there talk about this, so it is probably worth picking one of them up to read up on the API a bit. that is, if you're interested in this kind of thing. --Geoff -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html