You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Paul Querna <ch...@cyan.com> on 2003/02/13 06:55:29 UTC

problems using apr_reslist

To Start off, I just started playing with APR this week, so this might be a
very simple, and stupid mistake, So please forgive me if it is :-)

I am working on mod_authn_mysql, using the new Auth*Providers in
Apache2.1-dev.(Apache2.1 & APR copied from CVS on monday/tuesday)

I had it basicly working without any persistant or pooling of connections. (on
new Auth request, open up a new MySQL Connection, run the queries, and then
close everything up).  That is not a Good Thing(tm) in the long run.

I have been trying to use apr_reslist as a medium to provide both persistance,
and pooling of the database connections.

I have put a copy of it onto here: 
http://open.cyanworlds.com/~chip/temp/mod_authn_mysql.c

Assuming that I am using apr_reslist correctly, it seems like the MySQL
objects when created are fine, but when i try to get one back out, somthing
about them is messed up.

Running Apache from within gdb shows this:

Starting program: /home/chip/apache2_unstable/bin/httpd -X -k start
[New Thread 1024 (LWP 10878)]
(new_server)MySQL Object is at: 0xBFFFF510
MySQL DB Info... : Uptime: 121110  Threads: 23  Questions: 299435  Slow
queries: 0  Opens: 26  Flush tables: 1  Open tables: 20 Queries per second
avg: 2.472
(get_server)MySQL Object is at: 0xBFFFF5A0
MySQL DB Info... : Commands out of sync;  You can't run this command now

(mysql_query)MySQL Object: 0xBFFFF590

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 10878)]
0x403135a7 in vio_is_blocking () from /usr/lib/mysql/libmysqlclient.so.10
(gdb) bt
#0  0x403135a7 in vio_is_blocking () from /usr/lib/mysql/libmysqlclient.so.10
#1  0x4030f3e3 in simple_command () from /usr/lib/mysql/libmysqlclient.so.10
#2  0x40312144 in mysql_stat () from /usr/lib/mysql/libmysqlclient.so.10
#3  0x4002d495 in safe_mysql_query (mysql_auth=0x814f768, res=0x0, r=0x8149278,
    query=0x814d288 "select Password from TheAccounts where MyName='blahblah'
and IsActive!=0", sec=0x8101500) at mod_authn_mysql.c:350
#4  0x4002d885 in get_mysql_realm_hash (r=0x8149278, user=0x6d6d6f43 <Address
0x6d6d6f43 out of bounds>,
    realm=0x73646e61 <Address 0x73646e61 out of bounds>, rethash=0x74756f20)
at mod_authn_mysql.c:483
#5  0x0806744b in get_hash (r=0x6e616d6d, user=0x6f6e2064 <Address 0x6f6e2064
out of bounds>, conf=0x8100077) at mod_auth_digest.c:1500
#6  0x6f632073 in ?? ()
Cannot access memory at address 0x69687420

any help or pointers would be great.

thanks,

-chip

Re: problems using apr_reslist

Posted by Paul Querna <ch...@cyan.com>.
found my problem.

mysql object was going out of scope. oops.