Skip to content

Commit 36127e6

Browse files
author
Anton Ivanov
committed
Explicitly include libgui as a shared library in libgui_test.
Currently, libgui is compiled statically into the test binary by virtue of `src` attribute of `libgui-defaults`, and also loaded as a shared library by transitive dependency. This leads to double-delete and use-after-delete issues in the test on global mutexes defined by android::Singleton<>. Flag: EXEMPT refactor Test: presubmit Bug: 399711310 Change-Id: I31408237f345632bfd8f2d2ac880dfac53e75ae4
1 parent 851a6d2 commit 36127e6

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

libs/gui/Android.bp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ filegroup {
295295
cc_defaults {
296296
name: "libgui-defaults",
297297
defaults: ["libgui_bufferqueue-defaults"],
298-
srcs: [":libgui-sources"],
299298
static_libs: [
300299
"libgui_aidl_static",
301300
"libgui_window_info_static",
@@ -319,6 +318,10 @@ cc_library_shared {
319318
"libgui-defaults",
320319
],
321320

321+
srcs: [
322+
":libgui-sources",
323+
],
324+
322325
export_static_lib_headers: [
323326
"libgui_aidl_static",
324327
"libgui_window_info_static",

libs/gui/tests/Android.bp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ cc_test {
100100
"android.hardware.configstore-utils",
101101
"libSurfaceFlingerProp",
102102
"libGLESv1_CM",
103+
"libgui",
103104
"libgui_test_server_aidl-cpp",
104105
"libinput",
105106
"libnativedisplay",

0 commit comments

Comments
 (0)