Skip to content

Something fishy in png reading #5495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mdboom opened this issue Nov 16, 2015 · 8 comments
Closed

Something fishy in png reading #5495

mdboom opened this issue Nov 16, 2015 · 8 comments
Assignees

Comments

@mdboom
Copy link
Member

mdboom commented Nov 16, 2015

We're seeing spurious test failures like:

======================================================================
ERROR: matplotlib.tests.test_cycles.test_marker_cycle.test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/matplotlib/matplotlib/venv/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/build/matplotlib/matplotlib/venv/lib/python2.7/site-packages/matplotlib-1.5.0+34.g43afdd8-py2.7-linux-x86_64.egg/matplotlib/testing/decorators.py", line 53, in failer
    result = f(*args, **kwargs)
  File "/home/travis/build/matplotlib/matplotlib/venv/lib/python2.7/site-packages/matplotlib-1.5.0+34.g43afdd8-py2.7-linux-x86_64.egg/matplotlib/testing/decorators.py", line 210, in do_test
    self._tol, in_decorator=True)
  File "/home/travis/build/matplotlib/matplotlib/venv/lib/python2.7/site-packages/matplotlib-1.5.0+34.g43afdd8-py2.7-linux-x86_64.egg/matplotlib/testing/compare.py", line 314, in compare_images
    actualImage = _png.read_png_int(actual)
RuntimeError: Error setting jump

and

======================================================================
ERROR: matplotlib.tests.test_cycles.test_marker_cycle.test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/matplotlib/matplotlib/venv/lib/python3.4/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/home/travis/build/matplotlib/matplotlib/venv/lib/python3.4/site-packages/matplotlib-1.5.0+34.g43afdd8-py3.4-linux-x86_64.egg/matplotlib/testing/decorators.py", line 53, in failer
    result = f(*args, **kwargs)
  File "/home/travis/build/matplotlib/matplotlib/venv/lib/python3.4/site-packages/matplotlib-1.5.0+34.g43afdd8-py3.4-linux-x86_64.egg/matplotlib/testing/decorators.py", line 210, in do_test
    self._tol, in_decorator=True)
  File "/home/travis/build/matplotlib/matplotlib/venv/lib/python3.4/site-packages/matplotlib-1.5.0+34.g43afdd8-py3.4-linux-x86_64.egg/matplotlib/testing/compare.py", line 314, in compare_images
    actualImage = _png.read_png_int(actual)
SystemError: error return without exception set

While there were recent changes to PNG writing, there haven't been recent changes to PNG reading, so I'm not sure what's up. But probably shouldn't let this slide...

@tacaswell
Copy link
Member

Digging into this a bit, there is one goto exit in _read_png which does not explicitly set an exception before hitting the goto (https://github.com/matplotlib/matplotlib/blob/master/src/_png.cpp#L368) This was last touched in
ba40160 . I have no guess as to why this is showing up intermittently now though. Maybe travis has changed their infrastructure and we are hitting a weird race/edge case on opening files?

@mdboom
Copy link
Member Author

mdboom commented Nov 19, 2015

Digging into this a bit, there is one goto exit in _read_png which does not explicitly set an exception before hitting the goto (https://github.com/matplotlib/matplotlib/blob/master/src/_png.cpp#L368)

I think this is fine actually. The exception is set inside mpl_PyFile_OpenFile (indirectly in PyDict_GetItemString).

I feel this is somehow related to file handling, just not sure what yet.

@smheidrich
Copy link
Contributor

For the record, #5515 didn't fix it: https://travis-ci.org/matplotlib/matplotlib/jobs/94019696

@WeatherGod
Copy link
Member

It is important to note that what I haven't seen lately is that we are now
seeing useful exception messages when something goes wrong with reading
images. We are seeing a wider variety of errors now when before it was a
single, generic error message. I suspect the issue might be with whatever
the underlying filesystem is on any particular docker instance.

On Mon, Nov 30, 2015 at 6:08 PM, productivememberofsociety666 <
notifications@github.com> wrote:

For the record, #5515 #5515
didn't fix it: https://travis-ci.org/matplotlib/matplotlib/jobs/94019696


Reply to this email directly or view it on GitHub
#5495 (comment)
.

@jenshnielsen
Copy link
Member

I suspect that most of these issues are related to the nose multiprocessing. If someone sees any of this happen with the 3.5 job, which no longer runs multiprocessing to get correct coverage, please put a reference in here since that would disconfirm my theory

@tacaswell
Copy link
Member

I am getting these failures locally as well now.

@mdboom
Copy link
Member Author

mdboom commented Dec 1, 2015

That's promising, I guess. For whatever reason, I've never seen them locally...

@tacaswell
Copy link
Member

Also getting these locally

======================================================================
FAIL: matplotlib.tests.test_backend_ps.test_savefig_to_stringio_with_usetex_eps
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tcaswell/source/other_source/nose/build/lib/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/home/tcaswell/source/my_source/matplotlib/lib/matplotlib/testing/decorators.py", line 138, in wrapped_function
    func(*args, **kwargs)
  File "/home/tcaswell/source/my_source/matplotlib/lib/matplotlib/testing/decorators.py", line 54, in failer
    result = f(*args, **kwargs)
  File "/home/tcaswell/source/my_source/matplotlib/lib/matplotlib/tests/test_backend_ps.py", line 96, in test_savefig_to_stringio_with_usetex_eps
    _test_savefig_to_stringio(format='eps')
  File "/home/tcaswell/source/my_source/matplotlib/lib/matplotlib/tests/test_backend_ps.py", line 54, in _test_savefig_to_stringio
    assert values[0] == values[1]
AssertionError

@mdboom mdboom self-assigned this Dec 10, 2015
@mdboom mdboom closed this as completed in 1c14132 Dec 11, 2015
jenshnielsen added a commit that referenced this issue Dec 11, 2015
Fix #5495.  Combine two tests to prevent race cond
jenshnielsen added a commit that referenced this issue Dec 11, 2015
Fix #5495.  Combine two tests to prevent race cond
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants