<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/lib/talloc/testsuite.c, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/'/>
<entry>
<title>replace direct calls to memset_s() with commonly used macros</title>
<updated>2025-01-02T17:01:30+00:00</updated>
<author>
<name>Michael Tokarev</name>
<email>mjt@tls.msk.ru</email>
</author>
<published>2024-11-18T11:19:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=712117155e0efae593d2867037c92741f2151252'/>
<id>712117155e0efae593d2867037c92741f2151252</id>
<content type='text'>
samba provides macros for zeroing various structures in memory,
and all code uses them instead of relying on memset_s().
However, a few places use memset_s() directly.  Replace these
usages with macros for consistency and to be able to replace
memset_s() easier.

A few notes.

Commit 03a50d8f7d872b6ef701d12 "lib:util: Check memset_s() error
code in talloc_keep_secret_destructor()" (Aug-2022) added a check
for error return from memset_s().  This is the only place in whole
codebase which bothers about doing this.  But I've difficult time
figuring out the intention.  Was there a real case when this code
path is actually executed?

Commit 7658c9bf0a9c99e3f200571 "lib:crypto: Remove redundant array
zeroing" (Nov-2023) removed the OTHER line from the two lines used
to zero memory in here.  Initially the code used both memset_s()
*and* ZERO_ARRAY_LEN(), the former has been removed.  This change
removes the other - memset_s(), reintroducing ZERO_ARRAY_LEN().
Here however, it's probably better to use BURN_PTR instead of
ZERO_ARRAY - in this place and a few lines above.

Commit 8dddea2ceda40f2365bd6b1 "lib:talloc: Use memset_s() to avoid
the call gets optimized out" (Feb-2024) is a recent commit which
introduces memset_s().  However, it does not seem like it makes
any difference whatsoever for a testsuite, or that it actually
needs to clean up the memory to begin with.

We've quite an assortment of all this memory zeroing stuff.  Also
it is repeated in replace.h and memory.h (two sets in these files
are different but has big intersection).  I'd say, to fix this mess,
things from replace.h should be removed in favour of memory.h, and
necessary includes added, but this is for the next time.  We also
have lots of direct usages of memset_s() in heimdal code.

Cc: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Signed-off-by: Michael Tokarev &lt;mjt@tls.msk.ru&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Pavel Filipenský &lt;pfilipensky@samba.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
samba provides macros for zeroing various structures in memory,
and all code uses them instead of relying on memset_s().
However, a few places use memset_s() directly.  Replace these
usages with macros for consistency and to be able to replace
memset_s() easier.

A few notes.

Commit 03a50d8f7d872b6ef701d12 "lib:util: Check memset_s() error
code in talloc_keep_secret_destructor()" (Aug-2022) added a check
for error return from memset_s().  This is the only place in whole
codebase which bothers about doing this.  But I've difficult time
figuring out the intention.  Was there a real case when this code
path is actually executed?

Commit 7658c9bf0a9c99e3f200571 "lib:crypto: Remove redundant array
zeroing" (Nov-2023) removed the OTHER line from the two lines used
to zero memory in here.  Initially the code used both memset_s()
*and* ZERO_ARRAY_LEN(), the former has been removed.  This change
removes the other - memset_s(), reintroducing ZERO_ARRAY_LEN().
Here however, it's probably better to use BURN_PTR instead of
ZERO_ARRAY - in this place and a few lines above.

Commit 8dddea2ceda40f2365bd6b1 "lib:talloc: Use memset_s() to avoid
the call gets optimized out" (Feb-2024) is a recent commit which
introduces memset_s().  However, it does not seem like it makes
any difference whatsoever for a testsuite, or that it actually
needs to clean up the memory to begin with.

We've quite an assortment of all this memory zeroing stuff.  Also
it is repeated in replace.h and memory.h (two sets in these files
are different but has big intersection).  I'd say, to fix this mess,
things from replace.h should be removed in favour of memory.h, and
necessary includes added, but this is for the next time.  We also
have lots of direct usages of memset_s() in heimdal code.

