From b98d79b561791459dd6bfb0fed5dc7462a1a09a7 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 30 Mar 2016 18:22:21 +0200 Subject: Fix crashes due to qputenv being called after Chromium initialization. The qputenv() call inside gl_surface_qt.cpp, which is executed on a GpuChildThread, can reallocate the process environment structure, and it is possible that at the same time the main thread calls getenv, which will dereference a pointer to the freed environment structure, essentially causing a use-after-free crash. Make sure the qputenv() call happens before Chromium initialization starts, so no thread-race can occur. Change-Id: I4ecbdc8bf2abbe45f7d6c5d2633dc9fe27f51e66 Task-number: QTBUG-52124 Reviewed-by: Allan Sandfeld Jensen Reviewed-by: Kai Koehne (cherry picked from commit 76c61aa1400ef2def204c3732e30e08e40631e8d) --- src/core/gl_surface_qt.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/core/gl_surface_qt.cpp') diff --git a/src/core/gl_surface_qt.cpp b/src/core/gl_surface_qt.cpp index 86bb4fda9..7596fcaff 100644 --- a/src/core/gl_surface_qt.cpp +++ b/src/core/gl_surface_qt.cpp @@ -171,9 +171,6 @@ bool GLSurfaceQtGLX::InitializeOneOff() if (initialized) return true; - // http://crbug.com/245466 - qputenv("force_s3tc_enable", "true"); - XInitThreads(); g_display = GLContextHelper::getXDisplay(); -- cgit v1.2.3