| Summary: | SDL crashed when used with PJSIP | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Terry <214721856> |
| Component: | render | Assignee: | Ryan C. Gordon <icculus> |
| Status: | REOPENED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | philipp.wiesemann, rdbugtracker |
| Version: | 2.0.3 | ||
| Hardware: | x86_64 | ||
| OS: | Windows 7 | ||
| Attachments: |
error stack
Patch |
||
Hello, and sorry if you're getting dozens of copies of this message by email. We are closing out bugs that appear to be abandoned in some form. This can happen for lots of reasons: we couldn't reproduce it, conversation faded out, the bug was noted as fixed in a comment but we forgot to mark it resolved, the report is good but the fix is impractical, we fixed it a long time ago without realizing there was an associated report, etc. Individually, any of these bugs might have a better resolution (such as WONTFIX or WORKSFORME or INVALID) but we've added a new resolution of ABANDONED to make this easily searchable and make it clear that it's not necessarily unreasonable to revive a given bug report. So if this bug is still a going concern and you feel it should still be open: please feel free to reopen it! But unless you respond, we'd like to consider these bugs closed, as many of them are several years old and overwhelming our ability to prioritize recent issues. (please note that hundred of bug reports were sorted through here, so we apologize for any human error. Just reopen the bug in that case!) Thanks, --ryan. Created attachment 4325 [details]
Patch
Have the same issue with LibSDL2 2.0.10. > SDL2.dll!WIN_GL_InitExtensions(SDL_VideoDevice * _this) Line 406 SDL2.dll!WIN_GL_LoadLibrary(SDL_VideoDevice * _this, const char * path) Line 176 SDL2.dll!SDL_GL_LoadLibrary_REAL(const char * path) Line 2894 SDL2.dll!SDL_RecreateWindow(SDL_Window * window, unsigned int flags) Line 1665 SDL2.dll!GLES2_CreateRenderer(SDL_Window * window, unsigned int flags) Line 1950 SDL2.dll!SDL_CreateRenderer_REAL(SDL_Window * window, int index, unsigned int flags) Line 888 WIN_GL_InitExtensions(_THIS) { const char *(WINAPI * wglGetExtensionsStringARB) (HDC) = 0; const char *extensions; HWND hwnd; HDC hdc; HGLRC hglrc; PIXELFORMATDESCRIPTOR pfd; if (!_this->gl_data) { return; } hwnd = CreateWindow(SDL_Appname, SDL_Appname, (WS_POPUP | WS_DISABLED), 0, 0, 10, 10, NULL, NULL, SDL_Instance, NULL); if (!hwnd) { return; } WIN_PumpEvents(_this); hdc = GetDC(hwnd); WIN_GL_SetupPixelFormat(_this, &pfd); SetPixelFormat(hdc, ChoosePixelFormat(hdc, &pfd), &pfd); > hglrc = _this->gl_data->wglCreateContext(hdc); if (!hglrc) { return; } NULL pointer dereference on gl_data member. Although it is checked at the start of the function, the CreateWindow/WIN_PumpEvents called and could change a lot of stuff. I do not know what is the cause of resetting the gl_data member - resource exhaustion or something else - but we should exit this function correctly in case of error. I think it's better to move _this->gl_data check just before wglCreateContext. Patch is attached. |
Created attachment 1998 [details] error stack Hi All, exception happened when i use pjsip for video call, here is the call stack, please help me. SDL2.dll!WIN_GL_InitExtensions(SDL_VideoDevice * _this) line 351 SDL2.dll!WIN_CreateWindow(SDL_VideoDevice * _this, SDL_Window * window) line 282 SDL2.dll!SDL_RecreateWindow(SDL_Window * window, unsigned int flags) line 1391 SDL2.dll!GLES2_CreateRenderer(SDL_Window * window, unsigned int flags) line 1768 SDL2.dll!SDL_CreateRenderer_REAL(SDL_Window * window, int index, unsigned int flags) line 253 SDL2.dll!SDL_CreateRenderer(SDL_Window * a, int b, unsigned int c) line 336 PjsipDLL.dll!_pjmedia_sdl_factory() PjsipDLL.dll!_pjmedia_sdl_factory() PjsipDLL.dll!_pjmedia_cbar_factory() PjsipDLL.dll!_pj_thread_this()