You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Niklas Edmundsson <ni...@acc.umu.se> on 2016/10/08 19:28:51 UTC

Segfault in ssl_scache_init on reload

Hi all.

httpd 2.4.23, built from httpd-2.4.23.tar.bz2 and 
httpd-2.4.23-deps.tar.bz2 on Ubuntu 14.04.5 LTS (trusty).

While fiddling with enabling https on ftp.acc.umu.se I stumbled on the 
following coredump when reloading the server with -k graceful after 
renewing/updating the certificate. Has anyone seen anything like it 
before? I'm at a loss figuring out which end I should start prodding 
to make sense of this...

frame 0 of the coredump seems to be garbage, and I can't find any 
obvious NULL pointer or similar in frame 1...

-------------------------------------8<------------------------------
(gdb) bt full
#0  0x0000000000000000 in ?? ()
No symbol table info available.
#1  0x00007fad4616c3a4 in ssl_scache_init (s=s@entry=0x10d12a0,
     p=p@entry=0x109b138) at ssl_scache.c:61
         mc = 0x10bfc98
         rv = <optimized out>
         hints = {avg_id_len = 20, avg_obj_size = 1500, expiry_interval = 300}
#2  0x00007fad4615dc4e in ssl_init_Module (p=0x109b138, plog=<optimized out>,
     ptemp=0x10cc458, base_server=0x10d12a0) at ssl_engine_init.c:287
         mc = <optimized out>
         sc = 0x10e8e58
         s = 0x0
         rv = <optimized out>
         pphrases = <optimized out>
#3  0x000000000044ca89 in ap_run_post_config (pconf=0x109b138, plog=0x10c8358,
     ptemp=0x10cc458, s=0x10d12a0) at config.c:103
         pHook = 0x117dc08
         n = 7
         rv = 1178082720
#4  0x000000000042b610 in main (argc=22, argv=0x7ffc686b6878) at main.c:771
         c = 84 'T'
         showcompile = 0
         showdirectives = 0
         confname = 0x7ffc686b7f73 "/var/conf/apache2/httpd.conf"
         def_server_root = 0x4682a5 "/lap/apache/2.4.23"
         temp_error_log = <optimized out>
         error = <optimized out>
         process = 0x1099218
         pconf = 0x109b138
         plog = 0x10c8358
         ptemp = 0x10cc458
         pcommands = 0x10bd248
         opt = 0x10bd338
         rv = <optimized out>
         mod = 0x689938 <ap_prelinked_modules+24>
         opt_arg = 0x0
         signal_server = <optimized out>
         rc = <optimized out>
(gdb) frame 1
#1  0x00007fad4616c3a4 in ssl_scache_init (s=s@entry=0x10d12a0,
     p=p@entry=0x109b138) at ssl_scache.c:61
61              rv = mc->stapling_cache->init(mc->stapling_cache_context,
(gdb) l
56              memset(&hints, 0, sizeof hints);
57              hints.avg_obj_size = 1500;
58              hints.avg_id_len = 20;
59              hints.expiry_interval = 300;
60
61              rv = mc->stapling_cache->init(mc->stapling_cache_context,
62                                           "mod_ssl-stapling", &hints, s, p);
63              if (rv) {
64                  ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(01872)
65                               "Could not initialize stapling cache. Exiting.");
-------------------------------------8<------------------------------


/Nikke
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Niklas Edmundsson, Admin @ {acc,hpc2n}.umu.se      |     nikke@acc.umu.se
---------------------------------------------------------------------------
  FUBB -- Fouled Up Beyond Belief
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Re: Segfault in ssl_scache_init on reload

Posted by Niklas Edmundsson <ni...@acc.umu.se>.
On Sun, 9 Oct 2016, Ruediger Pluem wrote:

>
>
> On 10/08/2016 09:28 PM, Niklas Edmundsson wrote:
>>
>> Hi all.
>>
>> httpd 2.4.23, built from httpd-2.4.23.tar.bz2 and httpd-2.4.23-deps.tar.bz2 on Ubuntu 14.04.5 LTS (trusty).
>>
>> While fiddling with enabling https on ftp.acc.umu.se I stumbled on the following coredump when reloading the server with
>> -k graceful after renewing/updating the certificate. Has anyone seen anything like it before? I'm at a loss figuring out
>> which end I should start prodding to make sense of this...
>>
>> frame 0 of the coredump seems to be garbage, and I can't find any obvious NULL pointer or similar in frame 1...

<snip>

> What are the values of
>
> mc->stapling_cache
> mc->stapling_cache->init

(gdb) p mc->stapling_cache->init
$2 = (apr_status_t (*)(ap_socache_instance_t *, const char *,
     const struct ap_socache_hints *, server_rec *, apr_pool_t *)) 0x0

Gaah. I was obviously too tired when I looked into this :/

Anyhow, I think I know what lead to this as well.

- I was testing the https httpd.conf file by copying it to an offlined
   frontend machine.
- Between me copying it there and cert-update/reload happening it got
   overwritten by the maintenance task syncing the configs of all
   frontends to our default config.
- As our old default config only loaded mod_ssl.so, and NOT
   mod_socache_shmcb.so, it makes sense to find a NULL pointer there.

So, the config was definitely broken on reload. Would have been nice 
if it had barfed in a more polite way than segfault though ;-)


