Hi Aarno,

> I try to implement https to PPG. It seems to work, except that boxes
> (all of
> them) segfault when shutting down. Trace statements tell that this
> happens in
> 
> http_shutdown,
> server_shutdown_ssl,
> SSL_CTX_free
> 
> After that gdb dumps following stack:
> 
> #3 CRYPTO_lock
> #2 openssl_locking_function(mode=9, n=12, file="ssl_lib.c", line=1218)
> #1 mutex_lock (mutex=0xdeadbeef)
> #0 pthread_mutex_lock
> 
> 0xdeadbeef is quite telling. Someone tries to use already freed mutex. I
> start
> to investigate, but I would like to get opinions from people more
> familiar with
> SSL code (Stipe ?) - I may miss something quite evident.

thanks for the analysis, it did help a lot!

IMO, the problems arises when the global_server_ssl_context is freed
in gwlib/conn.c:1106 because it has _not_ been previously created in
gwlib/conn.c:435.

Within Connection *conn_wrap_fd(int fd, int ssl) we only create the
context if the connection is considered to be an ssl-enabled
connection. Hence if HAVE_LIBSSL is true, but the connection is not
ssl-enabled then while calling http_shutdown->server_shutdown_ssl the
context is tried to be freed up -> kabang :)

Stipe

[EMAIL PROTECTED]
-------------------------------------------------------------------
Wapme Systems AG

M�nsterstr. 248
40470 D�sseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are

Reply via email to