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
crash when resizing window #94
Comments
Hi. Yeah so I will start looking at these issues soon. I just been busy at doing other things so I haven't come around to do it. The reason why I haven't started yet is that I'm going to do some upfront work to prepare the windows backend for GPU support also. This comes in line with #93 as this has been requested in various places and requires work on all backends. So right now I just haven't figured out exactly how I want to do all of that work yet. |
Absolutely no worries at all. I appreciate the library. I just wanted a simple bitmap to screen library and behold there it was.
…________________________________
From: Daniel Collin <notifications@github.com>
Sent: Friday, October 18, 2019 2:01:21 PM
To: emoon/rust_minifb <rust_minifb@noreply.github.com>
Cc: Alexander Nye <alexnye@outlook.com>; Author <author@noreply.github.com>
Subject: Re: [emoon/rust_minifb] crash on macOS on window resizing (#94)
Hi. Yeah so I will start looking at these issues soon. I just been busy at doing other things so I haven't come around to do it. The reason why I haven't started yet is that I'm going to do some upfront work to prepare the windows backend for GPU support also. This comes in line with #93<#93> as this has been requested in various places and requires work on all backends.
So right now I just haven't figured out exactly how I want to do all of that work yet.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#94?email_source=notifications&email_token=AKAQSR3XJWE4OZAPY6LVD7LQPIP2DA5CNFSM4JCMAW7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBV634Q#issuecomment-543944178>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKAQSR6ZN7XH75OGXXDW7IDQPIP2DANCNFSM4JCMAW7A>.
|
Yeah that was always my goal with it. It has grown a bit since the initial release for sure :) I will have some time off work in a few weeks and then I will work on a few things and set up some goal to take it to 1.0 |
Alright, I've tested on Windows now too and see the same thing, so I edited the issue. Also, I took a look at the code. It's pretty straightforward and the bug appears to be just that the window has changed size, which the library detects successfully, but the library intentionally crashes at this point by unwrapping the error. That seems like a hard problem. Your day job is game dev? I do web dev mainly so I don't know what you could really do about this. It seems like the OS would have to either lock the window frame size while we're writing to the buffer and before we blit it to screen, or the OS would have to handle buffers larger or smaller than the expected size. |
Alright I checked on Linux as well. And I saw some notes from developers in C# at least that the way this is usually handled is an OS-provided callback wherein one can resize and repaint the buffer, discarding the one which doesn't fit. I don't mind preventing resizing in my window options either. Given that macOS is the only environment which allows resizing the window even when the options try to prevent it, this isn't much of an issue. |
Sorry I missed the updates on this. I think this is fixable and I will give it some testing soon. |
I'm starting to look at this now. Do you still have the code that causes this? Or is it possible to make it happen with some of the examples? (for example the noise example supports resizing) |
I used I just did some more testing with the latest I tried The menu example consistently opens without segfaulting. Resizing the window to less than its original size works fine. Resizing the window to less than its original size, then resizing it larger (but no larger than its original size) works fine. If and only if the window is resized to greater than its original size, I still see:
|
I see. Thanks for the info
Does it mean that the example will just crash without showing anything and I assume this is random then if that is the case? |
Details in this #113 and how it will be fixed |
@Axelderan hey, if you have the possibility of grabbing the latest minifb, switch over to |
Yes I’ll try to do that in the next few days |
I think that fix worked! |
Cool. Thanks for checking. |
I’ve tested still more on another Linux install and I think this is safe to mark as resolved. |
Great! I will include this in the 0.15 release (I need to fix up the other platforms also) |
crate version: 0.13.0
Sometimes when I resize, the application crashes, reporting that the buffer size does not match the window size. I tried to test various starting sizes and also various magnitudes, directions, and speeds of resizing and perhaps the speed of resizing matters but I can’t be sure.
This is reproducible in Linux, macOS and Windows using the menu example:
Interestingly, I also tried this on Linux in a VM and while I can reproduce the crash with a VM having a display size of 1280x1024, I cannot reproduce this when resizing the window within the confines of a display of 1024x768.
The text was updated successfully, but these errors were encountered: