You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove zig_backend check in tests/image_test.zig line 350-352, test "Test Colorf32 iterator". There is another similar test skipped as well in tests/octree_quantizer_test.zig line 34-36
Do zig build test to run the test-suite
Expected Behavior
All the tests should pass.
Actual Behavior
Test [101/106] test.Test Colorf32 iterator... thread 23952 panic: switch on corrupt value
C:\Programmation\Zig\zigimg\zigimg\src\color.zig:809:66: 0x7ff7a6c6484b in next (zigimgtest.exe.obj)
.rgba64 => |data| data[self.current_index].toColorf32(),
^
C:\Programmation\Zig\zigimg\zigimg\tests\image_test.zig:373:19: 0x7ff7a6c64468 in test.Test Colorf32 iterator (zigimgtest.exe.obj)
while (it.next()) |actual| {
^
C:\Programmation\Zig\zig\stage3\lib\zig\test_runner.zig:79:28: 0x7ff7a6c2165a in main (zigimgtest.exe.obj)
} else test_fn.func();
^
C:\Programmation\Zig\zig\stage3\lib\zig\std\start.zig:347:41: 0x7ff7a6c21277 in WinStartup (zigimgtest.exe.obj)
std.debug.maybeEnableSegfaultHandler();
Something is corrupting the color iterator and the test fails. While looking at disassembly I found something weird (copied by hand from VS Code disassembly view)
374: const expected = expectedColors[i];
lea rcx, [rbp+200h]
lea rdx, [rbp+0B0h]
mov r8d, 80h # This is the weird part, why it is trying to copy 128 bytes for a 16 bytes struct?
call memcpy
Contact BaroqueLarouche on zig Discord if you need any assistance with the setup. Thanks :) le
The text was updated successfully, but these errors were encountered:
mlarouche
added
the
bug
Observed behavior contradicts documented or intended behavior
label
Aug 27, 2022
If Image is passed by copy, I am taking a pointer to a temporary value. Before on stage1, Image was passed by *const pointer behind the scene and never caused an issue.
Note that the snippet is indeed a bug because while zig is supposed to make choices according to perf, it is technically allowed to pass the arg either way. So passing as *const Image is not only a workaround, but a bug fix in zigimg:
Uh oh!
There was an error while loading. Please reload this page.
Zig Version
0.10.0-dev.3757+ae8d26a6a
Steps to Reproduce
git clone https://github.com/zigimg/zigimg zigimg
git clone https://github.com/zigimg/test-suite test-suite
cd zigimg
git checkout stage2_compat
zig_backend
check intests/image_test.zig
line 350-352,test "Test Colorf32 iterator"
. There is another similar test skipped as well intests/octree_quantizer_test.zig
line 34-36zig build test
to run the test-suiteExpected Behavior
All the tests should pass.
Actual Behavior
Something is corrupting the color iterator and the test fails. While looking at disassembly I found something weird (copied by hand from VS Code disassembly view)
Contact
BaroqueLarouche
on zig Discord if you need any assistance with the setup. Thanks :) leThe text was updated successfully, but these errors were encountered: