On 06/28/2015 03:48 AM, Ilia Mirkin wrote:
On Fri, Jun 5, 2015 at 9:36 AM, Mario Kleiner
<mario.kleiner...@gmail.com> wrote:
The dup'ed fd owned by the nouveau_screen for a device node
must also be used as key for the winsys hash table, instead
of using the original fd passed in for a screen, to make
multi-x-screen ZaphodHeads configurations work on nouveau.

This prevents the following crash scenario that was observed
when a dynamically loaded rendering plugin used OpenGL on a
ZaphodHeads setup, e.g., on a dual x-screen setup. At first
load the plugin worked, but after unloading and reloading it,
the next rendering operation crashed:

1. Client, e.g., a plugin, calls glXQueryVersion.

2. DRI screens for the x-screens 0 and 1 are created, one shared
    nouveau_screen is created for the shared device node of both
    screens, but the original fd of x-screen 0 is used as identifying
    key in the hash table, instead of the dup()ed fd of x-screen 0
    which is owned by the nouveau_screen. nouveau_screen's refcount
    is now 2.

See below, but it shouldn't matter which fd gets used.


3. Regular rendering happens by the client plugin, then the plugin
    gets unloaded.

4. XCloseDisplay(). x-screen 0 gets its DRI screen destroyed,
    nouveau_drm_screen_unref() drops the refcount to 1, calling mesa
    code then closes the fd of x-screen 0, so now the fd which is
    used as key in the hash table is invalid. x-screen 1 gets
    destroyed, nouveau_drm_screen_unref() drops the refcount to 0,
    the nouveau_screen gets destroyed, but removal of its entry
    in the hash table fails, because the invalid fd in the hash
    table no longer matches anything (fstat() on the fd is used
    for hashing and key comparison, but fstat() on an already closed
    fd fails and returns bogus results). x-screen 1 closes its fd.

    Now all fd's are closed, the nouveau_screen destroyed, but
    there is a dangling reference to the nouveau_screen in the
    hash table.

5. Some OpenGL client plugin gets loaded again and calls
    glXQueryVersion. Step 2 above repeats, but because a
    dangling reference with a matching fd is found in the winsys
    hash table, no new nouveau_screen is created this time. Instead
    the invalid pointer to the old nouveau_screen is recycled,
    which points to nirvana -> Crash.

This problem is avoided by use of the dup()ed fd which is
owned by the nouveau_screen and has the same lifetime as
the nouveau_screen itself.

I need to think about this some more, but... this shouldn't happen :)

In fact, the whole dupfd thing was added there for ZaphodHeads screens
in the first place. See
https://bugs.freedesktop.org/show_bug.cgi?id=79823 and commit
a59f2bb17bcc which fixed it.

Note that the hash has the following hash/eq functions:

static unsigned hash_fd(void *key)
{
     int fd = pointer_to_intptr(key);
     struct stat stat;
     fstat(fd, &stat);

     return stat.st_dev ^ stat.st_ino ^ stat.st_rdev;
}

static int compare_fd(void *key1, void *key2)
{
     int fd1 = pointer_to_intptr(key1);
     int fd2 = pointer_to_intptr(key2);
     struct stat stat1, stat2;
     fstat(fd1, &stat1);
     fstat(fd2, &stat2);

     return stat1.st_dev != stat2.st_dev ||
            stat1.st_ino != stat2.st_ino ||
            stat1.st_rdev != stat2.st_rdev;
}

so fd and dupfd should get hashed to the same thing. I suspect there's
something else going on in your application...


My application is a set of dynamically loaded plugins running inside another host app (Psychtoolbox-3 inside GNU/Octave), so what happens often is that the OpenGL using plugin gets unloaded and reloaded at runtime, so a after a OpenGL session has ended with a XCloseDisplay() tearing the winsys down, you can easily have it restart at plugin reload with another XOpenDisplay -> glXQueryVersion -> .... sequence, where the new call to glXQueryVersion will trigger a recreation of the winsys, which will find the stale entry in the hash table pointing to nowhere instead of the previously released nouveau_screen -> use-after-free -> boom!

The reason this fails is because during destruction of the 2nd, 3rd etc. x-screen, the already closed fd associated with the 1st x-screen is fed into the compare_fd function, so fstat() errors out on the invalid fd. I added printf's etc. on both nouveau and now radeon to verify the fstat gives me EBADF errors. So the hash calculation goes wrong when trying to find the matching element in the hash table with a fd that has a matching hash -> The element which should be removed is ignored/not removed because it contains an already closed fd for which no proper hash can be calculated anymore -> hash comparison during search goes wrong.

This is because multiple x-screens, e.g., 2 x-screens are destroyed in order 0, 1 by FreeScreenConfigs() as part of XCloseDisplay(). FreeScreenConfigs() calls dri2DestroyScreen() in dri2.c or dri3_destroy_screen in dri3.c, which are essentially identical, e.g.,:

static void
dri2DestroyScreen(struct glx_screen *base)
{
   struct dri2_screen *psc = (struct dri2_screen *) base;

   /* Free the direct rendering per screen data */
   (*psc->core->destroyScreen) (psc->driScreen);

--> This core->destroyScreen calls eventually into the winsys, which then drops the refcount of the nouveau_screen or radeon winsys structure by one, and tries to release the struct and remove the hash table entry once the refcount drops to zero.

   driDestroyConfigs(psc->driver_configs);
   close(psc->fd);

-> This close() closes the fd of a screen immediately after closing down that screen. At the time screen 1 is closed down, the fd associated with screen 0 is already closed.

   free(psc);
}

So you have this sequence during creation:

glXQueryVersion() -> AllocAndFetchScreenConfigs():

create screen 0 and its fd, e.g., fd==5, dup(fd), e.g., fd==6 for the nouveau_screen, but store x-screen 0's fd==5 *itself* in the hash table as key.

create screen 1. This now creates an fd 7

=> refcount is now 2.


And this sequence during destruction at XCloseDisplay();

FreeScreenConfigs():

free screen 0: core->destroyScreen() -> ... -> nouveau_drm_screen_unref() => refcount-- is now 1 close(fd==5) of screen 0 and thereby the fd==5 stored inside the hash table as key. From now on using fcntl(fd==5) for hash calculation on that element will malfunction.

free screen 1: -> nouveau_drm_screen_unref -> refcount-- is now 0. -> Try to remove hash table entry => fails because fcntl(fd==5) on the already closed fd==5 of screen 0 fails with EBADF. => Hash table keeps its stale element referencing the struct nouveau_screen.

Free nouveau_screen struct (close dup()ed fd==6 for nouveau_screen, close down stuff, free the struct).
-> close(fd==7) associated with screen 1.

Now all fd's (5,6,7) are closed, the struct is gone, the hash table contains a stale element with a no longer existent fd==5 and a pointer to an already free()d struct nouveau_screen.

Now we reload the plugin and do glXQueryVersion() again, so AllocAndFetchScreenConfigs() is executed again to create the winsys etc. for screens 0 and 1.

create screen 0 and its fd: Here the first unused fd in the filedescriptor table is recycled, which happens to be fd==5, just as in the first session with the plugin! Now suddenly fd=5 is again the valid fd for x-screen 0, and it points to the same /dev/drm/card0 device file as before. That means when nouveau_drm_screen_create(fd==5) is called, it finds the stale element in the hash table from the previous session, because the previously closed fd 5 in that element is now valid and open again and points to the same device file as in the previous session, ergo has the same hash etc. nouveau_drm_screen_create() concludes that a fully initialized nouveau_screen already exists for this session, except it doesn't exist - the pointer in the hash table points to invalid previously freed memory. When it tries to access that memory we have a use-after-free and the application segfaults.

So it depends a bit on what happens in the applications memory between the two consecutive OpenGL sessions etc. how long it takes for an invalid memory access to happen, but eventually it hits invalid data. Maybe occassionally it gets lucky and the freed memory is still accessible and the struct intact, so stuff works by chance.

If the application happened to open other files inbetween the 1st and 2nd session, then the relevant fd in the 2nd session may not be exactly the same as in the first session, because recycling that fd didn't work, so we are only left with a dead but harmless entry in the hash table instead of a crasher. I assume something like that prevented my crashes on radeon in the past, because when i wasn't expecting/looking for trouble i didn't use a test sequence carefully made to trigger the bug for certain.

Similar things happen on radeon for the same reason, ergo the 2nd patch with a similar fix.

I don't have the gdb backtrace for nouveau anymore, but the traces for radeon are attached to this mail to show you the flow of execution, similar to nouveau.

-mario
Against Mesa git master DRI2:

Breakpoint 1, radeon_drm_winsys_create (fd=-517074139, 
screen_create=0x7fffe12e1337) at radeon_drm_winsys.c:678
678     {
(gdb) bt full
#0  radeon_drm_winsys_create (fd=-517074139, screen_create=0x7fffe12e1337) at 
radeon_drm_winsys.c:678
No locals.
#1  0x00007fffe0ced4fe in pipe_r600_create_screen (fd=5) at 
../../../../src/gallium/auxiliary/target-helpers/inline_drm_helper.h:209
        rw = 0x11eeee0
#2  dd_create_screen (fd=5) at 
../../../../src/gallium/auxiliary/target-helpers/inline_drm_helper.h:364
No locals.
#3  0x00007fffe0f44363 in dri2_init_screen (sPriv=0x11eed20) at dri2.c:1458
        configs = <optimized out>
        screen = 0x11eef00
        pscreen = 0x0
        throttle_ret = 0x0
        dmabuf_ret = 0x0
#4  0x00007fffe0f3ecf1 in driCreateNewScreen2 (scrn=0, fd=5, 
extensions=<optimized out>, driver_extensions=<optimized out>, 
driver_configs=0x7fffffffa950, data=0x1162400) at dri_util.c:159
        emptyExtensionList = {0x0}
        psp = 0x11eed20
        consts = {MaxTextureMbytes = 24, MaxTextureLevels = 0, 
Max3DTextureLevels = 0, MaxCubeTextureLevels = 0, MaxArrayTextureLayers = 
2147483906, MaxTextureRectSize = 0, MaxTextureCoordUnits = 4294944800, 
MaxCombinedTextureImageUnits = 32767, MaxTextureUnits = 4097458806, 
          MaxTextureMaxAnisotropy = 4,59163468e-41, MaxTextureLodBias = 
-9,01278779e+33, MaxTextureBufferSize = 32767, TextureBufferOffsetAlignment = 
4294944304, MaxArrayLockSize = 32767, SubPixelBits = 509, MinPointSize = 0, 
MaxPointSize = 2,90701945e-38, MinPointSizeAA = 0, 
          MaxPointSizeAA = -1,15225159e+20, PointSizeGranularity = 
4,59163468e-41, MinLineWidth = -1,15333879e+20, MaxLineWidth = 4,59163468e-41, 
MinLineWidthAA = -9,01421514e+33, MaxLineWidthAA = 4,59163468e-41, 
LineWidthGranularity = 7,13260918e-43, MaxClipPlanes = 0, 
          MaxLights = 3771208328, MaxShininess = 4,59163468e-41, 
MaxSpotExponent = 2,90701945e-38, MaxViewportWidth = 0, MaxViewportHeight = 
4294944024, MaxViewports = 32767, ViewportSubpixelBits = 4294944020, 
ViewportBounds = {Min = 4,59163468e-41, Max = -nan(0x7fa5a8)}, 
          Program = {{MaxInstructions = 32767, MaxAluInstructions = 4294944176, 
MaxTexInstructions = 32767, MaxTexIndirections = 18803952, MaxAttribs = 0, 
MaxTemps = 0, MaxAddressRegs = 0, MaxAddressOffset = 4294944024, MaxParameters 
= 32767, MaxLocalParams = 2336646085, 
              MaxEnvParams = 0, MaxNativeInstructions = 36510095, 
MaxNativeAluInstructions = 0, MaxNativeTexInstructions = 5, 
MaxNativeTexIndirections = 32767, MaxNativeAttribs = 4294944240, MaxNativeTemps 
= 32767, MaxNativeAddressRegs = 3771208328, MaxNativeParameters = 32767, 
              MaxUniformComponents = 4294944020, MaxInputComponents = 32767, 
MaxOutputComponents = 4294944224, LowFloat = {RangeMin = 32767, RangeMax = 0, 
Precision = 25936}, MediumFloat = {RangeMin = 286, RangeMax = 0, Precision = 
0}, HighFloat = {RangeMin = 0, RangeMax = 0, 
                Precision = 0}, LowInt = {RangeMin = 0, RangeMax = 21, 
Precision = 0}, MediumInt = {RangeMin = 0, RangeMax = 0, Precision = 63152}, 
HighInt = {RangeMin = 61619, RangeMax = 0, Precision = 0}, MaxUniformBlocks = 
0, MaxCombinedUniformComponents = 0, 
              MaxTextureImageUnits = 27, MaxAtomicBuffers = 0, 
MaxAtomicCounters = 18762104, MaxImageUniforms = 0}, {MaxInstructions = 
4294944384, MaxAluInstructions = 32767, MaxTexInstructions = 0, 
MaxTexIndirections = 0, MaxAttribs = 2, MaxTemps = 0, MaxAddressRegs = 0, 
              MaxAddressOffset = 0, MaxParameters = 4294944456, MaxLocalParams 
= 32767, MaxEnvParams = 4158536705, MaxNativeInstructions = 32767, 
MaxNativeAluInstructions = 0, MaxNativeTexInstructions = 0, 
MaxNativeTexIndirections = 0, MaxNativeAttribs = 0, MaxNativeTemps = 2, 
              MaxNativeAddressRegs = 0, MaxNativeParameters = 0, 
MaxUniformComponents = 0, MaxInputComponents = 0, MaxOutputComponents = 0, 
LowFloat = {RangeMin = 17904, RangeMax = 286, Precision = 0}, MediumFloat = 
{RangeMin = 0, RangeMax = 63152, Precision = 61619}, HighFloat = {
                RangeMin = 32767, RangeMax = 0, Precision = 42436}, LowInt = 
{RangeMin = 65535, RangeMax = 32767, Precision = 0}, MediumInt = {RangeMin = 0, 
RangeMax = 0, Precision = 0}, HighInt = {RangeMin = 0, RangeMax = 18808, 
Precision = 286}, MaxUniformBlocks = 0, 
              MaxCombinedUniformComponents = 4294944240, MaxTextureImageUnits = 
32767, MaxAtomicBuffers = 98, MaxAtomicCounters = 0, MaxImageUniforms = 
18761200}, {MaxInstructions = 0, MaxAluInstructions = 4294944224, 
MaxTexInstructions = 32767, MaxTexIndirections = 18803952, 
              MaxAttribs = 0, MaxTemps = 2336646085, MaxAddressRegs = 0, 
MaxAddressOffset = 4294967295, MaxParameters = 0, MaxLocalParams = 2096, 
MaxEnvParams = 0, MaxNativeInstructions = 3771208184, MaxNativeAluInstructions 
= 32767, MaxNativeTexInstructions = 18761200, 
              MaxNativeTexIndirections = 0, MaxNativeAttribs = 30, 
MaxNativeTemps = 0, MaxNativeAddressRegs = 4158535602, MaxNativeParameters = 
32767, MaxUniformComponents = 2096, MaxInputComponents = 0, MaxOutputComponents 
= 4131417544, LowFloat = {RangeMin = 32767, RangeMax = 0, 
                Precision = 53248}, MediumFloat = {RangeMin = 63484, RangeMax = 
32767, Precision = 0}, HighFloat = {RangeMin = 42680, RangeMax = 65535, 
Precision = 32767}, LowInt = {RangeMin = 0, RangeMax = 42676, Precision = 
65535}, MediumInt = {RangeMin = 32767, RangeMax = 0, 
                Precision = 12608}, HighInt = {RangeMin = 63454, RangeMax = 
32767, Precision = 0}, MaxUniformBlocks = 4294958488, 
MaxCombinedUniformComponents = 32767, MaxTextureImageUnits = 4097223151, 
MaxAtomicBuffers = 32767, MaxAtomicCounters = 4097180992, 
              MaxImageUniforms = 32767}, {MaxInstructions = 18803952, 
MaxAluInstructions = 0, MaxTexInstructions = 4160532480, MaxTexIndirections = 
32767, MaxAttribs = 4160736448, MaxTemps = 32767, MaxAddressRegs = 0, 
MaxAddressOffset = 0, MaxParameters = 18761200, 
              MaxLocalParams = 0, MaxEnvParams = 4294944576, 
MaxNativeInstructions = 32767, MaxNativeAluInstructions = 4132672003, 
MaxNativeTexInstructions = 32767, MaxNativeTexIndirections = 2, 
MaxNativeAttribs = 0, MaxNativeTemps = 0, MaxNativeAddressRegs = 0, 
              MaxNativeParameters = 30, MaxUniformComponents = 0, 
MaxInputComponents = 4294945024, MaxOutputComponents = 32767, LowFloat = 
{RangeMin = 30, RangeMax = 0, Precision = 0}, MediumFloat = {RangeMin = 0, 
RangeMax = 2, Precision = 0}, HighFloat = {RangeMin = 32767, 
                RangeMax = 0, Precision = 1}, LowInt = {RangeMin = 0, RangeMax 
= 0, Precision = 0}, MediumInt = {RangeMin = 4600, RangeMax = 57544, Precision 
= 32767}, HighInt = {RangeMin = 0, RangeMax = 29, Precision = 0}, 
MaxUniformBlocks = 0, 
              MaxCombinedUniformComponents = 4294945024, MaxTextureImageUnits = 
32767, MaxAtomicBuffers = 18803840, MaxAtomicCounters = 0, MaxImageUniforms = 
4132497260}}, MaxProgramMatrices = 32767, MaxProgramMatrixStackDepth = 
4222451712, QueryCounterBits = {
            SamplesPassed = 32767, TimeElapsed = 18803840, Timestamp = 0, 
PrimitivesGenerated = 18803840, PrimitivesWritten = 0, VerticesSubmitted = 
18803840, PrimitivesSubmitted = 0, VsInvocations = 18803840, TessPatches = 0, 
TessInvocations = 4294944960, GsInvocations = 32767, 
            GsPrimitives = 4294944960, FsInvocations = 32767, 
ComputeInvocations = 0, ClInPrimitives = 0, ClOutPrimitives = 4094613840}, 
MaxDrawBuffers = 32767, MaxColorAttachments = 18228224, MaxRenderbufferSize = 
0, MaxSamples = 4038328544, MaxVarying = 32767, 
          MaxCombinedUniformBlocks = 4038328564, MaxUniformBufferBindings = 
32767, MaxUniformBlockSize = 0, UniformBufferOffsetAlignment = 0, 
MaxUserAssignableUniformLocations = 4158559332, MaxGeometryOutputVertices = 
32767, MaxGeometryTotalOutputComponents = 4160532480, 
          GLSLVersion = 4, ForceGLSLExtensionsWarn = 88 'X', ForceGLSLVersion = 
32767, AllowGLSLExtensionDirectiveMidShader = 0 '\000', NativeIntegers = 0 
'\000', VertexID_is_zero_based = false, UniformBooleanTrue = 0, 
MaxServerWaitTimeout = 8895248, 
          QuadsFollowProvokingVertexConvention = 24 '\030', ContextFlags = 0, 
ProfileMask = 8895240, MaxVertexAttribStride = 0, MaxTransformFeedbackBuffers = 
4038328544, MaxTransformFeedbackSeparateComponents = 32767, 
MaxTransformFeedbackInterleavedComponents = 4294944960, 
          MaxVertexStreams = 32767, MinProgramTexelOffset = 8895232, 
MaxProgramTexelOffset = 0, MinProgramTextureGatherOffset = 8895248, 
MaxProgramTextureGatherOffset = 0, MaxProgramTextureGatherComponents = 8895256, 
ResetStrategy = 0, MaxDualSourceDrawBuffers = 8895240, 
          StripTextureBorder = 0 '\000', GLSLSkipStrictMaxUniformLimitCheck = 0 
'\000', AlwaysUseGetTransformFeedbackVertexCount = 0 '\000', 
MinMapBufferAlignment = 4294944676, DisableVaryingPacking = 255 '\377', 
GenerateTemporaryNames = 127, MaxElementIndex = 0, 
          DisableGLSLLineContinuations = 20 '\024', MaxColorTextureSamples = 
-1124881641, MaxDepthTextureSamples = -22336, MaxIntegerSamples = 32767, 
SampleMap2x = "\000", SampleMap4x = "\000\000\000", SampleMap8x = 
"\000\000P\331\016\364\377\177", 
          MaxAtomicBufferBindings = 18228224, MaxAtomicBufferSize = 0, 
MaxCombinedAtomicBuffers = 3834321940, MaxCombinedAtomicCounters = 3170088320, 
MaxVertexAttribRelativeOffset = -2098652140, MaxVertexAttribBindings = 
-1124883006, MaxImageUnits = 4094613840, 
          MaxCombinedImageUnitsAndFragmentOutputs = 0, MaxImageSamples = 
18228224, MaxCombinedImageUniforms = 0, MaxComputeWorkGroupCount = {4132496930, 
32767, 0}, MaxComputeWorkGroupSize = {0, 24, 48}, 
MaxComputeWorkGroupInvocations = 4294945024, 
          MinFragmentInterpolationOffset = 4,59163468e-41, 
MaxFragmentInterpolationOffset = -nan(0x7fa840), FakeSWMSAA = 255 '\377', 
ContextReleaseBehavior = 1818322735, ShaderCompilerOptions = {{EmitCondCodes = 
176 '\260', EmitNoLoops = 97 'a', EmitNoFunctions = 64 '@', 
              EmitNoCont = 246 '\366', EmitNoMainReturn = 255 '\377', 
EmitNoNoise = 127 '\177', EmitNoPow = 0 '\000', EmitNoSat = 0 '\000', 
LowerClipDistance = 240 '\360', EmitNoIndirectInput = 69 'E', 
EmitNoIndirectOutput = 30 '\036', EmitNoIndirectTemp = 1 '\001', 
              EmitNoIndirectUniform = 0 '\000', MaxIfDepth = 4097676651, 
MaxUnrollIterations = 32767, OptimizeForAOS = 32 ' ', NirOptions = 
0x7ffff0b40090 <dlclose_doit>}, {EmitCondCodes = 207 '\317', EmitNoLoops = 5 
'\005', EmitNoFunctions = 192 '\300', EmitNoCont = 52 '4', 
              EmitNoMainReturn = 0 '\000', EmitNoNoise = 0 '\000', EmitNoPow = 
0 '\000', EmitNoSat = 0 '\000', LowerClipDistance = 240 '\360', 
EmitNoIndirectInput = 69 'E', EmitNoIndirectOutput = 30 '\036', 
EmitNoIndirectTemp = 1 '\001', EmitNoIndirectUniform = 0 '\000', 
              MaxIfDepth = 3771650928, MaxUnrollIterations = 32767, 
OptimizeForAOS = 32 ' ', NirOptions = 0x0}, {EmitCondCodes = 80 'P', 
EmitNoLoops = 217 '\331', EmitNoFunctions = 14 '\016', EmitNoCont = 244 '\364', 
EmitNoMainReturn = 255 '\377', EmitNoNoise = 127 '\177', 
              EmitNoPow = 0 '\000', EmitNoSat = 0 '\000', LowerClipDistance = 0 
'\000', EmitNoIndirectInput = 36 '$', EmitNoIndirectOutput = 22 '\026', 
EmitNoIndirectTemp = 1 '\001', EmitNoIndirectUniform = 0 '\000', MaxIfDepth = 
4131891356, MaxUnrollIterations = 32767, 
              OptimizeForAOS = 32 ' ', NirOptions = 0x7ffff0b4015d 
<__dlsym+93>}, {EmitCondCodes = 240 '\360', EmitNoLoops = 69 'E', 
EmitNoFunctions = 30 '\036', EmitNoCont = 1 '\001', EmitNoMainReturn = 0 
'\000', EmitNoNoise = 0 '\000', EmitNoPow = 0 '\000', EmitNoSat = 0 '\000', 
              LowerClipDistance = 240 '\360', EmitNoIndirectInput = 236 '\354', 
EmitNoIndirectOutput = 30 '\036', EmitNoIndirectTemp = 1 '\001', 
EmitNoIndirectUniform = 0 '\000', MaxIfDepth = 4097459048, MaxUnrollIterations 
= 32767, OptimizeForAOS = 240 '\360', 
              NirOptions = 0x7fffe0ced370 <__driDriverGetExtensions_r600>}}}
        api = API_OPENGLES
        version = 0
#5  0x00007ffff43a73b1 in dri2CreateScreen (screen=0, priv=0x1160f60) at 
../../../../src/glx/dri2_glx.c:1243
        driver_configs = 0x4
        extensions = <optimized out>
        pdp = 0x1162250
        psc = 0x1162400
        psp = <optimized out>
        configs = 0x0
        visuals = 0x0
        driverName = 0x1162e20 "r600"
        loader_driverName = <optimized out>
        deviceName = 0x11623b0 "/dev/dri/card0"
        tmp = <optimized out>
        magic = 3
        i = <optimized out>
---Type <return> to continue, or q <return> to quit---
#6  0x00007ffff437d154 in AllocAndFetchScreenConfigs (priv=0x1160f60, 
dpy=0x114c220) at ../../../../src/glx/glxext.c:796
        psc = <optimized out>
        i = 0
        screens = 1
#7  __glXInitialize (dpy=0x114c220) at ../../../../src/glx/glxext.c:907
        i = <optimized out>
        dpyPriv = 0x1160f60
        d = <optimized out>
        glx_direct = <optimized out>
        glx_accel = <optimized out>
        dpy = 0x114c220
        dpyPriv = <optimized out>
#8  0x00007ffff43789d1 in glXQueryVersion (dpy=<optimized out>, 
major=major@entry=0x7fffffffaab4, minor=minor@entry=0x7fffffffaab8) at 
../../../../src/glx/glxcmds.c:487
        priv = <optimized out>
#9  0x00007fffe41e213d in PsychOSOpenOnscreenWindow 
(screenSettings=screenSettings@entry=0x7fffffffc080, windowRecord=0x1160090, 
numBuffers=numBuffers@entry=2, stereomode=stereomode@entry=0, 
conserveVRAM=conserveVRAM@entry=0) at Linux/Screen/PsychWindowGlue.c:395
        windowTitle = "PTB Onscreen Window [10]:\000\000\000\000\000\000"
        screenrect = {6,9533490690450071e-310, 6,9533487282518644e-310, 
6,9533479393231969e-310, 2,515341373005088e+172}
        dpy = 0x114c220
        scrnum = 0
        attr = {background_pixmap = 121, background_pixel = 140737345074665, 
border_pixmap = 6616736, border_pixel = 7186066037675116288, bit_gravity = 
18435416, win_gravity = 0, backing_store = -143280310, backing_planes = 0, 
backing_pixel = 1, save_under = 0, 
          event_mask = 140737329510137, do_not_propagate_mask = 
140737331819416, override_redirect = 6490928, colormap = 6490928, cursor = 
7186066037675116288}
        mask = <optimized out>
        root = <optimized out>
        win = <optimized out>
        ctx = <optimized out>
        fbconfig = 0x0
        glxwindow = 0
        visinfo = 0x0
        i = <optimized out>
        x = <optimized out>
        y = <optimized out>
        width = <optimized out>
        height = <optimized out>
        nrconfigs = 0
        buffdepth = -156535912
        glerr = <optimized out>
        attrib = {-21472, 32767, 1, 0, 6490928, 0, 6490928, 0, 121, 0, -21472, 
32767, -16560, 32767, 6490912, 0, -16256, 32767, 2, 0, 0, 0, 0, 0, -16560, 
32767, -163075940, 32767, 0, 0, -467679488, 1673136380, 1701604096, 1919250025, 
6490912, 0, -16256, 32767, 6490912, 0, -16256}
        attribcount = 0
        stereoenableattrib = 0
        depth = 24
        bpc = <optimized out>
        windowLevel = 1249
        major = 0
        minor = 0
        xfixes_event_base1 = 87
        xfixes_event_base2 = 140
        xfixes_available = 1 '\001'
        newstyle_setup = 0 '\000'
        gpuMaintype = 0
        mwmHintsProperty = <optimized out>
        hints = {flags = 12522416, functions = 140737329338018, decorations = 
140737488333569, input_mode = 12522400, status = 140737488333856}
        crtc_info = 0x63ba08fce41fc700
        mode = <optimized out>

clear all

octave:3> clear all
[New Thread 0x7fffde215700 (LWP 4949)]

Breakpoint 2, radeon_winsys_unref (ws=0x11f0200) at radeon_drm_winsys.c:658
658     {
(gdb) bt full
#0  radeon_winsys_unref (ws=0x11f0200) at radeon_drm_winsys.c:658
        rws = <optimized out>
        destroy = <optimized out>
#1  0x00007fffe11ac256 in r600_destroy_screen (pscreen=0x11f0200) at 
r600_pipe.c:510
No locals.
#2  0x00007fffe0f4296f in dri_destroy_screen_helper 
(screen=screen@entry=0x11eef00) at dri_screen.c:365
No locals.
#3  0x00007fffe0f42a15 in dri_destroy_screen (sPriv=0x11eed20) at 
dri_screen.c:376
No locals.
#4  0x00007fffe0f3eb07 in driDestroyScreen (psp=0x11eed20) at dri_util.c:243
No locals.
#5  0x00007ffff43a6c92 in dri2DestroyScreen (base=0x1162400) at 
../../../../src/glx/dri2_glx.c:710
        psc = 0x1162400
#6  0x00007ffff437ccb6 in FreeScreenConfigs (priv=0x1160f60, priv=0x1160f60) at 
../../../../src/glx/glxext.c:214
        psc = 0x1162400
        i = <optimized out>
        screens = <optimized out>
#7  0x00007ffff437cd39 in glx_display_free (priv=priv@entry=0x1160f60) at 
../../../../src/glx/glxext.c:237
        gc = <optimized out>
#8  0x00007ffff437ce8e in __glXCloseDisplay (dpy=0x114c220, codes=<optimized 
out>) at ../../../../src/glx/glxext.c:285
        priv = 0x1160f60
        prev = <optimized out>
#9  0x00007ffff3dd05e2 in XCloseDisplay () from 
/usr/lib/x86_64-linux-gnu/libX11.so.6
No symbol table info available.
#10 0x00007fffe41ddf73 in PsychCleanupDisplayGlue () at 
Linux/Screen/PsychScreenGlue.c:1394
        dpy = 0x114c220
        last_dpy = 0x114c220
        i = 0
#11 0x00007fffe42392da in ScreenExitFunction () at Common/Screen/ScreenExit.c:40


TRACE on DRI3/Present:


PTB-INFO: Connected to Advanced Micro Devices, Inc. [AMD/ATI] Juniper XT 
[Radeon HD 5770] GPU with DCE-4 display engine [6 heads]. Beamposition 
timestamping enabled.                                                           
                                                           
                                                                                
                                                                                
                                                                                
                                           
Breakpoint 1, radeon_drm_winsys_create (fd=-517074139, 
screen_create=0x7fffe12e1337) at radeon_drm_winsys.c:678                        
                                                                                
                                                                    
678     {                                                                       
                                                                                
                                                                                
                                           
(gdb) bt full
#0  radeon_drm_winsys_create (fd=-517074139, screen_create=0x7fffe12e1337) at 
radeon_drm_winsys.c:678                                                         
                                                                                
                                             
No locals.                                                                      
                                                                                
                                                                                
                                           
#1  0x00007fffe0ced4fe in pipe_r600_create_screen (fd=5) at 
../../../../src/gallium/auxiliary/target-helpers/inline_drm_helper.h:209
        rw = 0x11de020
#2  dd_create_screen (fd=5) at 
../../../../src/gallium/auxiliary/target-helpers/inline_drm_helper.h:364
No locals.
#3  0x00007fffe0f44363 in dri2_init_screen (sPriv=0x11dde60) at dri2.c:1458
        configs = <optimized out>
        screen = 0x11de040
        pscreen = 0x0
        throttle_ret = 0x0
        dmabuf_ret = 0x0
#4  0x00007fffe0f3ecf1 in driCreateNewScreen2 (scrn=0, fd=5, 
extensions=<optimized out>, driver_extensions=<optimized out>, 
driver_configs=0x7fffffffa960, data=0x1162420) at dri_util.c:159
        emptyExtensionList = {0x0}
        psp = 0x11dde60
        consts = {MaxTextureMbytes = 24, MaxTextureLevels = 0, 
Max3DTextureLevels = 0, MaxCubeTextureLevels = 0, MaxArrayTextureLayers = 
2147483906, MaxTextureRectSize = 0, MaxTextureCoordUnits = 4294944832, 
MaxCombinedTextureImageUnits = 32767, MaxTextureUnits = 4097458806, 
          MaxTextureMaxAnisotropy = 4,59163468e-41, MaxTextureLodBias = 
-9,01278779e+33, MaxTextureBufferSize = 32767, TextureBufferOffsetAlignment = 
4294944336, MaxArrayLockSize = 32767, SubPixelBits = 509, MinPointSize = 0, 
MaxPointSize = 2,89675522e-38, MinPointSizeAA = 0, 
          MaxPointSizeAA = -1,15225159e+20, PointSizeGranularity = 
4,59163468e-41, MinLineWidth = -1,15333879e+20, MaxLineWidth = 4,59163468e-41, 
MinLineWidthAA = -9,01421514e+33, MaxLineWidthAA = 4,59163468e-41, 
LineWidthGranularity = 7,13260918e-43, MaxClipPlanes = 0, 
          MaxLights = 3771208328, MaxShininess = 4,59163468e-41, 
MaxSpotExponent = 2,89675522e-38, MaxViewportWidth = 0, MaxViewportHeight = 
4294944056, MaxViewports = 32767, ViewportSubpixelBits = 4294944052, 
ViewportBounds = {Min = 4,59163468e-41, Max = -nan(0x7fa5c8)}, 
          Program = {{MaxInstructions = 32767, MaxAluInstructions = 4294944208, 
MaxTexInstructions = 32767, MaxTexIndirections = 18734640, MaxAttribs = 0, 
MaxTemps = 0, MaxAddressRegs = 0, MaxAddressOffset = 4294944056, MaxParameters 
= 32767, MaxLocalParams = 2336646085, 
              MaxEnvParams = 0, MaxNativeInstructions = 36510095, 
MaxNativeAluInstructions = 0, MaxNativeTexInstructions = 5, 
MaxNativeTexIndirections = 32767, MaxNativeAttribs = 4294944272, MaxNativeTemps 
= 32767, MaxNativeAddressRegs = 3771208328, MaxNativeParameters = 32767, 
              MaxUniformComponents = 4294944052, MaxInputComponents = 32767, 
MaxOutputComponents = 4294944256, LowFloat = {RangeMin = 32767, RangeMax = 0, 
Precision = 11280}, MediumFloat = {RangeMin = 287, RangeMax = 0, Precision = 
0}, HighFloat = {RangeMin = 0, RangeMax = 0, 
                Precision = 0}, LowInt = {RangeMin = 0, RangeMax = 21, 
Precision = 0}, MediumInt = {RangeMin = 0, RangeMax = 0, Precision = 63152}, 
HighInt = {RangeMin = 61619, RangeMax = 0, Precision = 0}, MaxUniformBlocks = 
0, MaxCombinedUniformComponents = 0, 
              MaxTextureImageUnits = 27, MaxAtomicBuffers = 0, 
MaxAtomicCounters = 18725480, MaxImageUniforms = 0}, {MaxInstructions = 
4294944416, MaxAluInstructions = 32767, MaxTexInstructions = 0, 
MaxTexIndirections = 0, MaxAttribs = 2, MaxTemps = 0, MaxAddressRegs = 0, 
              MaxAddressOffset = 0, MaxParameters = 4294944488, MaxLocalParams 
= 32767, MaxEnvParams = 4158536705, MaxNativeInstructions = 32767, 
MaxNativeAluInstructions = 0, MaxNativeTexInstructions = 0, 
MaxNativeTexIndirections = 0, MaxNativeAttribs = 0, MaxNativeTemps = 2, 
              MaxNativeAddressRegs = 0, MaxNativeParameters = 0, 
MaxUniformComponents = 0, MaxInputComponents = 0, MaxOutputComponents = 0, 
LowFloat = {RangeMin = 46816, RangeMax = 285, Precision = 0}, MediumFloat = 
{RangeMin = 0, RangeMax = 63152, Precision = 61619}, HighFloat = {
                RangeMin = 32767, RangeMax = 0, Precision = 42468}, LowInt = 
{RangeMin = 65535, RangeMax = 32767, Precision = 0}, MediumInt = {RangeMin = 0, 
RangeMax = 0, Precision = 0}, HighInt = {RangeMin = 0, RangeMax = 47720, 
Precision = 285}, MaxUniformBlocks = 0, 
              MaxCombinedUniformComponents = 4294944272, MaxTextureImageUnits = 
32767, MaxAtomicBuffers = 98, MaxAtomicCounters = 0, MaxImageUniforms = 
18724576}, {MaxInstructions = 0, MaxAluInstructions = 4294944256, 
MaxTexInstructions = 32767, MaxTexIndirections = 18734640, 
              MaxAttribs = 0, MaxTemps = 2336646085, MaxAddressRegs = 0, 
MaxAddressOffset = 4294967295, MaxParameters = 0, MaxLocalParams = 2096, 
MaxEnvParams = 0, MaxNativeInstructions = 3771208184, MaxNativeAluInstructions 
= 32767, MaxNativeTexInstructions = 18724576, 
              MaxNativeTexIndirections = 0, MaxNativeAttribs = 30, 
MaxNativeTemps = 0, MaxNativeAddressRegs = 4158535602, MaxNativeParameters = 
32767, MaxUniformComponents = 2096, MaxInputComponents = 0, MaxOutputComponents 
= 4131417544, LowFloat = {RangeMin = 32767, RangeMax = 0, 
                Precision = 53248}, MediumFloat = {RangeMin = 63484, RangeMax = 
32767, Precision = 0}, HighFloat = {RangeMin = 42712, RangeMax = 65535, 
Precision = 32767}, LowInt = {RangeMin = 0, RangeMax = 42708, Precision = 
65535}, MediumInt = {RangeMin = 32767, RangeMax = 0, 
                Precision = 12608}, HighInt = {RangeMin = 63454, RangeMax = 
32767, Precision = 0}, MaxUniformBlocks = 4294958488, 
MaxCombinedUniformComponents = 32767, MaxTextureImageUnits = 4097223151, 
MaxAtomicBuffers = 32767, MaxAtomicCounters = 4097180992, 
              MaxImageUniforms = 32767}, {MaxInstructions = 18734640, 
MaxAluInstructions = 0, MaxTexInstructions = 4160532480, MaxTexIndirections = 
32767, MaxAttribs = 4160736448, MaxTemps = 32767, MaxAddressRegs = 0, 
MaxAddressOffset = 0, MaxParameters = 18724576, 
              MaxLocalParams = 0, MaxEnvParams = 4294944608, 
MaxNativeInstructions = 32767, MaxNativeAluInstructions = 4132672003, 
MaxNativeTexInstructions = 32767, MaxNativeTexIndirections = 2, 
MaxNativeAttribs = 0, MaxNativeTemps = 0, MaxNativeAddressRegs = 0, 
              MaxNativeParameters = 30, MaxUniformComponents = 0, 
MaxInputComponents = 4294945056, MaxOutputComponents = 32767, LowFloat = 
{RangeMin = 30, RangeMax = 0, Precision = 0}, MediumFloat = {RangeMin = 0, 
RangeMax = 2, Precision = 0}, HighFloat = {RangeMin = 32767, 
                RangeMax = 0, Precision = 1}, LowInt = {RangeMin = 0, RangeMax 
= 0, Precision = 0}, MediumInt = {RangeMin = 4600, RangeMax = 57544, Precision 
= 32767}, HighInt = {RangeMin = 0, RangeMax = 29, Precision = 0}, 
MaxUniformBlocks = 0, 
              MaxCombinedUniformComponents = 4294945056, MaxTextureImageUnits = 
32767, MaxAtomicBuffers = 18734528, MaxAtomicCounters = 0, MaxImageUniforms = 
4132497260}}, MaxProgramMatrices = 32767, MaxProgramMatrixStackDepth = 
4222451712, QueryCounterBits = {
            SamplesPassed = 32767, TimeElapsed = 18734528, Timestamp = 0, 
PrimitivesGenerated = 18734528, PrimitivesWritten = 0, VerticesSubmitted = 
18734528, PrimitivesSubmitted = 0, VsInvocations = 18734528, TessPatches = 0, 
TessInvocations = 4294944992, GsInvocations = 32767, 
            GsPrimitives = 4294944992, FsInvocations = 32767, 
ComputeInvocations = 5, ClInPrimitives = 0, ClOutPrimitives = 725}, 
MaxDrawBuffers = 0, MaxColorAttachments = 18228256, MaxRenderbufferSize = 0, 
MaxSamples = 4038328544, MaxVarying = 32767, 
          MaxCombinedUniformBlocks = 4038328564, MaxUniformBufferBindings = 
32767, MaxUniformBlockSize = 0, UniformBufferOffsetAlignment = 0, 
MaxUserAssignableUniformLocations = 4158559332, MaxGeometryOutputVertices = 
32767, MaxGeometryTotalOutputComponents = 4160532480, 
          GLSLVersion = 4, ForceGLSLExtensionsWarn = 88 'X', ForceGLSLVersion = 
32767, AllowGLSLExtensionDirectiveMidShader = 0 '\000', NativeIntegers = 0 
'\000', VertexID_is_zero_based = false, UniformBooleanTrue = 0, 
MaxServerWaitTimeout = 8895248, 
          QuadsFollowProvokingVertexConvention = 24 '\030', ContextFlags = 0, 
ProfileMask = 8895240, MaxVertexAttribStride = 0, MaxTransformFeedbackBuffers = 
4038328544, MaxTransformFeedbackSeparateComponents = 32767, 
MaxTransformFeedbackInterleavedComponents = 4294944992, 
          MaxVertexStreams = 32767, MinProgramTexelOffset = 8895232, 
MaxProgramTexelOffset = 0, MinProgramTextureGatherOffset = 8895248, 
MaxProgramTextureGatherOffset = 0, MaxProgramTextureGatherComponents = 8895256, 
ResetStrategy = 0, MaxDualSourceDrawBuffers = 8895240, 
          StripTextureBorder = 0 '\000', GLSLSkipStrictMaxUniformLimitCheck = 0 
'\000', AlwaysUseGetTransformFeedbackVertexCount = 0 '\000', 
MinMapBufferAlignment = 4294944708, DisableVaryingPacking = 255 '\377', 
GenerateTemporaryNames = 127, MaxElementIndex = 0, 
          DisableGLSLLineContinuations = 133 '\205', MaxColorTextureSamples = 
701763944, MaxDepthTextureSamples = -22304, MaxIntegerSamples = 32767, 
SampleMap2x = "\005", SampleMap4x = "\000\000\000", SampleMap8x = 
"\000\000\325\002\000\000\000", 
          MaxAtomicBufferBindings = 18228256, MaxAtomicBufferSize = 0, 
MaxCombinedAtomicBuffers = 4024415877, MaxCombinedAtomicCounters = 701763583, 
MaxVertexAttribRelativeOffset = -2005027195, MaxVertexAttribBindings = 
701767613, MaxImageUnits = 725, 
          MaxCombinedImageUnitsAndFragmentOutputs = 0, MaxImageSamples = 
18228256, MaxCombinedImageUniforms = 0, MaxComputeWorkGroupCount = {4132496930, 
32767, 0}, MaxComputeWorkGroupSize = {0, 24, 48}, 
MaxComputeWorkGroupInvocations = 4294945056, 
          MinFragmentInterpolationOffset = 4,59163468e-41, 
MaxFragmentInterpolationOffset = -nan(0x7fa860), FakeSWMSAA = 255 '\377', 
ContextReleaseBehavior = 1818322735, ShaderCompilerOptions = {{EmitCondCodes = 
176 '\260', EmitNoLoops = 97 'a', EmitNoFunctions = 64 '@', 
              EmitNoCont = 246 '\366', EmitNoMainReturn = 255 '\377', 
EmitNoNoise = 127 '\177', EmitNoPow = 0 '\000', EmitNoSat = 0 '\000', 
LowerClipDistance = 224 '\340', EmitNoIndirectInput = 182 '\266', 
EmitNoIndirectOutput = 29 '\035', EmitNoIndirectTemp = 1 '\001', 
              EmitNoIndirectUniform = 0 '\000', MaxIfDepth = 4097676651, 
MaxUnrollIterations = 32767, OptimizeForAOS = 0 '\000', NirOptions = 
0x7ffff0b40090 <dlclose_doit>}, {EmitCondCodes = 207 '\317', EmitNoLoops = 5 
'\005', EmitNoFunctions = 192 '\300', EmitNoCont = 52 '4', 
              EmitNoMainReturn = 0 '\000', EmitNoNoise = 0 '\000', EmitNoPow = 
0 '\000', EmitNoSat = 0 '\000', LowerClipDistance = 224 '\340', 
EmitNoIndirectInput = 182 '\266', EmitNoIndirectOutput = 29 '\035', 
EmitNoIndirectTemp = 1 '\001', EmitNoIndirectUniform = 0 '\000', 
              MaxIfDepth = 3771650928, MaxUnrollIterations = 32767, 
OptimizeForAOS = 80 'P', NirOptions = 0x5}, {EmitCondCodes = 213 '\325', 
EmitNoLoops = 2 '\002', EmitNoFunctions = 0 '\000', EmitNoCont = 0 '\000', 
EmitNoMainReturn = 0 '\000', EmitNoNoise = 0 '\000', 
              EmitNoPow = 0 '\000', EmitNoSat = 0 '\000', LowerClipDistance = 
32 ' ', EmitNoIndirectInput = 36 '$', EmitNoIndirectOutput = 22 '\026', 
EmitNoIndirectTemp = 1 '\001', EmitNoIndirectUniform = 0 '\000', MaxIfDepth = 
4131891356, MaxUnrollIterations = 32767, 
              OptimizeForAOS = 80 'P', NirOptions = 0x7ffff0b4015d 
<__dlsym+93>}, {EmitCondCodes = 224 '\340', EmitNoLoops = 182 '\266', 
EmitNoFunctions = 29 '\035', EmitNoCont = 1 '\001', EmitNoMainReturn = 0 
'\000', EmitNoNoise = 0 '\000', EmitNoPow = 0 '\000', 
              EmitNoSat = 0 '\000', LowerClipDistance = 48 '0', 
EmitNoIndirectInput = 222 '\336', EmitNoIndirectOutput = 29 '\035', 
EmitNoIndirectTemp = 1 '\001', EmitNoIndirectUniform = 0 '\000', MaxIfDepth = 
4097459048, MaxUnrollIterations = 32767, OptimizeForAOS = 224 '\340', 
              NirOptions = 0x7fffe0ced370 <__driDriverGetExtensions_r600>}}}
        api = API_OPENGLES
        version = 0
