PNG output is sometimes blank
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openscad (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Artful |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Description]
When I use the OpenSCAD CLI to create a PNG view of a design, sometimes the PNG ends up blank. This appears to be non-deterministic. Sometimes the output PNG appears correct; sometimes it appears to be a valid PNG but is blank.
I'm running Ubuntu Artful with openscad 2015.03-
I'm mostly using defaults, so GNOME on Wayland. This may matter since openscad connects to X11 even when in batch mode the CLI. I haven't yet been able to get Xvfb working for my problem case (Test Case A below), but it shouldn't matter for this bug. In any case, it matters that this won't work on a default Ubuntu system.
[Impact]
OpenSCAD can't reliably be used in scripting or other automation.
[Test Case A]
apt install openscad
echo "cube();" > test.scad
for i in `seq 1 1000`; do echo $i; openscad -o test.png test.scad; size=`stat -c%s test.png`; [ $size -lt 3635 ] && break; done
Expected results: runs to completion (1000 attempts).
Actual results: terminates early; test.png is smaller (1947 bytes) and appears to be a valid PNG file but with only background pixels.
Note: on my Artful system, the correct output PNG for the above test is 3635 bytes, and I rely on that in my reproduction steps above. It may be the case that others' correct output PNG sizes are different depending on unrelated environmental factors. In this case, please tweak the figure above to reproduce the problem. Fundamentally the issue is that the PNG sometimes turns out "blank" in a not obviously deterministic way. Repeating the openscad call above multiple times should demonstrate the problem if the output PNGs aren't always identical.
[Test Case B]
apt install openscad-testing
openscad-testrun --virtual
Expected results: all pass
Actual results: "Errors while running CTest"
Note: even with this bug fixed, not all tests in this test suite pass. Even more tests fail in sid currently. I have filed https:/
Without this bug fixed in Artful, a large number of tests fail, but this appears to be non-deterministic. For example, on one attempt 344 failed, and on another run 321 failed.
With this bug fixed in Artful, only 8 tests fail:
The following tests FAILED:
17 - echotest_rands (Failed)
297 - cgalpngtest_
470 - opencsgtest_
473 - opencsgtest_
605 - csgpngtest_
777 - throwntogethert
915 - openscad-
917 - openscad-
The results are the same regardless of whether the test runs against my GNOME Wayland session or if I use --virtual so it uses Xvfb.
I have incorporated this Test Case B into a dep8 test.
[Stable Fix]
A no change rebuild fixes the problem. Test Case B becomes deterministic and the number of failed tests reduces to 8.
I've also cherry-picked the dep8 test added in the development release to help inform SRU verification. This is expected to still fail when this bug is fixed, but with only 8 test failures instead of 300+.
[Development Fix]
The package has already been rebuilt in Bionic. The bug (Test Case A) does not reproduce on Bionic, so no fix is needed. The test suite (Test Case B) fails, but this also happens on a rebuild and appears to be unrelated. The number of individual test failures in Test Case B is larger than what I see with the bug fixed in Artful, but appears to be deterministic and thus I believe unrelated:
The following tests FAILED:
17 - echotest_rands (Failed)
216 - cgalpngtest_
217 - cgalpngtest_
218 - cgalpngtest_
219 - cgalpngtest_
284 - cgalpngtest_
297 - cgalpngtest_
470 - opencsgtest_
473 - opencsgtest_
524 - csgpngtest_
525 - csgpngtest_
526 - csgpngtest_
527 - csgpngtest_
528 - csgpngtest_
529 - csgpngtest_
592 - csgpngtest_
605 - csgpngtest_
777 - throwntogethert
811 - monotonepngtest
834 - cgalstlcgalpngt
870 - dxfpngtest_
871 - dxfpngtest_
872 - dxfpngtest_
873 - dxfpngtest_
915 - openscad-
917 - openscad-
I've submitted a dep8 test to run Test Case B to Debian in https:/
[Regression Potential]
Unfortunately there isn't any specific area on which we can focus testing. It isn't clear what caused the regression, since tests did pass at the time the package was built.
In mitigation, there is a comprehensive test suite whose results are objectively better in the rebuild. So it appears to be reliable in helping us ensure that the rebuild doesn't create a new regression for those areas tested.
For SRU verification, we should at a minimum run both reproduction steps above, which should ensure that the SRU build is demonstrably better than the current situation, and check that Test Case B is deterministic again.
I think a smoke test by running the GUI by hand would also be wise.
Changed in openscad (Ubuntu): | |
status: | New → Invalid |
Hello Robie, or anyone else affected,
Accepted openscad into artful-proposed. The package will build now and be available at https:/ /launchpad. net/ubuntu/ +source/ openscad/ 2015.03- 2+dfsg- 2ubuntu1. 17.10.1 in a few hours, and then in the -proposed repository.
Please help us by testing this new package. See https:/ /wiki.ubuntu. com/Testing/ EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification- needed- artful to verification- done-artful. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification- failed- artful. In either case, without details of your testing we will not be able to proceed.
Further information regarding the verification process can be found at https:/ /wiki.ubuntu. com/QATeam/ PerformingSRUVe rification . Thank you in advance!