PNG output is sometimes blank

Bug #1740505 reported by Robie Basak
8
This bug affects 1 person
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-2+dfsg-2ubuntu1 and all my packages are up to date (2017-12-24).

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://bugs.debian.org/cgi-bin/bugreport.cgi?bug=885589 to track this separately.

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_tessellation-text-test (Failed)
 470 - opencsgtest_issue1165 (Failed)
 473 - opencsgtest_issue1215 (Failed)
 605 - csgpngtest_tessellation-text-test (Failed)
 777 - throwntogethertest_issue1215 (Failed)
 915 - openscad-camtrans-viewall_camera-tests (Failed)
 917 - openscad-camortho-viewall_camera-tests (Failed)

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_text-font-alignment-tests (Failed)
 217 - cgalpngtest_text-font-composition (Failed)
 218 - cgalpngtest_text-font-direction-tests (Failed)
 219 - cgalpngtest_text-font-simple-tests (Failed)
 284 - cgalpngtest_polyhedron-nonplanar-tests (Failed)
 297 - cgalpngtest_tessellation-text-test (Failed)
 470 - opencsgtest_issue1165 (Failed)
 473 - opencsgtest_issue1215 (Failed)
 524 - csgpngtest_text-font-alignment-tests (Failed)
 525 - csgpngtest_text-font-composition (Failed)
 526 - csgpngtest_text-font-direction-tests (Failed)
 527 - csgpngtest_text-font-simple-tests (Failed)
 528 - csgpngtest_text-font-symbol (Failed)
 529 - csgpngtest_text-font-tests (Failed)
 592 - csgpngtest_polyhedron-nonplanar-tests (Failed)
 605 - csgpngtest_tessellation-text-test (Failed)
 777 - throwntogethertest_issue1215 (Failed)
 811 - monotonepngtest_polyhedron-nonplanar-tests (Failed)
 834 - cgalstlcgalpngtest_polyhedron-nonplanar-tests (Failed)
 870 - dxfpngtest_text-font-alignment-tests (Failed)
 871 - dxfpngtest_text-font-composition (Failed)
 872 - dxfpngtest_text-font-direction-tests (Failed)
 873 - dxfpngtest_text-font-simple-tests (Failed)
 915 - openscad-camtrans-viewall_camera-tests (Failed)
 917 - openscad-camortho-viewall_camera-tests (Failed)

I've submitted a dep8 test to run Test Case B to Debian in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=885429 and cherry picked this into Ubuntu. The test is still expected to fail due to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=885589 but since the results are still helpful to other bugs, having the tests run with history available should be useful. It will need to be force-badtested into the release pocket.

[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.

Robie Basak (racb)
Changed in openscad (Ubuntu):
status: New → Invalid
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

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/PerformingSRUVerification . Thank you in advance!

Changed in openscad (Ubuntu Artful):
status: New → Fix Committed
tags: added: verification-needed verification-needed-artful
Revision history for this message
Robie Basak (racb) wrote :

Version 2015.03-2+dfsg-2ubuntu1.17.10.1 from artful-proposed of openscad, openscad-testing and openscad-testing-data appears to have this bug fixed, based on both test cases A and B from the bug description, as expected. A manual smoke test also looks good.

The dep8 test I added in the Artful upload also had the expected reduced set of failures. Instead of 8, I got 22 failures in infrastructure, but testing locally I only get the 8 failures I expected. I suspect this is due to a difference in test environment and the failures are not related to this SRU.

Details below:

sudo apt install openscad{,-testing,-testing-data}=2015.03-2+dfsg-2ubuntu1

Test Case A:

Reproduced. 1947 bytes "background" PNG within a couple of iterations.

Test Case B:

Reproduced: 347 tests failed out of 929.

sudo apt install openscad{,-testing,-testing-data}=2015.03-2+dfsg-2ubuntu1.17.10.1

Test Case A:

Does not reproduce after 1000 iterations, so appears fixed.

Test Case B:

Only 8 tests failed out of 929, as expected, so appears fixed.

GUI smoke test:

Loads one of my openscad models, renders correctly, exports to STL, and my slicer reads and renders the STL as expected.

tags: added: verification-done verification-done-artful
removed: verification-needed verification-needed-artful
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openscad - 2015.03-2+dfsg-2ubuntu1.17.10.1

---------------
openscad (2015.03-2+dfsg-2ubuntu1.17.10.1) artful; urgency=medium

  * "No change" rebuild to fix blank PNG output (LP: #1740505).
  * Add dep8 test.

 -- Robie Basak <email address hidden> Fri, 29 Dec 2017 14:29:43 +0000

Changed in openscad (Ubuntu Artful):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for openscad has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.