Hello Nick,

I did some tests again with mod_dbd, but now against trunk versions of
httpd, apr, apr-utils. And it seems to me, that the problem persists.
It crashes with the same symptoms as I posted last week.
Function ap_dbd_prepare called with corrupted arguments (s=0x80e6ed0, 
query=0xffffffff,
label=0xffffffff), which led to crash in apr_hashfunc_default
(char_key=0x0, klen=0xbfbfe2c0).

My previous post about "soft" prepare problem looks to be irrelevant.
"Internal error: DBD: failed to initialise prepared SQL statements"
seems to be a back-side of corrupted but not crashed query handler.

I included httpd.conf, gdb output and my compilation options.

I would be glad to hear, that something is wrong with my environment
(e.g. compilation, configuration etc), but I couldn't find anything I
can fix.

Anton Golubev
ENGECON
St. Petersburg

P.S. Regarding autoconf for APR-Utils. Mysql detection has been fixed
by Bojan a month ago in trunk version. So my patches are a bit outdated.
Bojan also uses mysql-config to determine path to the libraries.
The current status: it's broken in 1.2.7, but fixed in not yet
released 1.3.0.
(gdb) file ./httpd
Reading symbols from ./httpd...done.
(gdb) run
Starting program: /usr/home/anton/work/apache22/bin/httpd

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 100698)]
apr_hashfunc_default (char_key=0x0, klen=0xbfbfe2c0) at tables/apr_hash.c:228
228             for (p = key; *p; p++) {
(gdb) bt
#0  apr_hashfunc_default (char_key=0x0, klen=0xbfbfe2c0) at 
tables/apr_hash.c:228
#1  0x88262bbe in find_entry (ht=0x812e018, key=0x0, klen=-1, val=0x0) at 
tables/apr_hash.c:260
#2  0x88262d92 in apr_hash_get (ht=0xffffffff, key=0xbfbfe2c0, klen=-1) at 
tables/apr_hash.c:330
#3  0x0807cde3 in ap_dbd_prepare (s=0x80e6ed0, query=0xffffffff <Error reading 
address 0xffffffff: Bad address>,
    label=0xffffffff <Error reading address 0xffffffff: Bad address>) at 
mod_dbd.c:152
#4  0x0807a5a5 in authn_dbd_prepare (cmd=0xbfbfe6a0, cfg=0x8128d60, 
query=0x8128d68 "select PASS from Users where LOGIN=%s") at mod_authn_dbd.c:70
#5  0x08072827 in invoke_cmd (cmd=0x80a79a0, parms=0xbfbfe6a0, 
mconfig=0x8128d60, args=0x81283bf "") at config.c:788
#6  0x080730ac in ap_walk_config (current=0x8128378, parms=0xbfbfe6a0, 
section_vector=0x8128960) at config.c:1141
#7  0x0806aff4 in dirsection (cmd=0xbfbfe6a0, mconfig=0x8123648, arg=0x8128beb 
"") at core.c:1784
#8  0x08072827 in invoke_cmd (cmd=0x80a5440, parms=0xbfbfe6a0, 
mconfig=0x8123648, args=0x8128298 "/home/anton>") at config.c:788
#9  0x080730ac in ap_walk_config (current=0x8128278, parms=0xbfbfe6a0, 
section_vector=0x81225a8) at config.c:1141
#10 0x08073b92 in ap_process_config_tree (s=0xbfbfe2c0, conftree=0x8128078, 
p=0x80dc018, ptemp=0xffffffff) at config.c:1743
#11 0x08061fcb in main (argc=1, argv=0xbfbfe7c8) at main.c:641


(gdb) up
#1  0x88262bbe in find_entry (ht=0x812e018, key=0x0, klen=-1, val=0x0) at 
tables/apr_hash.c:260
260         hash = ht->hash_func(key, &klen);
(gdb) up
#2  0x88262d92 in apr_hash_get (ht=0xffffffff, key=0xbfbfe2c0, klen=-1) at 
tables/apr_hash.c:330
330         he = *find_entry(ht, key, klen, NULL);
(gdb) up
#3  0x0807cde3 in ap_dbd_prepare (s=0x80e6ed0, query=0xffffffff <Error reading 
address 0xffffffff: Bad address>,
    label=0xffffffff <Error reading address 0xffffffff: Bad address>) at 
