Repository navigation
ImageCloneTests.CloneAs_ToBgr24() failing sporadically #576
Description
Activity
- added a commit that references this issue
on May 15, 2018 i have noticed, that this seems to happen only on linux (at least i have not seen this on windows yet). Also only in Release mode. Never seen this in Debug mode so far.
Weird thing is really that it only happens occasionally, not always. So i was expecting some kind of race condition, because the tests are run in parallel, but changing the xunit config to:
"maxParallelThreads": 1, "parallelizeAssembly": false, "parallelizeTestCollections": falseand its still happens some times
Reacted by Anton FirszovEven running only the test CloneAs_ToBgr24 produces the error. I still suspect some race condition, because of parallel execution, but its not because other tests are running at the same time.
I have noticed, that when it fails, its every time the value in the B channel which is wrong.
I suspect the ParallelFor in CloneAs is causing this, but i could not pinpoint exactly where the error is. Setting the ParallelOptions.MaxDegreeOfParallelism to 1 reliable makes the test run successfully.
What i do not get is why this is not happening to CloneAs_ToRgb24. It uses the same CloneAs method.
Reacted by Anton Firszov- added a commit that references this issue
on May 23, 2018 i do not think anymore there is an issue in ParallelFor. I think it has to do with memory alignment of the bgr24 struct. If i change it to explicit and field offsets 0, 1, 2 accordingly to b, g , r, this issue does not happen anymore.
I am not sure why LayoutKind.Sequential produces a different result than this explicit one.
Reacted by Anton Firszov and James Jackson-South@brianpopow should be a CLR code generation bug again. Thanks for figuring this out!
@brianpopow Good work! We should double check our other blittable types.
Rgba32Rgb24,Bgr24, andArgb32.- added a commit that references this issue
on May 23, 2018 i have opened a PR for this: #591
I have changed rgb24 also, because it may also be affected by this.
Im not sure if Rgba32 and Argb32 can be affected by this.
Reacted by James Jackson-SouthOk, let's leave it at that, no point changing working code.
I've just updated your PR from master, will merge once it's built.
Reacted by Brian Popow- added a commit that references this issue
on May 24, 2018 It pretty much looks like this is fixed with #591.
Prerequisites
DEBUGandRELEASEmodeDescription
Decided to open an issue before skipping
ImageCloneTests.CloneAs_ToBgr24()in #571, because it might indicate a bug.Steps to Reproduce
Unskip & run
CloneAs_ToBgr24()on Travis. It will fail in 30%-50% of the executions. Sometimes it also fails locally for me.