#5  0x00007ffff43ac2f1 in dri3_create_screen (screen=0, priv=<optimized out>) 
at ../../../../src/glx/dri3_glx.c:1961
        c = <optimized out>
        driver_configs = 0x1162400
        extensions = <optimized out>
        pdp = 0x11621d0
        psc = 0x1162420
        psp = <optimized out>
        configs = 0x0
        visuals = 0x0
        driverName = 0x1162e00 "r600"
        deviceName = 0x0
        tmp = <optimized out>
        i = <optimized out>
#6  0x00007ffff437d121 in AllocAndFetchScreenConfigs (priv=0x1160f80, 
dpy=0x114c400) at ../../../../src/glx/glxext.c:793
---Type <return> to continue, or q <return> to quit---
        psc = 0x0
        i = 0
        screens = 1
#7  __glXInitialize (dpy=0x114c400) at ../../../../src/glx/glxext.c:907
        i = <optimized out>
        dpyPriv = 0x1160f80
        d = <optimized out>
        glx_direct = <optimized out>
        glx_accel = <optimized out>
        dpy = 0x114c400
        dpyPriv = <optimized out>
#8  0x00007ffff43789d1 in glXQueryVersion (dpy=<optimized out>, 
major=major@entry=0x7fffffffaab4, minor=minor@entry=0x7fffffffaab8) at 
../../../../src/glx/glxcmds.c:487
        priv = <optimized out>
#9  0x00007fffe41e213d in PsychOSOpenOnscreenWindow 
(screenSettings=screenSettings@entry=0x7fffffffc080, windowRecord=0x11600b0, 
numBuffers=numBuffers@entry=2, stereomode=stereomode@entry=0, 
conserveVRAM=conserveVRAM@entry=0) at Linux/Screen/PsychWindowGlue.c:395
        windowTitle = "PTB Onscreen Window [10]:\000\000\000\000\000\000"
        screenrect = {6,9533490690450071e-310, 6,9533487282518644e-310, 
6,9533479393231969e-310, 1,5586514507704953e+164}
        dpy = 0x114c400
        scrnum = 0
        attr = {background_pixmap = 121, background_pixel = 140737345074665, 
border_pixmap = 6616736, border_pixel = 7063235439763141888, bit_gravity = 
18435048, win_gravity = 0, backing_store = -143280310, backing_planes = 0, 
backing_pixel = 1, save_under = 0, 
          event_mask = 140737329510137, do_not_propagate_mask = 
140737331819416, override_redirect = 6490928, colormap = 6490928, cursor = 
7063235439763141888}
        mask = <optimized out>
        root = <optimized out>
        win = <optimized out>
        ctx = <optimized out>
        fbconfig = 0x0
        glxwindow = 0
        visinfo = 0x0
        i = <optimized out>
        x = <optimized out>
        y = <optimized out>
        width = <optimized out>
        height = <optimized out>
        nrconfigs = 0
        buffdepth = -156535912
        glerr = <optimized out>
        attrib = {-21472, 32767, 1, 0, 6490928, 0, 6490928, 0, 121, 0, -21472, 
32767, -16560, 32767, 6490912, 0, -16256, 32767, 2, 0, 0, 0, 0, 0, -16560, 
32767, -163075940, 32767, 0, 0, -1207421696, 1644537653, 1701604096, 
1919250025, 6490912, 0, -16256, 32767, 6490912, 0, -16256}
        attribcount = 0
        stereoenableattrib = 0
        depth = 24
        bpc = <optimized out>
        windowLevel = 1249
        major = 0
        minor = 0
        xfixes_event_base1 = 87
        xfixes_event_base2 = 140
        xfixes_available = 1 '\001'
        newstyle_setup = 0 '\000'
        gpuMaintype = 0
        mwmHintsProperty = <optimized out>
        hints = {flags = 12522784, functions = 140737329338018, decorations = 
140737488333569, input_mode = 12522768, status = 140737488333856}
        crtc_info = 0x6205a735b8083500

        
        
clear all

octave:3> clear all
[New Thread 0x7fffde215700 (LWP 5534)]

Breakpoint 2, radeon_winsys_unref (ws=0x11de350) at radeon_drm_winsys.c:658
658     {
(gdb) bt full
#0  radeon_winsys_unref (ws=0x11de350) at radeon_drm_winsys.c:658
        rws = <optimized out>
        destroy = <optimized out>
#1  0x00007fffe11ac256 in r600_destroy_screen (pscreen=0x11de350) at 
r600_pipe.c:510
No locals.
#2  0x00007fffe0f4296f in dri_destroy_screen_helper 
(screen=screen@entry=0x11de040) at dri_screen.c:365
No locals.
#3  0x00007fffe0f42a15 in dri_destroy_screen (sPriv=0x11dde60) at 
dri_screen.c:376
No locals.
#4  0x00007fffe0f3eb07 in driDestroyScreen (psp=0x11dde60) at dri_util.c:243
No locals.
#5  0x00007ffff43aade2 in dri3_destroy_screen (base=0x1162420) at 
../../../../src/glx/dri3_glx.c:1694
        psc = 0x1162420
#6  0x00007ffff437ccb6 in FreeScreenConfigs (priv=0x1160f80, priv=0x1160f80) at 
../../../../src/glx/glxext.c:214
        psc = 0x1162420
        i = <optimized out>
        screens = <optimized out>
#7  0x00007ffff437cd39 in glx_display_free (priv=priv@entry=0x1160f80) at 
../../../../src/glx/glxext.c:237
        gc = <optimized out>
#8  0x00007ffff437ce8e in __glXCloseDisplay (dpy=0x114c400, codes=<optimized 
out>) at ../../../../src/glx/glxext.c:285
        priv = 0x1160f80
        prev = <optimized out>
#9  0x00007ffff3dd05e2 in XCloseDisplay () from 
/usr/lib/x86_64-linux-gnu/libX11.so.6
No symbol table info available.
#10 0x00007fffe41ddf73 in PsychCleanupDisplayGlue () at 
Linux/Screen/PsychScreenGlue.c:1394
        dpy = 0x114c400
        last_dpy = 0x114c400
        i = 0
#11 0x00007fffe42392da in ScreenExitFunction () at Common/Screen/ScreenExit.c:40
No locals.
#12 0x00007fffe4275e00 in PsychExit () at Common/Base/PsychInit.c:65
        projectExit = <optimized out>



_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to