[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#567677: Server sometimes crashes when closing OpenGL programs



Random guess: Could be related to
http://cgit.freedesktop.org/xorg/xserver/commit/?id=711e26466ae04ae93ff4c48d377d83d68a6320e9
?

Brice



Patrik Olsson wrote:
> Source: xorg-server
> Version: 2:1.7.4-2
> Severity: important
>
> In about 1 of 5 times that I close OpenGL programs (that I have
> written), the X server crashes. It doesn't seem to happen when I kill or
> "^C" them, though. It is likely the programs are misbehaving (for
> example, I currently don't clean up all X and GLX resources before exit,
> and maybe I mix both new and old GLX api). I don't have the problem with
> other OpenGL programs I have tested such as glxgears or glxinfo. I any
> case, I don't think the server should crash, no matter whether
> programs/clients are misbehaving or not. Also, I should mention that in
> previous versions of the server, I didn't have the problem.
>
> I attached to the process with gdb and below is a debug log (with
> prompts). pScreen in #2 was optimized out so I got it from #3 instead.
>
> pDraw at #3 is probably a freed pointer. Thus its pScreen field is
> undefined/arbitrary and in this case was 0x1 which made 'privates' in #0
> a pointer a bit higher (because implicitly, #2 will find 'privates' by
> adding the field offset to the pScreen pointer, see the source code at
> that part). Thus in the end it uses an invalid pointer of value 0x151
> for 'privates'.
>
> pDraw should not be freed until DRI2DestroyDrawable etc. has been called
> with it. Considering it is only sometimes that the server crashes I
> would guess there is a race condition.
>
> Of course, there is also the possibility that pScreen has been set to 1
> at some point. In other words, I'm not entirely sure if the pDraw
> pointer is freed, as I know not how to check that.
>   




Reply to: