dykiel> However I still have the following leaks reported by Win32's
dykiel> debugging tools:

Yup, those are from the lhash table that the memory debugging routines
create.

dykiel> Detected memory leaks!
dykiel> Dumping objects ->

I would assume that this is a block of pointers to struct lhash_node
that has been expanded by expand() in lhash.c:
dykiel> {3409} normal block at 0x0090A8D0, 512 bytes long.
dykiel>  Data: <                > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

The following is the minimum block of pointers to struct
lhash_node_st, created by lh_new:
dykiel> {3447} normal block at 0x008C8758, 128 bytes long.
dykiel>  Data: <                > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

The following is a struct lhash_st, created by lh_new.  Apparently,
this one has been used well, it contains 65 node pointers:
dykiel> {2596} normal block at 0x008FC880, 96 bytes long.
dykiel>  Data: <    , @   @ A   > D0 A8 90 00 2C 9C 40 00 AF 9C 40 00 41 00 00 00

So's this.  This one isn't much used, it has only the initial 16 node
pointers: 
dykiel> {49} normal block at 0x008D1DA0, 96 bytes long.
dykiel>  Data: <X    L@  M@     > 58 87 8C 00 FC 4C 40 00 0B 4D 40 00 10 00 00 00

One of those lhashes is created in CRYPTO_dbg_malloc().  Another is
created by CRYPTO_push_info_, if you happen to call it somewhere.

Also, if you look at the first 4 bytes of each struct lhash above, you
find the address to the corresponding block of pointers to struct
lhash_node.  You're probably able to figure out the relationship on
your own :-).

Anyway, saying that OpenSSL doesn't leak *in debug mode* is not
entirely true.  The memory debugging code does create at least one
hash table and at most two, and it never free's them.  I've been
pondering adding a CRYPTO_mem_cleanup() or something like that, but
how often do you run debugging code in a production?  Would it really
be worth the while?  You tell me.

-- 
Richard Levitte   \ Spannvägen 38, II \ [EMAIL PROTECTED]
Chairman@Stacken   \ S-168 35  BROMMA  \ T: +46-8-26 52 47
Redakteur@Stacken   \      SWEDEN       \ or +46-708-26 53 44
Procurator Odiosus Ex Infernis             -- [EMAIL PROTECTED]
           Member of the OpenSSL development team

Unsolicited commercial email is subject to an archival fee of $400.
See <http://www.stacken.kth.se/~levitte/mail/> for more info.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to