[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#434562: apache2.2-common: Segfaulting when using mod_authn_dbd with DBDriver pgsql



On 200707281645, Stefan Fritsch wrote:
> On Wednesday 25 July 2007, Anders Breindahl wrote:
> > `gdb /usr/sbin/apache2 core` gives:
> > This GDB was configured as "x86_64-linux-gnu"...BFD:
> > /usr/sbin/apache2: don't know how to handle OS specific section
> > `.gnu.hash' [0x6ffffff6] "/usr/sbin/apache2": not in executable
> > format: File format not recognized
> 
> This is a bug in gdb on amd64 and is fixed in unstable.
> You could try the version from unstable.
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=425838
> 
> Apart from that, I didn't have time so far too look into your issue.

No matter. I, for once, am in no rush. And the legacy way
(mod_auth_pgqsl) still should exist.

I did the backtrace:

(gdb) bt
#0  apr_hashfunc_default (char_key=0x0, klen=0x7ffff2a2e5c8) at ../tables/apr_hash.c:228
#1  0x00002ad8b915f787 in find_entry (ht=0x7fe098, key=0x0, klen=-1, val=0xffffffffffffffff) at ../tables/apr_hash.c:260
#2  0x00002ad8b915f85b in apr_hash_get (ht=0x0, key=0x7ffff2a2e5c8, klen=-1) at ../tables/apr_hash.c:330
#3  0x00002ad8bdc0ad2b in ap_dbd_prepare () from /usr/lib/apache2/modules/mod_dbd.so
#4  0x00002ad8bbef7b1f in ?? () from /usr/lib/apache2/modules/mod_authn_dbd.so
#5  0x0000000000438e22 in ?? ()
#6  0x0000000000438ef0 in ap_walk_config ()
#7  0x0000000000431e2d in ap_limit_section ()
#8  0x00000000004387cb in ?? ()
#9  0x0000000000438ef0 in ap_walk_config ()
#10 0x000000000042ffeb in ?? ()
#11 0x00000000004387cb in ?? ()
#12 0x0000000000438ef0 in ap_walk_config ()
#13 0x0000000000439052 in ap_process_config_tree ()
#14 0x000000000042572f in main ()

A little bit of sniffing around suggests that mod_dbd' ap_dbd_prepare()
calls apr_hash_get with a null pointer for the ``ht''-argument. (line #2
above, and mod_dbd.c:152).

That ``ht'' argument is this (file-global):

   static apr_hash_t *dbd_prepared_defns; // mod_dbd.c:70

pointer which seemingly is left in its initialized status as a null
pointer. The only candidate for setting that pointer is the assignment

   dbd_prepared_defns = apr_hash_make(ptemp); // mod_dbd.c:612

It should not be possible to get through apr_hash_make (apr_hash.c:95)
without segfaulting (apr_palloc is called, and the pointer that it
returns is used without checking for NULLness) and still returning NULL.
Therefore, the above assignment can't be have been executed, and
therefore, dbd_pre_config() can't have been called.

While at this setting, the debugging was getting long-haired. And I'm
out of coffee. But perhaps my efforts can serve as a starting point.

I however formulated some thoughts while debugging:

- I think the problem arises around authn_dbd's tries to do its SQL
  statement preparation. (By the way, this is supported by the fact that
  apache2 starts up nicely when the AuthDBDUser{Realm,PW}Query
  directives are commented out of the configuration. It probably can't
  do dbd authentication without those, though.)
- A segfault is never nice. Something should be done -- once the error
  is spotted -- to give more informative output in case this is a
  configuration problem.

Regards, skrewz.

Attachment: signature.asc
Description: Digital signature


Reply to: