Skip to contentSkip to conversation

New: SDL applications crash when changing video mode: double free or corruption

Bug 82279 [email protected] 1 participant 11 messages Aug 7, 2014 – Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=82279

Priority: medium
Bug ID: 82279
Assignee: [email protected]
Summary: SDL applications crash when changing video mode:
double free or corruption
Severity: normal
Classification: Unclassified
OS: Linux (All)
Reporter: [email protected]
Hardware: x86-64 (AMD64)
Status: NEW
Version: git
Component: Drivers/Gallium/radeonsi
Product: Mesa

Created attachment 104195
--> https://bugs.freedesktop.org/attachment.cgi?id=104195&action=edit
GDB backtrace of Dosbox crash.

Overview:
SDL applications crash when changing video mode, "corrupted double-linked
list" and "double free or corruption" are printed to stderr. The applications tested are Dosbox and Enemy Territory: Quake Wars.

Steps to reproduce:
1) Install an abandonware game such as Commander Keen 4
2) Run it in Dosbox
3) Depending on the game, press a key to start the game proper

Actual results:
The application crashes upon changing video mode.

Expected results:
The application changes video mode without causing a crash.

Build date and platform:
Build date of all components: 2014-08-07
Platform: Gentoo GNU/Linux x86_64
Linux kernel version: 3.16

Additional information:
Bisecting revealed the culprit commit to be
"58d2afa2232060b88f9c444ce7a0d6e63c841bb2: radeonsi: fix leaking the bound state on destruction v2". See attachments for backtraces.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

[Bug 82279] SDL applications crash when changing video mode: double free or corruption

https://bugs.freedesktop.org/show_bug.cgi?id=82279

--- Comment #1 from Remco Zoet <[email protected]> --- Created attachment 104196
--> https://bugs.freedesktop.org/attachment.cgi?id=104196&action=edit
GDB full backtrace of Dosbox crash.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

[Bug 82279] SDL applications crash when changing video mode: double free or corruption

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=82279

Remco Zoet <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
Keywords| |bisected

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

[Bug 82279] [bisected] SDL applications crash when changing video mode: double free or corruption

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=82279

Remco Zoet <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

            Summary|SDL applications crash when |[bisected] SDL applications
                   |changing video mode: double |crash when changing video
                   |free or corruption          |mode: double free or
                   |                            |corruption
Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw

[Bug 82279] [bisected] SDL applications crash when changing video mode: double free or corruption

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=82279

--- Comment #2 from Remco Zoet <[email protected]> ---
Some additional information: the crash (obviously) only occurs when Dosbox uses opengl rendering. For this, 'output=opengl' or 'output=openglnb' needs to be set in ~/${USER}/.dosbox/dosbox-${VERSION}.conf.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

[Bug 82279] SDL applications crash when changing video mode: double free or corruption

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=82279

Remco Zoet <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

            Summary|[bisected] SDL applications |SDL applications crash when
                   |crash when changing video   |changing video mode: double
                   |mode: double free or        |free or corruption
                   |corruption                  |
Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

[Bug 82279] SDL applications crash when changing video mode on radeonsi: double free or corruption

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=82279

Remco Zoet <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

            Summary|SDL applications crash when |SDL applications crash when
                   |changing video mode: double |changing video mode on
                   |free or corruption          |radeonsi: double free or
                   |                            |corruption
Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw

[Bug 82279] [bisected] double free or corruption on context destruction with postprocessing enabled

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=82279

Michel Dänzer <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

                 CC|                            |[email protected]
            Summary|SDL applications crash when |[bisected] double free or
                   |changing video mode on      |corruption on context
                   |radeonsi: double free or    |destruction with
                   |corruption                  |postprocessing enabled

--- Comment #3 from Michel Dänzer <[email protected]> --- AFAICT this only happens if postprocessing is enabled via one of the pp_* driconf options or environment variables.

(In reply to comment #0)

Quoted 3 lines

Bisecting revealed the culprit commit to be
"58d2afa2232060b88f9c444ce7a0d6e63c841bb2: radeonsi: fix leaking the bound state on destruction v2".

Christian, any ideas?

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw

[Bug 82279] [bisected] double free or corruption on context destruction with postprocessing enabled

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=82279

--- Comment #4 from Christian König <[email protected]> --- (In reply to comment #3)

Quoted 9 lines

AFAICT this only happens if postprocessing is enabled via one of the pp_* driconf options or environment variables.

(In reply to comment #0)

Quoted 3 lines

Bisecting revealed the culprit commit to be
"58d2afa2232060b88f9c444ce7a0d6e63c841bb2: radeonsi: fix leaking the bound state on destruction v2".

Christian, any ideas?

That looks like a bug in the post processing cleanup to me. The context the shaders belong to is destroyed before pp_free is called to destroy the shaders created from that context.

Since the bisected patch explicitly destroys all bound shaders of a context if the context is destroyed we get a double free of the shader.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw

[Bug 82279] [bisected] double free or corruption on context destruction with postprocessing enabled

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=82279

--- Comment #5 from Remco Zoet <[email protected]> ---
I can now confirm that the crash only occurs with postprocessing enabled through driconf. Apparently, there was still a .drirc present on my /home partition from an earlier installation that had the 'pp_jimenezmlaa' and 'force_s3tc_enable' options enabled. Resetting .drirc to defaults allows me to run all SDL applications normally.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw

[Bug 82279] [bisected] double free or corruption on context destruction with postprocessing enabled

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=82279

Christian König <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #6 from Christian König <[email protected]> --- I think that issue is fixed by now. Any objections to closing this bug?

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel