Martin Willi
1e54e40f5d
leak-detective: remove hdr entry when reallocating zero bytes
2013-07-12 20:00:16 +02:00
Martin Willi
c93cf85356
leak-detective: print total of allocated/leaked bytes in usage/report
2013-07-12 20:00:14 +02:00
Martin Willi
81959e6406
leak-detective: add a usage threshold option based on the number of allocations
2013-07-10 17:28:45 +02:00
Martin Willi
82d0317be6
leak-detective: set_state() only affects the calling thread
...
The only user (bfd backtraces) is fine with that, and we really should not
mess the enable flag while doing allocations with other threads.
2013-07-10 17:28:32 +02:00
Martin Willi
f960b39061
leak-detective: take a copy of backtrace while printing traces
...
As we don't want to hold the lock, we must make sure backtraces keep valid
while printing them.
2013-07-10 17:28:24 +02:00
Martin Willi
3b26f04cf4
leak-detective: remove hdr from the allocation list during realloc()
...
If realloc moves an allocation, the original allocation gets freed. We
therefore must remove the hdr from the list, as it is invalid. We can add it
afterwards once it has been updated, allowing us to unlock the list during
reallocation.
2013-07-10 16:37:08 +02:00
Martin Willi
092550b03a
leak-detective: (re-)whitelist some OpenSSL functions
...
Some static allocations in plugins won't get freed, because in the test case
process the plugins are not destroyed. If a plugin would clean up allocations
done while just using the plugin, these show up as leak in the child process,
letting tests fail.
2013-06-21 10:53:23 +02:00
Tobias Brunner
f5f7053bcd
leak-detective: Resolve hooked functions during initialization
...
If uses of dlopen(), e.g. when loading plugins, produce errors an error
string could get allocated dynamically. At this point realloc() might not
yet be resolved and when dlsym() is later called by leak detective to do
so the error string might get freed while leak detective is disabled and
real_free() will be called with a pointer into one of leak detective's
memory blocks instead of a pointer to the block itself, causing a SIGSEGV.
2013-06-11 15:48:26 +02:00
Tobias Brunner
01e15ab5c7
Add getter for the number of leaks to leak_detective_t
2013-06-11 11:03:13 +02:00
Tobias Brunner
651d5ab8e7
openssl: Properly cleanup OpenSSL library
2013-05-08 15:02:40 +02:00
Martin Willi
d8f6f0c01c
leak-detective: add support for OS X by hooking default malloc zone
2013-05-06 15:15:24 +02:00
Martin Willi
50fbd32472
leak-detective: remove unused malloc call counters
2013-05-06 15:15:24 +02:00
Martin Willi
3117824f55
leak-detective: align allocations on both 32 and 64-bit systems to 32 bytes
2013-05-06 15:15:24 +02:00
Martin Willi
7e3f6299d5
leak-detective: call tzset() explicitly before enabling leak detective
...
tzset() is hard to whitelist on some systems, as there is no symbol involved.
Call tzset() explicitly before initialization to avoid false positives.
2013-05-06 15:15:24 +02:00
Martin Willi
17211b6b9a
leak-detective: override malloc functions instead of using deprecated hooks
...
malloc hooks have become deprecated, and their use has always been problematic,
especially in multi-threaded applications. Replace the functionality by
overriding all malloc functions and query the system allocator functions
using dlsym() with RTLD_NEXT.
2013-05-06 15:15:24 +02:00
Andreas Steffen
c9418d4fd3
added getpwuid_r and initgroups to whitelist
2013-03-03 09:04:49 +01:00
Tobias Brunner
f05b427265
Moved debug.[ch] to utils folder
2012-10-24 16:00:51 +02:00
Tobias Brunner
12642a6831
Moved data structures to new collections subfolder
2012-10-24 16:00:49 +02:00
Martin Willi
0bac49b0a9
Add getspnam_r() to leak detective whitelist
2012-08-10 10:43:44 +02:00
Martin Willi
549eba30ab
Increase leak detective backtrace depth by a frame
2012-07-13 13:23:29 +02:00
Martin Willi
6499354e4a
Don't access tail magic when reallocating invalid memory, as it would crash
2012-07-13 13:23:29 +02:00
Martin Willi
b46776aea1
Add an external method to disable leak detective temporarly
2012-07-13 13:23:29 +02:00
Martin Willi
7c8b9fcbf6
Add safe_strerror() to leak detective whitelist
...
While the thread specific strerror buffer gets cleaned up for
worker threads during their termination, the main thread itself,
and so its strerror buffer, is still alive during leak reports.
2012-07-11 08:45:15 +02:00
Sansar Choinyambuu
4002b41b92
Added ctime function to white list
2011-11-28 14:34:21 +01:00
Andreas Steffen
b97ca14d35
whitelist glibc instead of TrouSerS functions
2011-09-10 22:39:55 +02:00
Andreas Steffen
ddc261bcd3
added leaky TrouSerS functions to whitelist
2011-09-08 18:22:43 +02:00
Martin Willi
35c9347921
Use better packing of leak-detective memory_header to align pointers
2011-05-25 19:56:47 +02:00
Martin Willi
eb4f4551a1
Summarize leaks with identical backtraces, as we do it with memusage
2011-05-25 19:56:43 +02:00
Martin Willi
fce3b5c3ba
Added a leak detective method to report current memory usage with backtraces
2011-05-16 15:22:21 +02:00
Martin Willi
f37e8252a3
Make leak detective public
2011-05-16 15:22:21 +02:00
Martin Willi
42e0f26e53
Migrated leak_detective to INIT/METHOD macros
2011-05-16 15:22:21 +02:00
Martin Willi
07bda3feea
Whitelisted another tzset variant and dlsym
2011-02-18 16:08:01 +01:00
Martin Willi
7cfa84f540
Whitelist gnutls init function
2011-01-17 18:20:12 +01:00
Martin Willi
b94feb4b05
backtrace->contains_function takes multiple names, speeding up whitelist check drastically
2011-01-17 18:19:44 +01:00
Martin Willi
ec8426a349
Add some common glib non-leaks to whitelist
2011-01-17 18:19:36 +01:00
Andreas Steffen
1888dd6bd5
implemented IMC/IMV handler
2010-11-09 20:43:50 +01:00
Martin Willi
70789d28a1
Handle PIN: as a magic keyword for prompt, use getpass() to silently read credentials
2010-08-04 09:26:21 +02:00
Martin Willi
50a9e84540
Added NSPR PR_CallOnce to leak detective whitelist
2010-08-04 09:26:20 +02:00
Martin Willi
044e0dd1b1
Added buffer checking variants of syslog functions to leak detective
2010-08-04 09:26:20 +02:00
Martin Willi
40b2be16e3
Whitelist OpenSSLs ERR_put_error() in leak-detective
...
As we do not invoke ERR_get/clear_error() in all error cases, the
error codes are not removed from the error queue. But it is save
to whitelist the put function, as it uses a circular buffer that
does not grow beyond ERR_NUM_ERRORS errors (16 by default).
2010-05-20 17:37:18 +02:00
Martin Willi
091d178060
Option to skip slow addr2line resolution in leak-detective
2010-05-20 17:37:18 +02:00
Andreas Steffen
0ffedbfb46
added getprotobyname to whitelist
2010-05-02 21:13:10 +02:00
Martin Willi
86813bef12
Whitelist register_printf_specifier in leak detective
2009-11-17 15:51:57 +00:00
Martin Willi
587ebae722
Distinguish invalid free()s between corrupted magic and invalid pointer
2009-10-05 11:02:54 +02:00
Andreas Steffen
727b0f11e2
whitelist Curl_client_write
2009-09-27 23:07:21 +02:00
Martin Willi
323f9f990f
replaces four spaces by tabs, where appropriate
2009-09-04 14:50:23 +02:00
Martin Willi
7daf5226b7
removed trailing spaces ([[:space:]]+$)
2009-09-04 13:46:09 +02:00
Martin Willi
85fd609ed6
whitelist openssl ecdsa_check function
2009-08-27 13:59:30 +02:00
Martin Willi
3f9ec06f6f
added getnetbyname/gethostbyname2 to leak detective whitelist, used by pluto
2009-08-26 11:23:50 +02:00
Martin Willi
a41d0932c2
gcrypt rng implementation
2009-06-09 11:18:57 +02:00