Archive for March, 2004

[SANITY CHECK] Apache 2 hangs with lots of STDERR output from CGI

Tuesday, March 30th, 2004

You are not crazy. It is not an infinite recursion in your logic. Your code doesn’t take that long to execute.

If
you output to STDERR (in Perl, this means Carp or warn or the venerable
print STDERR among others) from a CGI script under Apache 2.0, and you
end up dumping more than approximately 4k (note that if you are using
“warn” or “Carp” you may have extra stuff on there so that you only
output 3k or so but the extras bring it up to 4k), Apache 2 will hang
forever (as of today, 30 March 2004).

See this bug report: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22030

There are some patches proposed in the link above on the Apache project bugzilla, but they are not production releases.

In
case you were wondering,
http://blogs.law.harvard.edu/rlucas/2003/08/26#a13 shows some helpful
hints on how you can back down to version 1.3.

Question to all:
what are folks’ recommendations for an Apache 1.3 packaged install? I
would tend to prefer statically linked with SSL and mod_perl, but the
only one I’ve seen folks using is from n0i.net which isn’t entirely
satisfying because I don’t speak Romanian.

Update: Using Apachetoolbox
(see Google), you can fairly simply compile apache 1.3 + mod_ssl + mod_perl
+ php and whatever 3rd party modules you like.  This makes for a fine alternative to RPM
versioning hell, or even to traipsing around your src tree typing make.  Be sure that if you do this, you specify
mod_perl 1.29 rather than 1.99, if you compile mod_perl in.

[SANITY CHECK] Apache 2 hangs with lots of STDERR output from CGI …

[FIX] XFree86 stuck at 640 x 480 under Linux with Dell Dimension or Optiplex

Monday, March 22nd, 2004

With a fresh install of Red Hat 9 on a Dell Dimension 4600, the only video mode that would work with XFree86 was 640 x 480, which is ludicrously big on a decent-sized monitor.  Changing the config didn’t do anything, even though the config was well within my monitor’s limits.


The solution was to go into the BIOS setup and change the Integrated Devices (LegacySelect Options) / Onboard Video Buffer setting from 1 MB to 8 MB.  I’m not sure what the tradeoff with other aspects of the system is, but X nicely starts up at 1280 x 1024.  Apparently, this is the solution for other Dell models as well, including the Optiplex GX260; mine had Dell BIOS Revision A08.  Also, it seems to be the case that the problem is general to XFree86, although it manifested for me under Red Hat 9.


Thanks to Erick Tonnel at Dell, who kindly provided the solution here:


http://lists.ze-linux.org/2004-02/msg00154.html


 

FIX: Can’t locate object method “select_val” via package “DBI::st” under Class::DBI 0.95

Monday, March 1st, 2004

[warning: see updates below]


Between Class::DBI 0.94 and 0.95, something changed causing my classes that override db_Main() to set the db connection (instead of, e.g. using set_db) to stop working.  Specifically, when their sequence functions were invoked, I got an error of:


 


Can’t locate object method “select_val” via package “DBI::st” (perhaps you forgot to load “DBI::st”?) at /usr/lib/perl5/site_perl/5.6.1/Class/DBI.pm line …


 


I was able to replicate this on Mac OS X 10.2 with Perl 5.6.0 and Red Hat 9 with 5.6.1 (don’t ask about the latter version magic…).


 


If you get select_val errors with Class::DBI 0.95, here are two workarounds:


 



 


I am not sure why this is (comments are welcome) and have submitted a bug to the developers as CPAN #5522.


Update: Thanks to Tony Bowden, maintainer of Class::DBI, for his reply:


 



Full context and any attached attachments can be found at:
http://rt.cpan.org/NoAuth/Bug.html?id=5522 >


On Mon, Mar 01, 2004 at 06:42:38PM -0500, Guest via RT wrote:
> In Class::DBI 0.95, setting up the DB connection by overriding db_Main
> breaks Ima::DBI->select_val and the methods that rely on it (like sequence
> and count_all)


You need to call Ima::DBI->connect rather than DBI->connect in your
overriden db_Main.


Tony


 


Still not certain, though, why it is that it breaks in 0.95 and not 0.94.


Update: Thanks again to Tony, who writes:



The reason this broke in going from 0.94 to 0.95, btw, is that the
select_val stuff was only added to Ima::DBI recently, so Class::DBI .94
didn’t use these, but instead rolled its own long winded versions.


0.95 uses the new methods in Ima::DBI and is a lot better off for it! 🙂


Tony


Update 23 April 2004: Things are all wacky now.  You should be careful and should probably NOT do any of the above.  See the 06 April 2004 exchanges on the CDBI mailing list.  If you do what is described above you stand to get reconnections that will mess up things like auto_increments in MySQL.  At present the issue of how to deal with db_Main() seems unresolved.