/Nikke
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Niklas Edmundsson, Admin @ {acc,hpc2n}.umu.se      |     nikke@acc.umu.se
---------------------------------------------------------------------------
  "My pride has had terrible consequences for the galaxy." - Obi-Wan
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Re: Segfault in ssl_scache_init on reload

Posted by Ruediger Pluem <rp...@apache.org>.

On 10/08/2016 09:28 PM, Niklas Edmundsson wrote:
> 
> Hi all.
> 
> httpd 2.4.23, built from httpd-2.4.23.tar.bz2 and httpd-2.4.23-deps.tar.bz2 on Ubuntu 14.04.5 LTS (trusty).
> 
> While fiddling with enabling https on ftp.acc.umu.se I stumbled on the following coredump when reloading the server with
> -k graceful after renewing/updating the certificate. Has anyone seen anything like it before? I'm at a loss figuring out
> which end I should start prodding to make sense of this...
> 
> frame 0 of the coredump seems to be garbage, and I can't find any obvious NULL pointer or similar in frame 1...
> 
> -------------------------------------8<------------------------------
> (gdb) bt full
> #0  0x0000000000000000 in ?? ()
> No symbol table info available.
> #1  0x00007fad4616c3a4 in ssl_scache_init (s=s@entry=0x10d12a0,
>     p=p@entry=0x109b138) at ssl_scache.c:61
>         mc = 0x10bfc98
>         rv = <optimized out>
>         hints = {avg_id_len = 20, avg_obj_size = 1500, expiry_interval = 300}
> #2  0x00007fad4615dc4e in ssl_init_Module (p=0x109b138, plog=<optimized out>,
>     ptemp=0x10cc458, base_server=0x10d12a0) at ssl_engine_init.c:287
>         mc = <optimized out>
>         sc = 0x10e8e58
>         s = 0x0
>         rv = <optimized out>
>         pphrases = <optimized out>
> #3  0x000000000044ca89 in ap_run_post_config (pconf=0x109b138, plog=0x10c8358,
>     ptemp=0x10cc458, s=0x10d12a0) at config.c:103
>         pHook = 0x117dc08
>         n = 7
>         rv = 1178082720
> #4  0x000000000042b610 in main (argc=22, argv=0x7ffc686b6878) at main.c:771
>         c = 84 'T'
>         showcompile = 0
>         showdirectives = 0
>         confname = 0x7ffc686b7f73 "/var/conf/apache2/httpd.conf"
>         def_server_root = 0x4682a5 "/lap/apache/2.4.23"
>         temp_error_log = <optimized out>
>         error = <optimized out>
>         process = 0x1099218
>         pconf = 0x109b138
>         plog = 0x10c8358
>         ptemp = 0x10cc458
>         pcommands = 0x10bd248
>         opt = 0x10bd338
>         rv = <optimized out>
>         mod = 0x689938 <ap_prelinked_modules+24>
>         opt_arg = 0x0
>         signal_server = <optimized out>
>         rc = <optimized out>
> (gdb) frame 1
> #1  0x00007fad4616c3a4 in ssl_scache_init (s=s@entry=0x10d12a0,
>     p=p@entry=0x109b138) at ssl_scache.c:61
> 61              rv = mc->stapling_cache->init(mc->stapling_cache_context,
> (gdb) l
> 56              memset(&hints, 0, sizeof hints);
> 57              hints.avg_obj_size = 1500;
> 58              hints.avg_id_len = 20;
> 59              hints.expiry_interval = 300;
> 60
> 61              rv = mc->stapling_cache->init(mc->stapling_cache_context,
> 62                                           "mod_ssl-stapling", &hints, s, p);
> 63              if (rv) {
> 64                  ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(01872)
> 65                               "Could not initialize stapling cache. Exiting.");
> -------------------------------------8<------------------------------

What are the values of

mc->stapling_cache
mc->stapling_cache->init

Regards

Rdiger