Fix for heap-use-after-free in GPUService.cpp
This adds a unit test and fix for the bug reported by libfuzzer.
Changes made:
* Expose GPUService as testable code.
* Update main_gpuservice.cpp to use the new GpuService now located at
gpuservice/GpuService.h
* Make initializer threads members of GpuService
* Join the threads in destructor to prevent heap-use-after-free.
* Add unit test that waits 3 seconds after deallocation to ensure no
wrong access is made.
Bug: 282919145
Test: Added unit test and ran on device with ASAN
Change-Id: I4d1d2d4658b575bf2c8f425f91f68f03114ad029
diff --git a/services/gpuservice/Android.bp b/services/gpuservice/Android.bp
index fba64c7..052efb6b 100644
--- a/services/gpuservice/Android.bp
+++ b/services/gpuservice/Android.bp
@@ -71,6 +71,7 @@
cc_library_shared {
name: "libgpuservice",
defaults: ["libgpuservice_production_defaults"],
+ export_include_dirs: ["include"],
srcs: [
":libgpuservice_sources",
],