Skip to content
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

Add test to make sure into_raw_pixels doesn't crash. #160

Closed
wants to merge 1 commit into from

Conversation

xStrom
Copy link
Member

@xStrom xStrom commented Apr 8, 2020

The provided into_raw_pixels test crashes when calling the system d2d EndDraw funtion. This doesn't seem like desired behavior. If this test does something invalid, I think a Rust panic would be better and if this test should work then we have a bug.

Found this issue while investigating druid#784

Copy link
Contributor

@raphlinus raphlinus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The underlying cause is pilot error - the crash is actually because of a missing piet.finish(). When that's added, the test passes.

That's not to say there's no bug though. There's a C++ exception (UB) from ostensibly safe code. We should either silently add a finish call (the impl is idempotent, though the spec doesn't require it) or detect the condition and panic safely.

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

Successfully merging this pull request may close these issues.

2 participants