<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ro">
	<id>http://wiki.dcae.pub.ro/index.php?action=history&amp;feed=atom&amp;title=SDPT_Lab_9</id>
	<title>SDPT Lab 9 - Revizia istoricului</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.dcae.pub.ro/index.php?action=history&amp;feed=atom&amp;title=SDPT_Lab_9"/>
	<link rel="alternate" type="text/html" href="http://wiki.dcae.pub.ro/index.php?title=SDPT_Lab_9&amp;action=history"/>
	<updated>2026-05-26T22:15:03Z</updated>
	<subtitle>Istoricul versiunilor pentru această pagină din wiki</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>http://wiki.dcae.pub.ro/index.php?title=SDPT_Lab_9&amp;diff=8350&amp;oldid=prev</id>
		<title>Rhobincu: /* Tasks */</title>
		<link rel="alternate" type="text/html" href="http://wiki.dcae.pub.ro/index.php?title=SDPT_Lab_9&amp;diff=8350&amp;oldid=prev"/>
		<updated>2026-05-18T15:38:13Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Tasks&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ro&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Versiunea anterioară&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Versiunea de la data 18 mai 2026 15:38&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l24&quot; &gt;Linia 24:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 24:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Extend the Docker build environment.&amp;#039;&amp;#039;&amp;#039; Update your &amp;lt;code&amp;gt;Dockerfile&amp;lt;/code&amp;gt; to install &amp;lt;code&amp;gt;valgrind&amp;lt;/code&amp;gt; alongside the tools already present. Rebuild and verify with &amp;lt;code&amp;gt;valgrind --version&amp;lt;/code&amp;gt;. The sanitizers themselves ship with the compiler, so no separate package is needed - but confirm by running &amp;lt;code&amp;gt;echo &amp;quot;int main(){}&amp;quot; | g++ -fsanitize=address -x c++ - -o /dev/null&amp;lt;/code&amp;gt; inside the container; if that succeeds, ASan is available.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Extend the Docker build environment.&amp;#039;&amp;#039;&amp;#039; Update your &amp;lt;code&amp;gt;Dockerfile&amp;lt;/code&amp;gt; to install &amp;lt;code&amp;gt;valgrind&amp;lt;/code&amp;gt; alongside the tools already present. Rebuild and verify with &amp;lt;code&amp;gt;valgrind --version&amp;lt;/code&amp;gt;. The sanitizers themselves ship with the compiler, so no separate package is needed - but confirm by running &amp;lt;code&amp;gt;echo &amp;quot;int main(){}&amp;quot; | g++ -fsanitize=address -x c++ - -o /dev/null&amp;lt;/code&amp;gt; inside the container; if that succeeds, ASan is available.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Add the Sanitize build type to CMake.&amp;#039;&amp;#039;&amp;#039; In your &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;, add logic that, when &amp;lt;code&amp;gt;CMAKE_BUILD_TYPE&amp;lt;/code&amp;gt; equals &amp;lt;code&amp;gt;Sanitize&amp;lt;/code&amp;gt;, sets compile and link options for &amp;lt;code&amp;gt;-fsanitize=address,undefined&amp;lt;/code&amp;gt; plus &amp;lt;code&amp;gt;-O1 -g -fno-omit-frame-pointer&amp;lt;/code&amp;gt;. Make sure both compile &amp;#039;&amp;#039;and&amp;#039;&amp;#039; link options include the sanitizer flag - if you forget the link side, you will get cryptic linker errors about missing &amp;lt;code&amp;gt;__asan_*&amp;lt;/code&amp;gt; symbols. Test locally: &amp;lt;code&amp;gt;cmake -B build-san -DCMAKE_BUILD_TYPE=Sanitize&amp;lt;/code&amp;gt;, then build, then run a test binary directly to confirm it produces output that mentions ASan.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Add the Sanitize build type to CMake.&amp;#039;&amp;#039;&amp;#039; In your &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;, add logic that, when &amp;lt;code&amp;gt;CMAKE_BUILD_TYPE&amp;lt;/code&amp;gt; equals &amp;lt;code&amp;gt;Sanitize&amp;lt;/code&amp;gt;, sets compile and link options for &amp;lt;code&amp;gt;-fsanitize=address,undefined&amp;lt;/code&amp;gt; plus &amp;lt;code&amp;gt;-O1 -g -fno-omit-frame-pointer&amp;lt;/code&amp;gt;. Make sure both compile &amp;#039;&amp;#039;and&amp;#039;&amp;#039; link options include the sanitizer flag - if you forget the link side, you will get cryptic linker errors about missing &amp;lt;code&amp;gt;__asan_*&amp;lt;/code&amp;gt; symbols. Test locally: &amp;lt;code&amp;gt;cmake -B build-san -DCMAKE_BUILD_TYPE=Sanitize&amp;lt;/code&amp;gt;, then build, then run a test binary directly to confirm it produces output that mentions ASan.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Run your existing tests under the sanitizers and clean up.&amp;#039;&amp;#039;&amp;#039; Run &amp;lt;code&amp;gt;ctest --test-dir build-san --output-on-failure&amp;lt;/code&amp;gt;. If any tests fail due to sanitizer reports, fix the underlying bugs in the Oven Controller code (do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; suppress them). Typical findings in EE-trained codebases: forgotten &amp;lt;code&amp;gt;delete[]&amp;lt;/code&amp;gt;, signed overflow in temperature math, reading from a member variable that was never initialized in a constructor. Each fix should be its own small commit with a message describing what the sanitizer reported.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Run your existing tests under the sanitizers and clean up.&amp;#039;&amp;#039;&amp;#039; Run &amp;lt;code&amp;gt;ctest --test-dir build-san --output-on-failure&amp;lt;/code&amp;gt;. If any tests fail due to sanitizer reports, fix the underlying bugs in the Oven Controller code (do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; suppress them). Typical findings in EE-trained codebases: forgotten &amp;lt;code&amp;gt;delete[]&amp;lt;/code&amp;gt;, signed overflow in temperature math, reading from a member variable that was never initialized in a constructor. Each fix should be its own small commit with a message describing what the sanitizer reported.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Add a sanitize stage to GitLab CI.&amp;#039;&amp;#039;&amp;#039; Edit &amp;lt;code&amp;gt;.gitlab-ci.yml&amp;lt;/code&amp;gt; to add a new &amp;lt;code&amp;gt;sanitize&amp;lt;/code&amp;gt; stage after &amp;lt;code&amp;gt;test&amp;lt;/code&amp;gt;. The job should: configure a &amp;lt;code&amp;gt;Sanitize&amp;lt;/code&amp;gt; build, compile it, and run &amp;lt;code&amp;gt;ctest&amp;lt;/code&amp;gt; against it. Use your existing Docker image. The job must fail the pipeline on any sanitizer error.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Add a sanitize stage to GitLab CI.&amp;#039;&amp;#039;&amp;#039; Edit &amp;lt;code&amp;gt;.gitlab-ci.yml&amp;lt;/code&amp;gt; to add a new &amp;lt;code&amp;gt;sanitize&amp;lt;/code&amp;gt; stage after &amp;lt;code&amp;gt;test&amp;lt;/code&amp;gt;. The job should: configure a &amp;lt;code&amp;gt;Sanitize&amp;lt;/code&amp;gt; build, compile it, and run &amp;lt;code&amp;gt;ctest&amp;lt;/code&amp;gt; against it. Use your existing Docker image. The job must fail the pipeline on any sanitizer error.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Trigger ASan on purpose.&amp;#039;&amp;#039;&amp;#039; On your feature branch, introduce a deliberate &amp;#039;&amp;#039;&amp;#039;heap-buffer-overflow&amp;#039;&amp;#039;&amp;#039; bug somewhere in the production code. Push, watch the &amp;lt;code&amp;gt;sanitize&amp;lt;/code&amp;gt; stage fail, capture the ASan report (the job-log permalink in the MR description is sufficient), then revert. Your goal is to see the full ASan diagnostic - the line with the offending access, the line of the allocation, and the &amp;quot;stack-buffer-overflow&amp;quot; or &amp;quot;heap-buffer-overflow&amp;quot; classification.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Trigger ASan on purpose.&amp;#039;&amp;#039;&amp;#039; On your feature branch, introduce a deliberate &amp;#039;&amp;#039;&amp;#039;heap-buffer-overflow&amp;#039;&amp;#039;&amp;#039; bug somewhere in the production code. Push, watch the &amp;lt;code&amp;gt;sanitize&amp;lt;/code&amp;gt; stage fail, capture the ASan report (the job-log permalink in the MR description is sufficient), then revert. Your goal is to see the full ASan diagnostic - the line with the offending access, the line of the allocation, and the &amp;quot;stack-buffer-overflow&amp;quot; or &amp;quot;heap-buffer-overflow&amp;quot; classification.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Trigger UBSan on purpose.&amp;#039;&amp;#039;&amp;#039; Repeat with a deliberate &amp;#039;&amp;#039;&amp;#039;signed integer overflow&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;null pointer dereference&amp;#039;&amp;#039;&amp;#039;. The UBSan report looks different from ASan&amp;#039;s - a one-line &amp;quot;runtime error&amp;quot; message at the trigger point. Capture, revert.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Trigger UBSan on purpose.&amp;#039;&amp;#039;&amp;#039; Repeat with a deliberate &amp;#039;&amp;#039;&amp;#039;signed integer overflow&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;null pointer dereference&amp;#039;&amp;#039;&amp;#039;. The UBSan report looks different from ASan&amp;#039;s - a one-line &amp;quot;runtime error&amp;quot; message at the trigger point. Capture, revert.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Trigger LeakSanitizer on purpose.&amp;#039;&amp;#039;&amp;#039; Repeat with a deliberate memory leak (allocate something on the heap, do not free it). LeakSan reports at program exit, not at the leak site. Capture, revert.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Trigger LeakSanitizer on purpose.&amp;#039;&amp;#039;&amp;#039; Repeat with a deliberate memory leak (allocate something on the heap, do not free it). LeakSan reports at program exit, not at the leak site. Capture, revert.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Run Valgrind once, manually.&amp;#039;&amp;#039;&amp;#039; Build your project in a normal Debug configuration (no sanitizers - they conflict with Valgrind&amp;#039;s instrumentation). From inside your Docker container, run &amp;lt;code&amp;gt;valgrind --leak-check=full --show-leakkinds=all --track-origins=yes ./your_test_binary&amp;lt;/code&amp;gt;. Save the full output. If Valgrind reports any errors that ASan did not, fix them. Add a paragraph to your MR description noting which tool caught what, or that the two agreed completely.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Run Valgrind once, manually.&amp;#039;&amp;#039;&amp;#039; Build your project in a normal Debug configuration (no sanitizers - they conflict with Valgrind&amp;#039;s instrumentation). From inside your Docker container, run &amp;lt;code&amp;gt;valgrind --leak-check=full --show-leakkinds=all --track-origins=yes ./your_test_binary&amp;lt;/code&amp;gt;. Save the full output. If Valgrind reports any errors that ASan did not, fix them. Add a paragraph to your MR description noting which tool caught what, or that the two agreed completely.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Re-check coverage.&amp;#039;&amp;#039;&amp;#039; Recall from Week 4: &amp;lt;code&amp;gt;gcovr -r .. --html-details&amp;lt;/code&amp;gt; against a coverage-instrumented build. Generate a current coverage report. Compare against your Week 4 baseline. If coverage dropped, write enough additional tests to bring it back. Coverage gaps are places where sanitizer findings are silently impossible, so this is part of the dynamic-analysis story even if the tool is the same one you used in Week 4.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Re-check coverage.&amp;#039;&amp;#039;&amp;#039; Recall from Week 4: &amp;lt;code&amp;gt;gcovr -r .. --html-details&amp;lt;/code&amp;gt; against a coverage-instrumented build. Generate a current coverage report. Compare against your Week 4 baseline. If coverage dropped, write enough additional tests to bring it back. Coverage gaps are places where sanitizer findings are silently impossible, so this is part of the dynamic-analysis story even if the tool is the same one you used in Week 4.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Document the cost.&amp;#039;&amp;#039;&amp;#039; Compare the wall-clock time of your full pipeline before and after this lab. The &amp;lt;code&amp;gt;sanitize&amp;lt;/code&amp;gt; stage adds work; document by how much in your MR description. As in Week 7, &amp;quot;the sanitize stage adds 6 minutes and we caught two real bugs&amp;quot; is a more honest finding than rounding to &amp;quot;negligible&amp;quot;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Document the cost.&amp;#039;&amp;#039;&amp;#039; Compare the wall-clock time of your full pipeline before and after this lab. The &amp;lt;code&amp;gt;sanitize&amp;lt;/code&amp;gt; stage adds work; document by how much in your MR description. As in Week 7, &amp;quot;the sanitize stage adds 6 minutes and we caught two real bugs&amp;quot; is a more honest finding than rounding to &amp;quot;negligible&amp;quot;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Review and merge.&amp;#039;&amp;#039;&amp;#039; Open the MR. The reviewer should check: the Sanitize build type works locally and in CI, that the three deliberate-bug pipeline runs are visible, that the Valgrind output is referenced in the MR, that coverage has not regressed.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Review and merge.&amp;#039;&amp;#039;&amp;#039; Open the MR. The reviewer should check: the Sanitize build type works locally and in CI, that the three deliberate-bug pipeline runs are visible, that the Valgrind output is referenced in the MR, that coverage has not regressed.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rhobincu</name></author>
	</entry>
	<entry>
		<id>http://wiki.dcae.pub.ro/index.php?title=SDPT_Lab_9&amp;diff=8346&amp;oldid=prev</id>
		<title>Rhobincu: /* Deliverables */</title>
		<link rel="alternate" type="text/html" href="http://wiki.dcae.pub.ro/index.php?title=SDPT_Lab_9&amp;diff=8346&amp;oldid=prev"/>
		<updated>2026-05-11T13:41:55Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Deliverables&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ro&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Versiunea anterioară&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Versiunea de la data 11 mai 2026 13:41&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l59&quot; &gt;Linia 59:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 59:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Deliverables ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Deliverables ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For this lab to be &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;marked &lt;/del&gt;complete, your &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; branch must contain:&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For this lab to be &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;considered &lt;/ins&gt;complete, your &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; branch must contain:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# A &amp;lt;code&amp;gt;Dockerfile&amp;lt;/code&amp;gt; that installs &amp;lt;code&amp;gt;valgrind&amp;lt;/code&amp;gt; in addition to the previous week&amp;#039;s tooling.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# A &amp;lt;code&amp;gt;Dockerfile&amp;lt;/code&amp;gt; that installs &amp;lt;code&amp;gt;valgrind&amp;lt;/code&amp;gt; in addition to the previous week&amp;#039;s tooling.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l70&quot; &gt;Linia 70:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 70:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## The coverage comparison from Task 9 (before/after, plus what you did about it).&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## The coverage comparison from Task 9 (before/after, plus what you did about it).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## The pipeline cost comparison from Task 10.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## The pipeline cost comparison from Task 10.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The VPL deliverables include the first three files which will be the only ones graded.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Common pitfalls ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Common pitfalls ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rhobincu</name></author>
	</entry>
	<entry>
		<id>http://wiki.dcae.pub.ro/index.php?title=SDPT_Lab_9&amp;diff=8345&amp;oldid=prev</id>
		<title>Rhobincu la 11 mai 2026 13:34</title>
		<link rel="alternate" type="text/html" href="http://wiki.dcae.pub.ro/index.php?title=SDPT_Lab_9&amp;diff=8345&amp;oldid=prev"/>
		<updated>2026-05-11T13:34:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ro&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Versiunea anterioară&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Versiunea de la data 11 mai 2026 13:34&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot; &gt;Linia 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Objective ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Objective ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Extend your Oven Controller&amp;#039;s CI pipeline with a fourth quality gate: a &amp;lt;code&amp;gt;sanitize&amp;lt;/code&amp;gt; stage that builds the project under AddressSanitizer and UndefinedBehaviorSanitizer and runs your full test suite against the instrumented binary. By the end of this lab, your pipeline catches a fourth class of bug &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;--&lt;/del&gt;- runtime memory errors and undefined behavior &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;--&lt;/del&gt;- automatically on every push.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Extend your Oven Controller&amp;#039;s CI pipeline with a fourth quality gate: a &amp;lt;code&amp;gt;sanitize&amp;lt;/code&amp;gt; stage that builds the project under AddressSanitizer and UndefinedBehaviorSanitizer and runs your full test suite against the instrumented binary. By the end of this lab, your pipeline catches a fourth class of bug - runtime memory errors and undefined behavior - automatically on every push.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Background ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Background ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l11&quot; &gt;Linia 11:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 11:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The sanitizers report errors by printing to stderr and exiting with a nonzero status. This means your existing GoogleTest tests do not need any modification: if a test triggers a sanitizer error, the test binary aborts, ctest reports failure, the CI job fails, and the MR is blocked. The pipeline plumbing from Week 6 carries this work for you for free.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The sanitizers report errors by printing to stderr and exiting with a nonzero status. This means your existing GoogleTest tests do not need any modification: if a test triggers a sanitizer error, the test binary aborts, ctest reports failure, the CI job fails, and the MR is blocked. The pipeline plumbing from Week 6 carries this work for you for free.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In addition to the sanitizer build, you will run Valgrind manually once against the same codebase. The two tools are complementary: ASan is fast and runs in CI; Valgrind is slow but sometimes catches things ASan misses (notably uninitialized reads, which require MemorySanitizer to catch with sanitizers &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;--&lt;/del&gt;- and you saw in the lecture why MSan is impractical).&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In addition to the sanitizer build, you will run Valgrind manually once against the same codebase. The two tools are complementary: ASan is fast and runs in CI; Valgrind is slow but sometimes catches things ASan misses (notably uninitialized reads, which require MemorySanitizer to catch with sanitizers - and you saw in the lecture why MSan is impractical).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You will also reuse &amp;lt;code&amp;gt;gcovr&amp;lt;/code&amp;gt; from Week 4. Dynamic analysis can only find bugs on code paths your tests actually execute, so coverage is part of the deliverable.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You will also reuse &amp;lt;code&amp;gt;gcovr&amp;lt;/code&amp;gt; from Week 4. Dynamic analysis can only find bugs on code paths your tests actually execute, so coverage is part of the deliverable.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The point of this lab is not to introduce new tools you have never seen &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;--&lt;/del&gt;- you have met all four (ASan/UBSan/Valgrind/gcovr) in lectures. The point is to wire them together into your existing pipeline and prove the wiring works by deliberately breaking things.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The point of this lab is not to introduce new tools you have never seen - you have met all four (ASan/UBSan/Valgrind/gcovr) in lectures. The point is to wire them together into your existing pipeline and prove the wiring works by deliberately breaking things.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Documentation pointers: &amp;lt;code&amp;gt;man valgrind&amp;lt;/code&amp;gt;, the AddressSanitizer wiki at https://github.com/google/sanitizers/wiki/AddressSanitizer, the UBSan documentation at https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html, and your existing gcovr docs.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Documentation pointers: &amp;lt;code&amp;gt;man valgrind&amp;lt;/code&amp;gt;, the AddressSanitizer wiki at https://github.com/google/sanitizers/wiki/AddressSanitizer, the UBSan documentation at https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html, and your existing gcovr docs.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l23&quot; &gt;Linia 23:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 23:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Work on a feature branch opened from a tracked Issue. Open a Merge Request when you are ready to integrate.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Work on a feature branch opened from a tracked Issue. Open a Merge Request when you are ready to integrate.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Extend the Docker build environment.&amp;#039;&amp;#039;&amp;#039; Update your &amp;lt;code&amp;gt;Dockerfile&amp;lt;/code&amp;gt; to install &amp;lt;code&amp;gt;valgrind&amp;lt;/code&amp;gt; alongside the tools already present. Rebuild and verify with &amp;lt;code&amp;gt;valgrind --version&amp;lt;/code&amp;gt;. The sanitizers themselves ship with the compiler, so no separate package is needed &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;--&lt;/del&gt;- but confirm by running &amp;lt;code&amp;gt;echo &amp;quot;int main(){}&amp;quot; | g++ -fsanitize=address -x c++ - -o /dev/null&amp;lt;/code&amp;gt; inside the container; if that succeeds, ASan is available.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Extend the Docker build environment.&amp;#039;&amp;#039;&amp;#039; Update your &amp;lt;code&amp;gt;Dockerfile&amp;lt;/code&amp;gt; to install &amp;lt;code&amp;gt;valgrind&amp;lt;/code&amp;gt; alongside the tools already present. Rebuild and verify with &amp;lt;code&amp;gt;valgrind --version&amp;lt;/code&amp;gt;. The sanitizers themselves ship with the compiler, so no separate package is needed - but confirm by running &amp;lt;code&amp;gt;echo &amp;quot;int main(){}&amp;quot; | g++ -fsanitize=address -x c++ - -o /dev/null&amp;lt;/code&amp;gt; inside the container; if that succeeds, ASan is available.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Add the Sanitize build type to CMake.&amp;#039;&amp;#039;&amp;#039; In your &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;, add logic that, when &amp;lt;code&amp;gt;CMAKE_BUILD_TYPE&amp;lt;/code&amp;gt; equals &amp;lt;code&amp;gt;Sanitize&amp;lt;/code&amp;gt;, sets compile and link options for &amp;lt;code&amp;gt;-fsanitize=address,undefined&amp;lt;/code&amp;gt; plus &amp;lt;code&amp;gt;-O1 -g -fno-omit-frame-pointer&amp;lt;/code&amp;gt;. Make sure both compile &amp;#039;&amp;#039;and&amp;#039;&amp;#039; link options include the sanitizer flag &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;--&lt;/del&gt;- if you forget the link side, you will get cryptic linker errors about missing &amp;lt;code&amp;gt;__asan_*&amp;lt;/code&amp;gt; symbols. Test locally: &amp;lt;code&amp;gt;cmake -B build-san -DCMAKE_BUILD_TYPE=Sanitize&amp;lt;/code&amp;gt;, then build, then run a test binary directly to confirm it produces output that mentions ASan.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Add the Sanitize build type to CMake.&amp;#039;&amp;#039;&amp;#039; In your &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;, add logic that, when &amp;lt;code&amp;gt;CMAKE_BUILD_TYPE&amp;lt;/code&amp;gt; equals &amp;lt;code&amp;gt;Sanitize&amp;lt;/code&amp;gt;, sets compile and link options for &amp;lt;code&amp;gt;-fsanitize=address,undefined&amp;lt;/code&amp;gt; plus &amp;lt;code&amp;gt;-O1 -g -fno-omit-frame-pointer&amp;lt;/code&amp;gt;. Make sure both compile &amp;#039;&amp;#039;and&amp;#039;&amp;#039; link options include the sanitizer flag - if you forget the link side, you will get cryptic linker errors about missing &amp;lt;code&amp;gt;__asan_*&amp;lt;/code&amp;gt; symbols. Test locally: &amp;lt;code&amp;gt;cmake -B build-san -DCMAKE_BUILD_TYPE=Sanitize&amp;lt;/code&amp;gt;, then build, then run a test binary directly to confirm it produces output that mentions ASan.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Run your existing tests under the sanitizers and clean up.&amp;#039;&amp;#039;&amp;#039; Run &amp;lt;code&amp;gt;ctest --test-dir build-san --output-on-failure&amp;lt;/code&amp;gt;. If any tests fail due to sanitizer reports, fix the underlying bugs in the Oven Controller code (do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; suppress them). Typical findings in EE-trained codebases: forgotten &amp;lt;code&amp;gt;delete[]&amp;lt;/code&amp;gt;, signed overflow in temperature math, reading from a member variable that was never initialized in a constructor. Each fix should be its own small commit with a message describing what the sanitizer reported.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Run your existing tests under the sanitizers and clean up.&amp;#039;&amp;#039;&amp;#039; Run &amp;lt;code&amp;gt;ctest --test-dir build-san --output-on-failure&amp;lt;/code&amp;gt;. If any tests fail due to sanitizer reports, fix the underlying bugs in the Oven Controller code (do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; suppress them). Typical findings in EE-trained codebases: forgotten &amp;lt;code&amp;gt;delete[]&amp;lt;/code&amp;gt;, signed overflow in temperature math, reading from a member variable that was never initialized in a constructor. Each fix should be its own small commit with a message describing what the sanitizer reported.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l31&quot; &gt;Linia 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 31:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Add a sanitize stage to GitLab CI.&amp;#039;&amp;#039;&amp;#039; Edit &amp;lt;code&amp;gt;.gitlab-ci.yml&amp;lt;/code&amp;gt; to add a new &amp;lt;code&amp;gt;sanitize&amp;lt;/code&amp;gt; stage after &amp;lt;code&amp;gt;test&amp;lt;/code&amp;gt;. The job should: configure a &amp;lt;code&amp;gt;Sanitize&amp;lt;/code&amp;gt; build, compile it, and run &amp;lt;code&amp;gt;ctest&amp;lt;/code&amp;gt; against it. Use your existing Docker image. The job must fail the pipeline on any sanitizer error.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Add a sanitize stage to GitLab CI.&amp;#039;&amp;#039;&amp;#039; Edit &amp;lt;code&amp;gt;.gitlab-ci.yml&amp;lt;/code&amp;gt; to add a new &amp;lt;code&amp;gt;sanitize&amp;lt;/code&amp;gt; stage after &amp;lt;code&amp;gt;test&amp;lt;/code&amp;gt;. The job should: configure a &amp;lt;code&amp;gt;Sanitize&amp;lt;/code&amp;gt; build, compile it, and run &amp;lt;code&amp;gt;ctest&amp;lt;/code&amp;gt; against it. Use your existing Docker image. The job must fail the pipeline on any sanitizer error.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Trigger ASan on purpose.&amp;#039;&amp;#039;&amp;#039; On your feature branch, introduce a deliberate &amp;#039;&amp;#039;&amp;#039;heap-buffer-overflow&amp;#039;&amp;#039;&amp;#039; bug somewhere in the production code. Push, watch the &amp;lt;code&amp;gt;sanitize&amp;lt;/code&amp;gt; stage fail, capture the ASan report (the job-log permalink in the MR description is sufficient), then revert. Your goal is to see the full ASan diagnostic &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;--&lt;/del&gt;- the line with the offending access, the line of the allocation, and the &amp;quot;stack-buffer-overflow&amp;quot; or &amp;quot;heap-buffer-overflow&amp;quot; classification.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Trigger ASan on purpose.&amp;#039;&amp;#039;&amp;#039; On your feature branch, introduce a deliberate &amp;#039;&amp;#039;&amp;#039;heap-buffer-overflow&amp;#039;&amp;#039;&amp;#039; bug somewhere in the production code. Push, watch the &amp;lt;code&amp;gt;sanitize&amp;lt;/code&amp;gt; stage fail, capture the ASan report (the job-log permalink in the MR description is sufficient), then revert. Your goal is to see the full ASan diagnostic - the line with the offending access, the line of the allocation, and the &amp;quot;stack-buffer-overflow&amp;quot; or &amp;quot;heap-buffer-overflow&amp;quot; classification.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Trigger UBSan on purpose.&amp;#039;&amp;#039;&amp;#039; Repeat with a deliberate &amp;#039;&amp;#039;&amp;#039;signed integer overflow&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;null pointer dereference&amp;#039;&amp;#039;&amp;#039;. The UBSan report looks different from ASan&amp;#039;s &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;--&lt;/del&gt;- a one-line &amp;quot;runtime error&amp;quot; message at the trigger point. Capture, revert.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Trigger UBSan on purpose.&amp;#039;&amp;#039;&amp;#039; Repeat with a deliberate &amp;#039;&amp;#039;&amp;#039;signed integer overflow&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;null pointer dereference&amp;#039;&amp;#039;&amp;#039;. The UBSan report looks different from ASan&amp;#039;s - a one-line &amp;quot;runtime error&amp;quot; message at the trigger point. Capture, revert.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Trigger LeakSanitizer on purpose.&amp;#039;&amp;#039;&amp;#039; Repeat with a deliberate memory leak (allocate something on the heap, do not free it). LeakSan reports at program exit, not at the leak site. Capture, revert.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Trigger LeakSanitizer on purpose.&amp;#039;&amp;#039;&amp;#039; Repeat with a deliberate memory leak (allocate something on the heap, do not free it). LeakSan reports at program exit, not at the leak site. Capture, revert.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Run Valgrind once, manually.&amp;#039;&amp;#039;&amp;#039; Build your project in a normal Debug configuration (no sanitizers &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;--&lt;/del&gt;- they conflict with Valgrind&amp;#039;s instrumentation). From inside your Docker container, run &amp;lt;code&amp;gt;valgrind --leak-check=full --show-leakkinds=all --track-origins=yes ./your_test_binary&amp;lt;/code&amp;gt;. Save the full output. If Valgrind reports any errors that ASan did not, fix them. Add a paragraph to your MR description noting which tool caught what, or that the two agreed completely.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Run Valgrind once, manually.&amp;#039;&amp;#039;&amp;#039; Build your project in a normal Debug configuration (no sanitizers - they conflict with Valgrind&amp;#039;s instrumentation). From inside your Docker container, run &amp;lt;code&amp;gt;valgrind --leak-check=full --show-leakkinds=all --track-origins=yes ./your_test_binary&amp;lt;/code&amp;gt;. Save the full output. If Valgrind reports any errors that ASan did not, fix them. Add a paragraph to your MR description noting which tool caught what, or that the two agreed completely.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Re-check coverage.&amp;#039;&amp;#039;&amp;#039; Recall from Week 4: &amp;lt;code&amp;gt;gcovr -r .. --html-details&amp;lt;/code&amp;gt; against a coverage-instrumented build. Generate a current coverage report. Compare against your Week 4 baseline. If coverage dropped, write enough additional tests to bring it back. Coverage gaps are places where sanitizer findings are silently impossible, so this is part of the dynamic-analysis story even if the tool is the same one you used in Week 4.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# &amp;#039;&amp;#039;&amp;#039;Re-check coverage.&amp;#039;&amp;#039;&amp;#039; Recall from Week 4: &amp;lt;code&amp;gt;gcovr -r .. --html-details&amp;lt;/code&amp;gt; against a coverage-instrumented build. Generate a current coverage report. Compare against your Week 4 baseline. If coverage dropped, write enough additional tests to bring it back. Coverage gaps are places where sanitizer findings are silently impossible, so this is part of the dynamic-analysis story even if the tool is the same one you used in Week 4.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l87&quot; &gt;Linia 87:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 87:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;#039;&amp;#039;&amp;#039;ASan says &amp;quot;AddressSanitizer: DEADLYSIGNAL&amp;quot; with no obvious cause.&amp;#039;&amp;#039;&amp;#039; Your program received a fatal signal (often SIGSEGV) inside ASan&amp;#039;s own instrumentation. This usually means very serious memory corruption or stack overflow. Use &amp;lt;code&amp;gt;ASAN_OPTIONS=abort_on_error=1&amp;lt;/code&amp;gt; to get a core dump and a clearer backtrace.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;#039;&amp;#039;&amp;#039;ASan says &amp;quot;AddressSanitizer: DEADLYSIGNAL&amp;quot; with no obvious cause.&amp;#039;&amp;#039;&amp;#039; Your program received a fatal signal (often SIGSEGV) inside ASan&amp;#039;s own instrumentation. This usually means very serious memory corruption or stack overflow. Use &amp;lt;code&amp;gt;ASAN_OPTIONS=abort_on_error=1&amp;lt;/code&amp;gt; to get a core dump and a clearer backtrace.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;#039;&amp;#039;&amp;#039;Some sanitizer findings disappear at &amp;lt;code&amp;gt;-O2&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-O3&amp;lt;/code&amp;gt;.&amp;#039;&amp;#039;&amp;#039; That is expected &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;--&lt;/del&gt;- the optimizer can eliminate the offending construct entirely. Keep your sanitizer build at &amp;lt;code&amp;gt;-O1&amp;lt;/code&amp;gt;: optimized enough to be realistic, unoptimized enough to keep reports trustworthy.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;#039;&amp;#039;&amp;#039;Some sanitizer findings disappear at &amp;lt;code&amp;gt;-O2&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-O3&amp;lt;/code&amp;gt;.&amp;#039;&amp;#039;&amp;#039; That is expected - the optimizer can eliminate the offending construct entirely. Keep your sanitizer build at &amp;lt;code&amp;gt;-O1&amp;lt;/code&amp;gt;: optimized enough to be realistic, unoptimized enough to keep reports trustworthy.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Looking ahead ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Looking ahead ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Next week: &amp;#039;&amp;#039;&amp;#039;Documentation as Code&amp;#039;&amp;#039;&amp;#039;. You will add a Doxygen build to your CMake, publish the generated HTML docs as a GitLab Pages artifact, and turn your scattered code comments into navigable API documentation. Bring a piece of your capstone code that is poorly documented and you want to improve.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Next week: &amp;#039;&amp;#039;&amp;#039;Documentation as Code&amp;#039;&amp;#039;&amp;#039;. You will add a Doxygen build to your CMake, publish the generated HTML docs as a GitLab Pages artifact, and turn your scattered code comments into navigable API documentation. Bring a piece of your capstone code that is poorly documented and you want to improve.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rhobincu</name></author>
	</entry>
	<entry>
		<id>http://wiki.dcae.pub.ro/index.php?title=SDPT_Lab_9&amp;diff=8344&amp;oldid=prev</id>
		<title>Rhobincu: Pagină nouă: = Week 9 Lab Activity: Dynamic Analysis with Sanitizers and Valgrind =  == Objective ==  Extend your Oven Controller&#039;s CI pipeline with a fourth quality gate: a &lt;code&gt;sanitize&lt;/cod...</title>
		<link rel="alternate" type="text/html" href="http://wiki.dcae.pub.ro/index.php?title=SDPT_Lab_9&amp;diff=8344&amp;oldid=prev"/>
		<updated>2026-05-11T13:33:13Z</updated>

		<summary type="html">&lt;p&gt;Pagină nouă: = Week 9 Lab Activity: Dynamic Analysis with Sanitizers and Valgrind =  == Objective ==  Extend your Oven Controller&amp;#039;s CI pipeline with a fourth quality gate: a &amp;lt;code&amp;gt;sanitize&amp;lt;/cod...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pagină nouă&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Week 9 Lab Activity: Dynamic Analysis with Sanitizers and Valgrind =&lt;br /&gt;
&lt;br /&gt;
== Objective ==&lt;br /&gt;
&lt;br /&gt;
Extend your Oven Controller&amp;#039;s CI pipeline with a fourth quality gate: a &amp;lt;code&amp;gt;sanitize&amp;lt;/code&amp;gt; stage that builds the project under AddressSanitizer and UndefinedBehaviorSanitizer and runs your full test suite against the instrumented binary. By the end of this lab, your pipeline catches a fourth class of bug --- runtime memory errors and undefined behavior --- automatically on every push.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
You will add a new CMake build type called &amp;lt;code&amp;gt;Sanitize&amp;lt;/code&amp;gt; that compiles with &amp;lt;code&amp;gt;-fsanitize=address,undefined&amp;lt;/code&amp;gt; alongside &amp;lt;code&amp;gt;-O1 -g -fno-omit-frame-pointer&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;-O1&amp;lt;/code&amp;gt; keeps the optimizer light enough that sanitizer reports stay readable; &amp;lt;code&amp;gt;-g&amp;lt;/code&amp;gt; embeds debug information so backtraces have line numbers; &amp;lt;code&amp;gt;-fno-omit-frame-pointer&amp;lt;/code&amp;gt; ensures those backtraces are actually complete on x86_64.&lt;br /&gt;
&lt;br /&gt;
The sanitizers report errors by printing to stderr and exiting with a nonzero status. This means your existing GoogleTest tests do not need any modification: if a test triggers a sanitizer error, the test binary aborts, ctest reports failure, the CI job fails, and the MR is blocked. The pipeline plumbing from Week 6 carries this work for you for free.&lt;br /&gt;
&lt;br /&gt;
In addition to the sanitizer build, you will run Valgrind manually once against the same codebase. The two tools are complementary: ASan is fast and runs in CI; Valgrind is slow but sometimes catches things ASan misses (notably uninitialized reads, which require MemorySanitizer to catch with sanitizers --- and you saw in the lecture why MSan is impractical).&lt;br /&gt;
&lt;br /&gt;
You will also reuse &amp;lt;code&amp;gt;gcovr&amp;lt;/code&amp;gt; from Week 4. Dynamic analysis can only find bugs on code paths your tests actually execute, so coverage is part of the deliverable.&lt;br /&gt;
&lt;br /&gt;
The point of this lab is not to introduce new tools you have never seen --- you have met all four (ASan/UBSan/Valgrind/gcovr) in lectures. The point is to wire them together into your existing pipeline and prove the wiring works by deliberately breaking things.&lt;br /&gt;
&lt;br /&gt;
Documentation pointers: &amp;lt;code&amp;gt;man valgrind&amp;lt;/code&amp;gt;, the AddressSanitizer wiki at https://github.com/google/sanitizers/wiki/AddressSanitizer, the UBSan documentation at https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html, and your existing gcovr docs.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
Work on a feature branch opened from a tracked Issue. Open a Merge Request when you are ready to integrate.&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Extend the Docker build environment.&amp;#039;&amp;#039;&amp;#039; Update your &amp;lt;code&amp;gt;Dockerfile&amp;lt;/code&amp;gt; to install &amp;lt;code&amp;gt;valgrind&amp;lt;/code&amp;gt; alongside the tools already present. Rebuild and verify with &amp;lt;code&amp;gt;valgrind --version&amp;lt;/code&amp;gt;. The sanitizers themselves ship with the compiler, so no separate package is needed --- but confirm by running &amp;lt;code&amp;gt;echo &amp;quot;int main(){}&amp;quot; | g++ -fsanitize=address -x c++ - -o /dev/null&amp;lt;/code&amp;gt; inside the container; if that succeeds, ASan is available.&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Add the Sanitize build type to CMake.&amp;#039;&amp;#039;&amp;#039; In your &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;, add logic that, when &amp;lt;code&amp;gt;CMAKE_BUILD_TYPE&amp;lt;/code&amp;gt; equals &amp;lt;code&amp;gt;Sanitize&amp;lt;/code&amp;gt;, sets compile and link options for &amp;lt;code&amp;gt;-fsanitize=address,undefined&amp;lt;/code&amp;gt; plus &amp;lt;code&amp;gt;-O1 -g -fno-omit-frame-pointer&amp;lt;/code&amp;gt;. Make sure both compile &amp;#039;&amp;#039;and&amp;#039;&amp;#039; link options include the sanitizer flag --- if you forget the link side, you will get cryptic linker errors about missing &amp;lt;code&amp;gt;__asan_*&amp;lt;/code&amp;gt; symbols. Test locally: &amp;lt;code&amp;gt;cmake -B build-san -DCMAKE_BUILD_TYPE=Sanitize&amp;lt;/code&amp;gt;, then build, then run a test binary directly to confirm it produces output that mentions ASan.&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Run your existing tests under the sanitizers and clean up.&amp;#039;&amp;#039;&amp;#039; Run &amp;lt;code&amp;gt;ctest --test-dir build-san --output-on-failure&amp;lt;/code&amp;gt;. If any tests fail due to sanitizer reports, fix the underlying bugs in the Oven Controller code (do &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; suppress them). Typical findings in EE-trained codebases: forgotten &amp;lt;code&amp;gt;delete[]&amp;lt;/code&amp;gt;, signed overflow in temperature math, reading from a member variable that was never initialized in a constructor. Each fix should be its own small commit with a message describing what the sanitizer reported.&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Add a sanitize stage to GitLab CI.&amp;#039;&amp;#039;&amp;#039; Edit &amp;lt;code&amp;gt;.gitlab-ci.yml&amp;lt;/code&amp;gt; to add a new &amp;lt;code&amp;gt;sanitize&amp;lt;/code&amp;gt; stage after &amp;lt;code&amp;gt;test&amp;lt;/code&amp;gt;. The job should: configure a &amp;lt;code&amp;gt;Sanitize&amp;lt;/code&amp;gt; build, compile it, and run &amp;lt;code&amp;gt;ctest&amp;lt;/code&amp;gt; against it. Use your existing Docker image. The job must fail the pipeline on any sanitizer error.&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Trigger ASan on purpose.&amp;#039;&amp;#039;&amp;#039; On your feature branch, introduce a deliberate &amp;#039;&amp;#039;&amp;#039;heap-buffer-overflow&amp;#039;&amp;#039;&amp;#039; bug somewhere in the production code. Push, watch the &amp;lt;code&amp;gt;sanitize&amp;lt;/code&amp;gt; stage fail, capture the ASan report (the job-log permalink in the MR description is sufficient), then revert. Your goal is to see the full ASan diagnostic --- the line with the offending access, the line of the allocation, and the &amp;quot;stack-buffer-overflow&amp;quot; or &amp;quot;heap-buffer-overflow&amp;quot; classification.&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Trigger UBSan on purpose.&amp;#039;&amp;#039;&amp;#039; Repeat with a deliberate &amp;#039;&amp;#039;&amp;#039;signed integer overflow&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;null pointer dereference&amp;#039;&amp;#039;&amp;#039;. The UBSan report looks different from ASan&amp;#039;s --- a one-line &amp;quot;runtime error&amp;quot; message at the trigger point. Capture, revert.&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Trigger LeakSanitizer on purpose.&amp;#039;&amp;#039;&amp;#039; Repeat with a deliberate memory leak (allocate something on the heap, do not free it). LeakSan reports at program exit, not at the leak site. Capture, revert.&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Run Valgrind once, manually.&amp;#039;&amp;#039;&amp;#039; Build your project in a normal Debug configuration (no sanitizers --- they conflict with Valgrind&amp;#039;s instrumentation). From inside your Docker container, run &amp;lt;code&amp;gt;valgrind --leak-check=full --show-leakkinds=all --track-origins=yes ./your_test_binary&amp;lt;/code&amp;gt;. Save the full output. If Valgrind reports any errors that ASan did not, fix them. Add a paragraph to your MR description noting which tool caught what, or that the two agreed completely.&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Re-check coverage.&amp;#039;&amp;#039;&amp;#039; Recall from Week 4: &amp;lt;code&amp;gt;gcovr -r .. --html-details&amp;lt;/code&amp;gt; against a coverage-instrumented build. Generate a current coverage report. Compare against your Week 4 baseline. If coverage dropped, write enough additional tests to bring it back. Coverage gaps are places where sanitizer findings are silently impossible, so this is part of the dynamic-analysis story even if the tool is the same one you used in Week 4.&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Document the cost.&amp;#039;&amp;#039;&amp;#039; Compare the wall-clock time of your full pipeline before and after this lab. The &amp;lt;code&amp;gt;sanitize&amp;lt;/code&amp;gt; stage adds work; document by how much in your MR description. As in Week 7, &amp;quot;the sanitize stage adds 6 minutes and we caught two real bugs&amp;quot; is a more honest finding than rounding to &amp;quot;negligible&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Review and merge.&amp;#039;&amp;#039;&amp;#039; Open the MR. The reviewer should check: the Sanitize build type works locally and in CI, that the three deliberate-bug pipeline runs are visible, that the Valgrind output is referenced in the MR, that coverage has not regressed.&lt;br /&gt;
&lt;br /&gt;
== Stretch tasks (optional, if you finish early) ==&lt;br /&gt;
&lt;br /&gt;
Pick at most one. None earn extra points; all teach you something useful.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Add a second sanitizer build.&amp;#039;&amp;#039;&amp;#039; Some teams maintain two CI jobs: one with ASan+UBSan, one with ThreadSanitizer. Add a TSan job that builds with &amp;lt;code&amp;gt;-fsanitize=thread&amp;lt;/code&amp;gt; and runs the tests. Even on single-threaded code this is harmless, and it sets you up for the day you add concurrency.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Valgrind in CI.&amp;#039;&amp;#039;&amp;#039; Add a manual-trigger CI job (using GitLab&amp;#039;s &amp;lt;code&amp;gt;when: manual&amp;lt;/code&amp;gt;) that runs Valgrind on your test binary. It is too slow to run on every push, but a one-click button for the weekly deep audit is valuable.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Coverage threshold gate.&amp;#039;&amp;#039;&amp;#039; Use &amp;lt;code&amp;gt;gcovr --fail-under-line N&amp;lt;/code&amp;gt; to fail the pipeline if line coverage drops below a threshold you choose (e.g. 80%). Now coverage is also an automatic quality gate, not just a number.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Sanitizer-specific environment variables.&amp;#039;&amp;#039;&amp;#039; Read the docs for &amp;lt;code&amp;gt;ASAN_OPTIONS&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;UBSAN_OPTIONS&amp;lt;/code&amp;gt;. Add &amp;lt;code&amp;gt;halt_on_error=1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;abort_on_error=1&amp;lt;/code&amp;gt; to your CI environment, which makes the first error a hard stop instead of letting the program limp on. Useful for getting clearer reports.&lt;br /&gt;
&lt;br /&gt;
== Deliverables ==&lt;br /&gt;
&lt;br /&gt;
For this lab to be marked complete, your &amp;lt;code&amp;gt;main&amp;lt;/code&amp;gt; branch must contain:&lt;br /&gt;
&lt;br /&gt;
# A &amp;lt;code&amp;gt;Dockerfile&amp;lt;/code&amp;gt; that installs &amp;lt;code&amp;gt;valgrind&amp;lt;/code&amp;gt; in addition to the previous week&amp;#039;s tooling.&lt;br /&gt;
# A &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt; with a working &amp;lt;code&amp;gt;Sanitize&amp;lt;/code&amp;gt; build type.&lt;br /&gt;
# A &amp;lt;code&amp;gt;.gitlab-ci.yml&amp;lt;/code&amp;gt; with a &amp;lt;code&amp;gt;sanitize&amp;lt;/code&amp;gt; stage running after the &amp;lt;code&amp;gt;test&amp;lt;/code&amp;gt; stage.&lt;br /&gt;
# A merged Merge Request whose linked Issue (or MR description) contains:&lt;br /&gt;
## References to &amp;#039;&amp;#039;&amp;#039;three&amp;#039;&amp;#039;&amp;#039; failed pipeline runs from Tasks 5, 6, and 7 (one each for ASan, UBSan, and LeakSan), with the relevant snippet of each sanitizer&amp;#039;s report quoted briefly.&lt;br /&gt;
## The Valgrind output from Task 8, or a permalink to it (a job artifact or a gist).&lt;br /&gt;
## A note comparing Valgrind&amp;#039;s findings with the sanitizers&amp;#039; findings (Task 8).&lt;br /&gt;
## The coverage comparison from Task 9 (before/after, plus what you did about it).&lt;br /&gt;
## The pipeline cost comparison from Task 10.&lt;br /&gt;
&lt;br /&gt;
== Common pitfalls ==&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Linker errors mentioning &amp;lt;code&amp;gt;__asan_*&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;__ubsan_*&amp;lt;/code&amp;gt; symbols.&amp;#039;&amp;#039;&amp;#039; You set the sanitizer flag for compilation but forgot to also pass it at the link step. In CMake, both &amp;lt;code&amp;gt;add_compile_options&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;add_link_options&amp;lt;/code&amp;gt; need &amp;lt;code&amp;gt;-fsanitize=...&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Sanitizers and Valgrind conflict.&amp;#039;&amp;#039;&amp;#039; You cannot run a sanitizer-built binary under Valgrind. They both rely on intercepting memory accesses and the interception clashes. Build a separate Debug binary (no sanitizers) when you want to run Valgrind.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ASan reports look truncated or have &amp;lt;code&amp;gt;??&amp;lt;/code&amp;gt; in the backtrace.&amp;#039;&amp;#039;&amp;#039; Almost always means missing &amp;lt;code&amp;gt;-g&amp;lt;/code&amp;gt; or missing &amp;lt;code&amp;gt;-fno-omit-frame-pointer&amp;lt;/code&amp;gt;. Without frame pointers, the unwinder on x86_64 falls back to imperfect heuristics.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;The pipeline passes locally but ASan errors only appear in CI.&amp;#039;&amp;#039;&amp;#039; Check that your container image is using a recent enough compiler. GCC&amp;#039;s ASan got significantly better between 8.x and 11.x; UBSan added several checks in the same span. The Debian Bookworm &amp;lt;code&amp;gt;g++&amp;lt;/code&amp;gt; (12.x) is fine.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Tests pass under the sanitizers locally, but a teammate&amp;#039;s machine shows different errors.&amp;#039;&amp;#039;&amp;#039; ASan and UBSan are deterministic for a given binary, but slight platform differences (libc version, glibc malloc settings) can occasionally surface bugs that are real but only fire on one machine. The CI container is the source of truth.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Valgrind reports complaints in the standard library.&amp;#039;&amp;#039;&amp;#039; Usually you can ignore these unless they reference your own code. Use &amp;lt;code&amp;gt;--suppressions=/usr/share/valgrind/default.supp&amp;lt;/code&amp;gt; (most distributions ship a default suppression file) to filter out the well-known libc and libstdc++ noise.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ASan says &amp;quot;AddressSanitizer: DEADLYSIGNAL&amp;quot; with no obvious cause.&amp;#039;&amp;#039;&amp;#039; Your program received a fatal signal (often SIGSEGV) inside ASan&amp;#039;s own instrumentation. This usually means very serious memory corruption or stack overflow. Use &amp;lt;code&amp;gt;ASAN_OPTIONS=abort_on_error=1&amp;lt;/code&amp;gt; to get a core dump and a clearer backtrace.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Some sanitizer findings disappear at &amp;lt;code&amp;gt;-O2&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-O3&amp;lt;/code&amp;gt;.&amp;#039;&amp;#039;&amp;#039; That is expected --- the optimizer can eliminate the offending construct entirely. Keep your sanitizer build at &amp;lt;code&amp;gt;-O1&amp;lt;/code&amp;gt;: optimized enough to be realistic, unoptimized enough to keep reports trustworthy.&lt;br /&gt;
&lt;br /&gt;
== Looking ahead ==&lt;br /&gt;
&lt;br /&gt;
Next week: &amp;#039;&amp;#039;&amp;#039;Documentation as Code&amp;#039;&amp;#039;&amp;#039;. You will add a Doxygen build to your CMake, publish the generated HTML docs as a GitLab Pages artifact, and turn your scattered code comments into navigable API documentation. Bring a piece of your capstone code that is poorly documented and you want to improve.&lt;/div&gt;</summary>
		<author><name>Rhobincu</name></author>
	</entry>
</feed>