Skip to content
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

Segfault when replaying on master #236

Closed
emberian opened this issue Mar 7, 2014 · 1 comment
Closed

Segfault when replaying on master #236

emberian opened this issue Mar 7, 2014 · 1 comment

Comments

@emberian
Copy link
Contributor

emberian commented Mar 7, 2014

With this trace, ./glretrace texture.trace segfaults, with the following backtrace:

#0  0x0000000000470aad in glws::Context::hasExtension (this=0xa25090, string=0x652321 "GL_ARB_timer_query")
    at /home/cmr/src/apitrace/retrace/glws.cpp:100
#1  0x000000000042d34a in glretrace::Context::hasExtension (this=0xa250f0, extension=0x652321 "GL_ARB_timer_query")
    at /home/cmr/src/apitrace/retrace/glretrace.hpp:57
#2  0x000000000042cbfe in glretrace::initContext () at /home/cmr/src/apitrace/retrace/glretrace_main.cpp:294
#3  0x000000000042de75 in glretrace::makeCurrent (call=..., drawable=0xa25030, context=0xa250f0)
    at /home/cmr/src/apitrace/retrace/glretrace_ws.cpp:176
#4  0x00000000005e8e45 in retrace_glXMakeCurrent (call=...) at /home/cmr/src/apitrace/retrace/glretrace_glx.cpp:148
#5  0x000000000042a05d in retrace::Retracer::retrace (this=0x901ce0 <retracer>, call=...) at /home/cmr/src/apitrace/retrace/retrace.cpp:119
#6  0x000000000041f93a in retrace::retraceCall (call=0x9df770) at /home/cmr/src/apitrace/retrace/retrace_main.cpp:184
#7  0x0000000000421802 in retrace::RelayRunner::runLeg (this=0x9df630, call=0x9df770) at /home/cmr/src/apitrace/retrace/retrace_main.cpp:335
#8  0x00000000004216f4 in retrace::RelayRunner::runRace (this=0x9df630) at /home/cmr/src/apitrace/retrace/retrace_main.cpp:306 
#9  0x000000000041fc8a in retrace::RelayRace::run (this=0x7fffffffd160) at /home/cmr/src/apitrace/retrace/retrace_main.cpp:473
#10 0x000000000041fe59 in retrace::mainLoop () at /home/cmr/src/apitrace/retrace/retrace_main.cpp:533
#11 0x00000000004205e0 in main (argc=3, argv=0x7fffffffd368) at /home/cmr/src/apitrace/retrace/retrace_main.cpp:794

Poking around a bit, it's a NULL pointer. glGetString(GL_EXTENSIONS) is returning NULL, and glGetError is GL_INVALID_ENUM. According to a bisection, @jrfonseca broke it with:

[984010aac97b628d390dce6fecb8197eadfabb47] glretrace: Support more profiles; match the profile used in glXCreateContextAttribsARBG call.

So it looks like context creation is broken, at least for GL 3.1. I don't really know how to fix it or what the error is.

jrfonseca added a commit that referenced this issue Mar 7, 2014
And not just those we explicitly request to be core context.

Fixes issue #236.
@jrfonseca
Copy link
Member

Thanks for the detailed error report.

The issue was that when we request OpenGL 3.1 in glretrace there is no guarantee we get a compatibility context (with Mesa we don't), and glGetString(GL_EXTENSIONS) only works for compatibility contexts. I knew about this but I got confused with the "core" profiles introduced in OpenGL 3.2 and higher.

I've fixed this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants