-
Notifications
You must be signed in to change notification settings - Fork 55
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
Fix errors from incorrect QImage memory management. #546
Conversation
This should stop the sporadic test failures caused by referencing memory which has been freed and used by something else. The fix is to attach the numpy array with the allocated memory to the QImage, so that the lifetime of the array is at least as long as that of the QImage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One way I found to consistently reproduce the error is to save the qimage
to file multiple times (at least 3) in the failing test. With this I was able to get the test to fail even when running on its own. It might not be the most reliable test but it might be good enough to test for regression.
Anyways, I can confirm that the fix works and my locally modified test no longer fails.
(Closed and re-opened to retrigger CI; on the previous CI run, the Travis CI job completed successfully but didn't report back to GitHub.) |
Codecov Report
@@ Coverage Diff @@
## master #546 +/- ##
==========================================
+ Coverage 36.99% 37.60% +0.61%
==========================================
Files 470 470
Lines 26027 26364 +337
Branches 3961 4029 +68
==========================================
+ Hits 9629 9915 +286
- Misses 15977 16022 +45
- Partials 421 427 +6
Continue to review full report at Codecov.
|
This should stop the sporadic test failures caused by referencing memory which has been freed and used by something else. The fix is to attach the numpy array with the allocated memory to the QImage, so that the lifetime of the array is at least as long as that of the QImage.
* Fix errors from incorrect QImage memory management. (#546) This should stop the sporadic test failures caused by referencing memory which has been freed and used by something else. The fix is to attach the numpy array with the allocated memory to the QImage, so that the lifetime of the array is at least as long as that of the QImage. * Fix dock pane layout (#545) * Provide sizeHint to QWidget * REF : Restore qt4 conditional branch modified: pyface/ui/qt4/tasks/main_window_layout.py * TST: Test Qt dock widget has the correct size (#552) Co-authored-by: Sai Rahul Poruri <rporuri@enthought.com> Co-authored-by: Kit Choi <kitchoi@users.noreply.github.com> * Update Changelog for 7.0.1 * Remove master only setting on Travis and Appveyor which prevent bug fix release PR from building * Update .travis.yml for Qt (#529) * Update .travis.yml to include libglu1-mesa-dev for Qt * Restore libxkbcommon-x11 and move other dependencies up * Fix package name for libsdl * Add a debug flag * Add libxcb-iccm4 * Continue the same exercise for pyside2, add libxcb-image * Giving up - let's use the same packages * Add libxml2 for osx image * Use brew manually See https://travis-ci.community/t/macos-build-fails-because-of-homebrew-bundle-unknown-command/7296/28 * Try a newer osx image * Add a comment * Is libdbus still needed? * Remove debugging flag - it is noisy and is embedded in between tests * Update install command for installing wx to match master (this is equivalent to a merge of a couple of PRs Co-authored-by: Corran Webster <cwebster@enthought.com> Co-authored-by: Pedro Rivotti <44579232+pedrorivotti@users.noreply.github.com> Co-authored-by: Sai Rahul Poruri <rporuri@enthought.com>
This should stop the sporadic test failures caused by referencing memory which has been freed and used by something else. The fix is to attach the numpy array with the allocated memory to the QImage, so that the lifetime of the array is at least as long as that of the QImage.
Fixes #517