mod_dbd.c:152
152         prepared->next = apr_hash_get(dbd_prepared_defns, 
s->server_hostname,
(gdb) l
147                                             const char *label)
148     {
149         dbd_prepared *prepared = apr_pcalloc(s->process->pool, 
sizeof(dbd_prepared));
150         prepared->label = label;
151         prepared->query = query;
152         prepared->next = apr_hash_get(dbd_prepared_defns, 
s->server_hostname,
153                                       APR_HASH_KEY_STRING);
154         apr_hash_set(dbd_prepared_defns, s->server_hostname, 
APR_HASH_KEY_STRING,
155                      prepared);
156     }


(gdb) up
#3  0x0807cde3 in ap_dbd_prepare (s=0x80e6ed0, query=0xffffffff <Error reading 
address 0xffffffff: Bad address>,
    label=0xffffffff <Error reading address 0xffffffff: Bad address>) at 
mod_dbd.c:152
152         prepared->next = apr_hash_get(dbd_prepared_defns, 
s->server_hostname,

[EMAIL PROTECTED] uname -a
FreeBSD bill.engec.ru 5.4-STABLE FreeBSD 5.4 #1: Tue Aug 23 23:38:37 MSD 2005   
  [EMAIL PROTECTED]:/usr/obj/usr/src/sys/BILL-SMP  i386



#! /bin/sh
#
# Created by configure

"./configure" \
"--prefix=/home/anton/work/apache22" \
"--enable-so" \
"--enable-dbd" \
"--enable-authn-dbd" \
"$@"


[EMAIL PROTECTED] svn info ./mod_dbd.c
Path: mod_dbd.c
Name: mod_dbd.c
URL: 
http://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/database/mod_dbd.c
Repository Root: http://svn.apache.org/repos/asf
Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
Revision: 426127
Node Kind: file
Schedule: normal
Last Changed Author: niq
Last Changed Rev: 424798
Last Changed Date: 2006-07-24 00:22:57 +0400 (Mon, 24 Jul 2006)
Text Last Updated: 2006-07-27 16:52:43 +0400 (Thu, 27 Jul 2006)
Properties Last Updated: 2006-07-27 16:52:43 +0400 (Thu, 27 Jul 2006)
Checksum: 26ee85b299bc92e3b6c8db650bebc8c6




# ldd ./httpd
./httpd:
        libaprutil-1.so.2 => /usr/local/lib/libaprutil-1.so.2 (0x880e0000)
        libdb-4.2.so.2 => /usr/local/lib/libdb-4.2.so.2 (0x880f8000)
        libmysqlclient_r.so.14 => /usr/local/lib/mysql/libmysqlclient_r.so.14 
(0x881b6000)
        libz.so.2 => /lib/libz.so.2 (0x88209000)
        libm.so.3 => /lib/libm.so.3 (0x88219000)
        libexpat.so.6 => /usr/local/lib/libexpat.so.6 (0x88234000)
        libapr-1.so.2 => /usr/local/lib/libapr-1.so.2 (0x88255000)
        libcrypt.so.2 => /lib/libcrypt.so.2 (0x88276000)
        libpthread.so.1 => /usr/lib/libpthread.so.1 (0x8828e000)
        libc.so.5 => /lib/libc.so.5 (0x882b2000)



[EMAIL PROTECTED] svn info apr
Path: apr
URL: http://svn.apache.org/repos/asf/apr/apr/trunk
Repository Root: http://svn.apache.org/repos/asf
Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
Revision: 426103
Node Kind: directory
Schedule: normal
Last Changed Author: wrowe
Last Changed Rev: 425620
Last Changed Date: 2006-07-26 08:56:35 +0400 (Wed, 26 Jul 2006)
Properties Last Updated: 2006-07-27 19:35:23 +0400 (Thu, 27 Jul 2006)

[EMAIL PROTECTED] svn info apr-util
Path: apr-util
URL: http://svn.apache.org/repos/asf/apr/apr-util/trunk
Repository Root: http://svn.apache.org/repos/asf
Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
Revision: 426103
Node Kind: directory
Schedule: normal
Last Changed Author: bojan
Last Changed Rev: 425215
Last Changed Date: 2006-07-25 02:56:46 +0400 (Tue, 25 Jul 2006)
Properties Last Updated: 2006-07-27 19:34:46 +0400 (Thu, 27 Jul 2006)

Listen 8822

User nobody
Group nobody

ServerAdmin [EMAIL PROTECTED]

AcceptFilter http none
AcceptFilter https none

DBDriver mysql
DBDParams "host=localhost dbname=test user=test pass=test"

<Directory /home/anton>

    AuthType Basic
    AuthName 'ADMIN ZONE'
    AuthBasicProvider dbd
    AuthDBDUserPWQuery "select PASS from Users where LOGIN=%s"
    require user anton


</Directory>

Reply via email to