On Wednesday, August 13, 2003, at 12:32 PM, David Wheeler wrote:

I'm attempting to isolate the problem now.

The code that's causing the hangup looks like this:


our $dbh;
sub _connect {
eval {
warn "$$: Checking for DB handle.\n";
unless ($dbh && $dbh->ping) {
warn "$$: No handle, connecting.\n";
$dbh = DBI->connect(join(':', 'DBI', DBD_TYPE, DSN_STRING),
DBI_USER, DBI_PASS, $ATTR);
}
};
die Bric::Util::Fault::Exception::DA->new(
{ msg => "Unable to connect to database", payload => $@ }) if $@;
print STDERR "\n";
}


END { _disconnect(); }

The _connect() function is called before every database action (query, begin, commit, rollback, etc.).

I make a request to the server, and here's what appears in the log. There are a couple of secondar requests in there, which is why there are so many requests when I try to view one Bricolage page in the browser. There are also two phases for each request, each using a transaction, PerlHandler and PerlCleanupHandler (which handles logging). This is what appears in the log (along with my comments on what's going on).

========================================================================

4166: Checking for DB handle. # Initial request query
4166: No handle, connecting.

4166: Checking for DB handle. # PerlCleanupHandler

4167: Checking for DB handle. # Secondary request query
4167: No handle, connecting.

4167: Checking for DB handle. # Query

4167: Checking for DB handle. # Query

4167: Checking for DB handle. # Query

4167: Checking for DB handle. # PerlCleanupHandler

4166: Checking for DB handle. # Secondary request query

========================================================================

At this point, everything hangs, stuck in $dbh->ping. You can see that this
child has been used before, so the database handle is of course initialized,
but it uses $dbh->ping to make sure it's still connected to the server.


After a couple of minutes of waiting, I hit the cancel button on my browser.
The log then gets the following (plus my comments):


========================================================================

4166: No handle, connecting. # This shouldn't happen!

4166: Checking for DB handle.
4166: No handle, connecting. # PerlCleanupHandler -- Handle corrupted?
Issuing rollback() for database handle being DESTROY'd without explicit disconnect() at /usr/local/bricolage/lib/Bric/Util/DBI.pm line 1663.


commit ineffective with AutoCommit enabled at /usr/local/bricolage/lib/Bric/Util/DBI.pm line 571.
4166: Checking for DB handle.
4166: No handle, connecting.


4166: Checking for DB handle.
4166: No handle, connecting.
Issuing rollback() for database handle being DESTROY'd without explicit disconnect() at /usr/local/bricolage/lib/Bric/Util/DBI.pm line 1663.
message type 0x49 arrived from server while idle # Now it gets ugly!
Attempt to free unreferenced scalar at /usr/local/bricolage/lib/Bric/Util/DBI.pm line 1663.
*** malloc[4166]: Deallocation of a pointer not malloced: 0x1d60af0; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug


rollback ineffective with AutoCommit enabled at /usr/local/bricolage/lib/Bric/Util/DBI.pm line 960.
[Wed Aug 13 19:51:11 2003] [error] [client 127.0.0.1] Unable to turn AutoCommit off: DBD driver has not implemented the AutoCommit attribute at /usr/local/bricolage/lib/Bric/Util/DBI.pm line 528.


[/usr/local/bricolage/lib/Bric/Util/DBI.pm:529]
[/usr/local/bricolage/lib/Bric/App/CleanupHandler.pm:125]

========================================================================

You can see that this gets really ugly. Anyone seen anything like this, or have any idea what could be causing these problems? Again, this happens only on Apache 1.3.28.

Many TIA,

David

--
David Wheeler                                     AIM: dwTheory
[EMAIL PROTECTED]                              ICQ: 15726394
http://www.kineticode.com/                     Yahoo!: dew7e
                                               Jabber: [EMAIL PROTECTED]
Kineticode. Setting knowledge in motion.[sm]



Reply via email to