Commit a9531cb
committed
io_uring(tests): Fix 1/N valgrind reports
This commit is the first patch for fixing errors reported by valgrind
in the `IoUring.zig` tests. This commit addresses the following:
```
7/41 IoUring.test.write_fixed/read_fixed...==47580== Conditional jump or move depends on uninitialised value(s)
==47580== at 0x112089D: testing.expectEqualSlices__anon_24471 (testing.zig:365)
==47580== by 0x1133491: IoUring.test.write_fixed/read_fixed (IoUring.zig:2224)
==47580== by 0x11B320A: test_runner.mainTerminal (test_runner.zig:248)
==47580== by 0x11AE5DE: test_runner.main (test_runner.zig:71)
==47580== by 0x11ADE18: callMain (start.zig:705)
==47580== by 0x11ADE18: callMainWithArgs (start.zig:674)
==47580== by 0x11ADE18: main (start.zig:689)
==47580==
==47580== Conditional jump or move depends on uninitialised value(s)
==47580== at 0x112089D: testing.expectEqualSlices__anon_24471 (testing.zig:365)
==47580== by 0x113353C: IoUring.test.write_fixed/read_fixed (IoUring.zig:2225)
==47580== by 0x11B320A: test_runner.mainTerminal (test_runner.zig:248)
==47580== by 0x11AE5DE: test_runner.main (test_runner.zig:71)
==47580== by 0x11ADE18: callMain (start.zig:705)
==47580== by 0x11ADE18: callMainWithArgs (start.zig:674)
==47580== by 0x11ADE18: main (start.zig:689)
==47580==
==47580== Conditional jump or move depends on uninitialised value(s)
==47580== at 0x112089D: testing.expectEqualSlices__anon_24471 (testing.zig:365)
==47580== by 0x11335E7: IoUring.test.write_fixed/read_fixed (IoUring.zig:2226)
==47580== by 0x11B320A: test_runner.mainTerminal (test_runner.zig:248)
==47580== by 0x11AE5DE: test_runner.main (test_runner.zig:71)
==47580== by 0x11ADE18: callMain (start.zig:705)
==47580== by 0x11ADE18: callMainWithArgs (start.zig:674)
==47580== by 0x11ADE18: main (start.zig:689)
==47580==
```
The memory for the buffer[1] is never explicitly initialized, hence
valgrind's report.
I opted to simply initialize the memory to a default value of 0. Happy
to discuss a different approach if preferred.1 parent a9568ed commit a9531cb
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2181 | 2181 | | |
2182 | 2182 | | |
2183 | 2183 | | |
| 2184 | + | |
2184 | 2185 | | |
2185 | 2186 | | |
2186 | 2187 | | |
| |||
0 commit comments