mirror of
https://github.com/curl/curl.git
synced 2026-06-16 16:55:37 +03:00
In order to better track down cases where we don't exit cleanly and directly on OOM errors, this mode warns if there is another memory operation found *after* the torture limit was reached. runtests sets this strict mode. memdebug adds two new helper functions needed to make this work. curl_dbg_overlook() lets the code mark a memory allocation as fine to not notice and yet do another one after even if this one returns error. curl_dbg_restart() marks the code as - at this point the code ignores the OOM status and it is fine to do another memory call afterwards without it being considered a problem.
55 lines
855 B
Text
55 lines
855 B
Text
<testcase>
|
|
<info>
|
|
<keywords>
|
|
TrackMemory
|
|
</keywords>
|
|
</info>
|
|
|
|
#
|
|
# Server-side
|
|
<reply>
|
|
</reply>
|
|
|
|
# Client-side
|
|
<client>
|
|
<features>
|
|
TrackMemory
|
|
IPv6
|
|
</features>
|
|
# tool is what to use instead of 'curl'
|
|
<tool>
|
|
lib%TESTNUMBER
|
|
</tool>
|
|
|
|
<name>
|
|
libtest memory tracking operational
|
|
</name>
|
|
</client>
|
|
|
|
#
|
|
# Verify data after the test has been "shot"
|
|
<verify>
|
|
<file name="%LOGDIR/memdump">
|
|
MEM easy.c: malloc()
|
|
RESTART easy.c:
|
|
MEM lib%TESTNUMBER.c: malloc()
|
|
MEM lib%TESTNUMBER.c: free()
|
|
MEM dynbuf.c: realloc()
|
|
MEM dynbuf.c: realloc()
|
|
MEM escape.c: free()
|
|
MEM easy.c: free()
|
|
</file>
|
|
<stripfile>
|
|
s/^MEM escape.c:\d+ free\(\(nil\)\)[\n]$//
|
|
s/ =.*//
|
|
s/\(.*\)/()/
|
|
s/:\d+/:/
|
|
s:^(MEM |FD |OVERLOOK |RESTART )(.*[/\\])(.*):$1$3:
|
|
s/\r\n/\n/
|
|
s/^MEM getenv.c: realloc\(\)[\n]$//
|
|
s/^MEM getenv.c: free\(\)[\n]$//
|
|
s/^OVERLOOK getenv.c:[\n]$//
|
|
</stripfile>
|
|
</verify>
|
|
|
|
</testcase>
|