Cc: Joseph Sutton &lt;josephsutton@catalyst.net.nz&gt;
Signed-off-by: Michael Tokarev &lt;mjt@tls.msk.ru&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Pavel Filipenský &lt;pfilipensky@samba.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>lib:talloc: Use tabs to align output in speed test</title>
<updated>2024-09-28T00:11:34+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2023-04-27T09:31:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=a66db6c16e4225e200da7f6f939b756026cee61f'/>
<id>a66db6c16e4225e200da7f6f939b756026cee61f</id>
<content type='text'>
Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>lib:talloc: Increase alloc size to 128 kilobytes</title>
<updated>2024-09-28T00:11:34+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2023-04-27T09:24:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=39c13f062a859d17b5be3a2a02fece8d0b1819f1'/>
<id>39c13f062a859d17b5be3a2a02fece8d0b1819f1</id>
<content type='text'>
We want to avoid that the optimizer will use stack allocations. This way
the test should be a bit more realistic.

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We want to avoid that the optimizer will use stack allocations. This way
the test should be a bit more realistic.

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>lib:talloc: Don't optimize the speed test</title>
<updated>2024-09-28T00:11:34+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2023-04-17T07:25:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=00d5982da2f5f2595b634b957c7d0b990e12b37b'/>
<id>00d5982da2f5f2595b634b957c7d0b990e12b37b</id>
<content type='text'>
If the speed test gets optimized, the malloc() and free() might be
replaced by stack allocations.

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the speed test gets optimized, the malloc() and free() might be
replaced by stack allocations.

Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>lib:talloc: Add talloc_zero vs calloc test</title>
<updated>2024-09-28T00:11:34+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2023-04-14T19:34:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=b6bf9cba80e55ca5aac3611e55dc952782c867c7'/>
<id>b6bf9cba80e55ca5aac3611e55dc952782c867c7</id>
<content type='text'>
Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>lib:talloc: Use memset_s() to avoid the call gets optimized out</title>
<updated>2024-09-28T00:11:34+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2024-02-13T08:22:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=8dddea2ceda40f2365bd6b1a62826b84dc523b74'/>
<id>8dddea2ceda40f2365bd6b1a62826b84dc523b74</id>
<content type='text'>
Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>lib:talloc: Remove trailing spaces from testsuite.c</title>
<updated>2024-09-28T00:11:34+00:00</updated>
<author>
<name>Andreas Schneider</name>
<email>asn@samba.org</email>
</author>
<published>2024-02-06T17:03:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=6812e30be35508db3ac23406243fe08da9cf3084'/>
<id>6812e30be35508db3ac23406243fe08da9cf3084</id>
<content type='text'>
Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Andreas Schneider &lt;asn@samba.org&gt;
Reviewed-by: Martin Schwenke &lt;martin@meltin.net&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>lib: talloc: Remove the ALWAYS_REALLOC code paths.</title>
<updated>2020-11-10T19:49:33+00:00</updated>
<author>
<name>Jeremy Allison</name>
<email>jra@samba.org</email>
</author>
<published>2020-11-09T19:50:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=6598e00e129bc8b36d6d38345b67aba48b3eb26d'/>
<id>6598e00e129bc8b36d6d38345b67aba48b3eb26d</id>
<content type='text'>
This is now never set, and also never tested, and only makes
the talloc code more complicated.

Once this is gone we can start looking at the memlimit
stuff.

Signed-off-by: Jeremy Allison &lt;jra@samba.org&gt;
Reviewed-by: Alexander Bokovoy &lt;ab@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is now never set, and also never tested, and only makes
the talloc code more complicated.

Once this is gone we can start looking at the memlimit
stuff.

Signed-off-by: Jeremy Allison &lt;jra@samba.org&gt;
Reviewed-by: Alexander Bokovoy &lt;ab@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: talloc: More tests for realloc when used with memlimited pools</title>
<updated>2020-11-09T02:46:50+00:00</updated>
<author>
<name>Arran Cudbard-Bell</name>
<email>a.cudbardb@freeradius.org</email>
</author>
<published>2020-10-20T19:12:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=a5052c73c3ffdca6b30194223e69a26430f3f989'/>
<id>a5052c73c3ffdca6b30194223e69a26430f3f989</id>
<content type='text'>
This requires the previous patch.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14540

Signed-off-by: Arran Cudbard-Bell &lt;a.cudbardb@freeradius.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This requires the previous patch.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14540

Signed-off-by: Arran Cudbard-Bell &lt;a.cudbardb@freeradius.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>lib: talloc: Add more debugging text for existing memlimit + pool tests</title>
<updated>2020-11-09T02:46:49+00:00</updated>
<author>
<name>Arran Cudbard-Bell</name>
<email>a.cudbardb@freeradius.org</email>
</author>
<published>2020-10-20T19:10:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=30a8bea8a340dcf9a3120f5ee8041e62fb129d8d'/>
<id>30a8bea8a340dcf9a3120f5ee8041e62fb129d8d</id>
<content type='text'>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14540

Signed-off-by: Arran Cudbard-Bell &lt;a.cudbardb@freeradius.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14540

Signed-off-by: Arran Cudbard-Bell &lt;a.cudbardb@freeradius.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
