| Summary: | When a monitor is disabled, GetNumDisplayModes crashes with X error BadRRCrtc | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Gabríel Arthúr Pétursson <gabriel> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 2.0.3 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: | A minimal reproducible test case | ||
Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though! |
Created attachment 1666 [details] A minimal reproducible test case When querying the number of display modes, the SDL_GetNumDisplayModes function may crash the application under the condition that the monitor in question has been disabled since SDL initialization. == Steps to reproduce == A dual-monitor setup is required to reproduce this bug. Having more than two monitors, while not tested, should trigger the bug too. 1) Initialize SDL and the video subsystem. 2) Get the number of displays with SDL_GetNumVideoDisplays. 3) Disable one of your monitors. Simply turning off your monitor is not sufficient. 4) For each display, get its number of display modes with SDL_GetNumDisplayModes. For step 3, I have used the nvidia-settings tool to disable one of the monitors. Other tools should work as well. == Actual results == When the monitor that has been disabled is queried, the application should crash with an error message similar to the following. X Error of failed request: BadRRCrtc (invalid Crtc parameter) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 20 (RRGetCrtcInfo) Crtc id in failed request: 0x0 Serial number of failed request: 171 Current serial number in output stream: 171 A minimal reproducible test case is attached with this bug report. == Expected results == The SDL_GetNumDisplayModes function should return a negative error code on failure, with SDL_GetError indicating that the monitor is no longer active. == Build Date & Hardware == Built from source tarball at 2014-04-27 with gcc 4.8.2 on Debian Testing.