{"action":"created","issue":{"url":"https://api.github.com/repos/baldurk/renderdoc/issues/344","repository_url":"https://api.github.com/repos/baldurk/renderdoc","labels_url":"https://api.github.com/repos/baldurk/renderdoc/issues/344/labels{/name}","comments_url":"https://api.github.com/repos/baldurk/renderdoc/issues/344/comments","events_url":"https://api.github.com/repos/baldurk/renderdoc/issues/344/events","html_url":"https://github.com/baldurk/renderdoc/issues/344","id":174349598,"number":344,"title":"WrappedOpenGL::RenderOverlayStr generates GL_INVALID_OPERATION and crashes","user":{"login":"inequation","id":320285,"avatar_url":"https://avatars.githubusercontent.com/u/320285?v=3","gravatar_id":"","url":"https://api.github.com/users/inequation","html_url":"https://github.com/inequation","followers_url":"https://api.github.com/users/inequation/followers","following_url":"https://api.github.com/users/inequation/following{/other_user}","gists_url":"https://api.github.com/users/inequation/gists{/gist_id}","starred_url":"https://api.github.com/users/inequation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inequation/subscriptions","organizations_url":"https://api.github.com/users/inequation/orgs","repos_url":"https://api.github.com/users/inequation/repos","events_url":"https://api.github.com/users/inequation/events{/privacy}","received_events_url":"https://api.github.com/users/inequation/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/baldurk/renderdoc/labels/status:%20unresolved","name":"status: unresolved","color":"e11d21"},{"url":"https://api.github.com/repos/baldurk/renderdoc/labels/type:%20bug","name":"type: bug","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-31T18:52:00Z","updated_at":"2016-09-01T14:18:00Z","closed_at":null,"body":"So far I've only reproduced it on Debian Linux 4.6.0-1-amd64 with the NVIDIA 367.35 driver on a 4.5 core profile context. Here's the debug message:\r\n\r\n`source=eGL_DEBUG_SOURCE_API, type=eGL_DEBUG_TYPE_ERROR, id=1282, severity=eGL_DEBUG_SEVERITY_HIGH, length=74, \r\n    message=0x7fffec041ae0 \"GL_INVALID_OPERATION error generated. Buffer must be bound and not mapped.\"`\r\n\r\nMy GL debug callback raises SIGTRAP for errors, here's the callstack:\r\n\r\n    (gdb) bt\r\n    #0  0x00007ffff5c1b198 in __GI_raise (sig=5) at ../sysdeps/unix/sysv/linux/raise.c:54\r\n    #1  0x0000000000405c00 in OpenGLDebugCallback (Source=33350, Type=33356, Id=1282, Severity=37190, Length=74, Message=0x7fffec041ae0 \"GL_INVALID_OPERATION error generated. Buffer must be bound and not mapped.\", UserParam=0x0) at tinypano.cpp:146\r\n    #2  0x00007ffff71c2c2b in WrappedOpenGL::DebugSnoop (this=0x91c3c0, source=eGL_DEBUG_SOURCE_API, type=eGL_DEBUG_TYPE_ERROR, id=1282, severity=eGL_DEBUG_SEVERITY_HIGH, length=74, \r\n    message=0x7fffec041ae0 \"GL_INVALID_OPERATION error generated. Buffer must be bound and not mapped.\") at /home/inequation/projects/renderdoc/renderdoc/driver/gl/gl_driver.cpp:3152\r\n    #3  0x00007ffff71cdc77 in WrappedOpenGL::DebugSnoopStatic (source=eGL_DEBUG_SOURCE_API, type=eGL_DEBUG_TYPE_ERROR, id=1282, severity=eGL_DEBUG_SEVERITY_HIGH, length=74, \r\n    message=0x7fffec041ae0 \"GL_INVALID_OPERATION error generated. Buffer must be bound and not mapped.\", userParam=0x91c3c0) at /home/inequation/projects/renderdoc/renderdoc/driver/gl/gl_driver.h:137\r\n    #4  0x00007fffeaf97c58 in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.367.35\r\n    #5  0x00007fffeaf97da0 in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.367.35\r\n    #6  0x00007fffeaf98062 in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.367.35\r\n    #7  0x00007fffeaf710ec in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.367.35\r\n    #8  0x00007ffff71bc5a7 in WrappedOpenGL::RenderOverlayStr (this=0x91c3c0, x=0, y=0, text=0x7ffff7c9e900 <WrappedOpenGL::RenderOverlayText(float, float, char const*, ...)::tmpBuf> \"OpenGL. F12, PrtScrn to capture. Frame: 1. 0.00 ms (0.00 .. 0.00) (0 FPS)\")\r\n    at /home/inequation/projects/renderdoc/renderdoc/driver/gl/gl_driver.cpp:1682\r\n    #9  0x00007ffff71bc1dd in WrappedOpenGL::RenderOverlayText (this=0x91c3c0, x=0, y=0, fmt=0x946060 \"OpenGL. F12, PrtScrn to capture. Frame: 1. 0.00 ms (0.00 .. 0.00) (0 FPS)\") at /home/inequation/projects/renderdoc/renderdoc/driver/gl/gl_driver.cpp:1650\r\n    #10 0x00007ffff71bef0d in WrappedOpenGL::SwapBuffers (this=0x91c3c0, windowHandle=0x1200006) at /home/inequation/projects/renderdoc/renderdoc/driver/gl/gl_driver.cpp:2277\r\n    #11 0x00007ffff734486c in glXSwapBuffers (dpy=0x6b22e0, drawable=18874374) at /home/inequation/projects/renderdoc/renderdoc/driver/gl/gl_hooks_linux.cpp:1012\r\n    #12 0x00000000004058ab in main (argc=2, argv=0x7fffffffdf68) at tinypano.cpp:514\r\n    (gdb) fr 8\r\n    #8  0x00007ffff71bc5a7 in WrappedOpenGL::RenderOverlayStr (this=0x91c3c0, x=0, y=0, text=0x7ffff7c9e900 <WrappedOpenGL::RenderOverlayText(float, float, char const*, ...)::tmpBuf> \"OpenGL. F12, PrtScrn to capture. Frame: 1. 0.00 ms (0.00 .. 0.00) (0 FPS)\")\r\n    at /home/inequation/projects/renderdoc/renderdoc/driver/gl/gl_driver.cpp:1682\r\n    1682            eGL_UNIFORM_BUFFER, 0, sizeof(FontUBOData), GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);\r\n    (gdb)\r\n\r\nIf I let the program continue, the program segfaults on the same line due to `glMapBuffer()` failing and returning `NULL`:\r\n\r\n    FontUBOData *ubo = (FontUBOData *)gl.glMapBufferRange(\r\n            eGL_UNIFORM_BUFFER, 0, sizeof(FontUBOData), GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);\r\n    ubo->TextPosition.x = x;\r\n\r\nIt is also of note that an application-owned buffer (i.e. not RenderDoc's internal stuff) also generates the same GL error when attempting to upload data to it with `glBufferStorage()`, but not with `glBufferData()`.\r\n\r\nIs there some overeager buffer mapping going on?"},"comment":{"url":"https://api.github.com/repos/baldurk/renderdoc/issues/comments/244093039","html_url":"https://github.com/baldurk/renderdoc/issues/344#issuecomment-244093039","issue_url":"https://api.github.com/repos/baldurk/renderdoc/issues/344","id":244093039,"user":{"login":"baldurk","id":661798,"avatar_url":"https://avatars.githubusercontent.com/u/661798?v=3","gravatar_id":"","url":"https://api.github.com/users/baldurk","html_url":"https://github.com/baldurk","followers_url":"https://api.github.com/users/baldurk/followers","following_url":"https://api.github.com/users/baldurk/following{/other_user}","gists_url":"https://api.github.com/users/baldurk/gists{/gist_id}","starred_url":"https://api.github.com/users/baldurk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baldurk/subscriptions","organizations_url":"https://api.github.com/users/baldurk/orgs","repos_url":"https://api.github.com/users/baldurk/repos","events_url":"https://api.github.com/users/baldurk/events{/privacy}","received_events_url":"https://api.github.com/users/baldurk/received_events","type":"User","site_admin":false},"created_at":"2016-09-01T14:17:59Z","updated_at":"2016-09-01T14:17:59Z","body":"I'm trying to repro this right now but the random GL sample I picked to try and repro on is running into some weird problems. I'll let you know if I'm able to get something working, but it's not a bug I've seen before.\r\n\r\nIn the meantime would you be able to check something for me? As far as I can tell the buffer should be mapped an then immediately unmapped, so it shouldn't already be mapped. Can you check if `ctxdata.GeneralUBO` is a valid buffer, or if it's 0? I wonder if somehow creation failed on that context for some reason.\r\n\r\nWhat GL context use do you have going on - are you using multiple contexts on different threads, or do you just have one? Maybe there's some threading issue going on."}}
{"actor":{"display_login":"baldurk"}}