Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0007793 [Squeak] VM minor always 10-19-13 21:36 04-22-15 21:40
Reporter lewis View Status public  
Assigned To lewis
Priority normal Resolution fixed Platform
Status resolved   OS
Projection none   OS Version
ETA none Fixed in Version Product Version
  Product Build
Summary 0007793: Memory leak in the SqueakSSL plugin on unix
Description Reported by Levente Uzonyi on squeak-dev:

We've been experiencing memory leakage in long running Squeak images using
SqueakSSL. After a bit of monitoring I found that 132 bytes get leaked
for each https request done from the image. After a bit of code review,
I've probably found the culprit, and another potential source of memory
leak. For the reference, the source file this mail is about is
http://squeakvm.org/cgi-bin/viewvc.cgi/squeak/branches/Cog/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c?revision=2713&view=markup [^]
 
The main memory leak is in sqDestroySSL function (starting on line 117),
which doesn't free the bioRead and bioWrite variables (allocated by
sqCreateSSL on line 98-99) of the ssl object. My suggested solution is to
insert the following two lines before line 132:
 
        BIO_free_all(ssl->bioRead);
        BIO_free_all(ssl->bioWrite);
 
The other potential source of memory leak is sqSetStringPropertySSL
(starting on line 381). It allocates a chunk of memory on line 389, but
doesn't use nor free it, if the propID argument is not
SQSSL_PROP_CERTNAME. My suggested solution is to insert the following line
after line 396:

        if(property) free(property);

Note that I haven't tested any of these, but I hope someone who is more
into VM building right now will try them.
Steps To Reproduce
Additional Information
Attached Files  sqUnixOpenSSL.c.gz [^] (3,133 bytes) 10-20-13 03:44

- Relationships

SYSTEM WARNING: Creating default object from empty value

related to 0007751testing lewis Add SSL plugin 
related to 0007824assigned lewis Add TLS SNI Server Name Indication support to SqueakSSL plugin 

- Notes
(0014468 - 107 - 107 - 107 - 107 - 107 - 107)
lewis
10-20-13 17:00

The fix has been applied to trunk (interpreter), and the identical update should be added in Cog and Pharo.
 
(0014529 - 33 - 33 - 33 - 33 - 33 - 33)
lewis
01-30-15 01:31

Fix has been applied to SVN trunk
 
(0014533 - 90 - 90 - 256 - 256 - 256 - 256)
krono
04-22-15 21:40

This is also fixed in binary at https://github.com/itsmeront/squeakssl/releases/tag/v0.2.0 [^]
 

- Issue History
Date Modified Username Field Change
10-19-13 21:36 lewis New Issue
10-19-13 21:36 lewis Status new => assigned
10-19-13 21:36 lewis Assigned To  => lewis
10-20-13 03:44 leves File Added: sqUnixOpenSSL.c.gz
10-20-13 17:00 lewis Note Added: 0014468
10-20-13 17:01 lewis Status assigned => pending
10-23-13 12:26 lewis Relationship added related to 0007751
10-17-14 00:45 lewis Relationship added related to 0007824
01-30-15 01:31 lewis Status pending => resolved
01-30-15 01:31 lewis Resolution open => fixed
01-30-15 01:31 lewis Note Added: 0014529
04-22-15 21:40 krono Note Added: 0014533


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
57 total queries executed.
39 unique queries executed.
Powered by Mantis Bugtracker