-
Notifications
You must be signed in to change notification settings - Fork 472
set_size
can cause seg fault when value too large on macOS
#700
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
Comments
How would you expect the library to behave? |
Unable to reproduce; no crash on Linux. |
Panic or return an error? Safe code in Rust isn't supposed to segfault. |
The segfault is coming from your OS, not from SDL2. Can you sho me the full backtrace? I'd like to know where that panic comes from. There is not much I can do aside from "assert"-ing that the new size is below a certain value that would be deemed safe, but again you shouldn't have to set your window to such a size in the first place; what would be a "too big" value for SDL2 to panic? |
I've been unable to reproduce the panic; only a segfault, and I don't think I can get a backtrace from a segfault.
Yes, this is what I am asking for.
Of course not; if my program did that, it would be a bug... which I would like to be easy to fix, because I got a panic or an error return, instead of a segfault. |
Well, if you tell me what is the maximum value your OS accepts, we can make an assert of the like for sure. |
set_size
can cause seg faultset_size
can cause seg fault when value too large on macOS
From https://developer.apple.com/documentation/appkit/nswindow/1419753-setframe?language=objc Max size ( |
What would be the best way to check the current platform within the library? |
Either at compile time with the "cfg" attributes, or at runtime using https://docs.rs/sdl2/0.32.2/sdl2/fn.get_platform.html |
Uh oh!
There was an error while loading. Please reload this page.
Sometimes I get a panic; sometimes a seg fault.
Mac OS 10.12.4.
The text was updated successfully, but these errors were encountered: