Bug 105283

Summary: Does backend shader compiler caused a memory leak in driver?
Product: Mesa Reporter: Jiancong <94389147>
Component: Drivers/DRI/i965Assignee: Intel 3D Bugs Mailing List <intel-3d-bugs>
Status: RESOLVED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: major    
Priority: medium CC: danylo.piliaiev
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: The report of memory leak.

Description Jiancong 2018-02-28 03:38:52 UTC
Hi

We're testing a famous android application on a lxc based android container named anbox(http://anbox.io). The test case will open/close the android app and run some actions repeatedly. After testing 24 hours, the memory is increasing dramatically.

When I ran valgrind to check memory leaks, the whole application becomes slowly running, and I have to manually check the case and only run a fewer rounds. 

There are many points show 'definitely' leaks, and the most leaking bytes and valuable one is following,

==17019== 4,208 bytes in 26 blocks are definitely lost in loss record 4,191 of 5,088
==17019==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==17019==    by 0x11BA013C: ralloc_size (ralloc.c:121)
==17019==    by 0x11BA021D: rzalloc_size (ralloc.c:153)
==17019==    by 0x11E4F1C1: fs_visitor::assign_constant_locations() (brw_fs.cpp:2186)
==17019==    by 0x11E59DAB: fs_visitor::optimize() (brw_fs.cpp:5907)
==17019==    by 0x11E5B747: fs_visitor::run_vs() (brw_fs.cpp:6190)
==17019==    by 0x11ED41BF: brw_compile_vs (brw_vec4.cpp:2863)
==17019==    by 0x11CC23BC: brw_codegen_vs_prog (brw_vs.c:222)
==17019==    by 0x11CC2F28: brw_vs_precompile (brw_vs.c:379)
==17019==    by 0x11CB4ECA: brw_shader_precompile (brw_link.cpp:65)
==17019==    by 0x11CB4ECA: brw_link_shader (brw_link.cpp:362)
==17019==    by 0x11AF354D: _mesa_glsl_link_shader (ir_to_mesa.cpp:3126)
==17019==    by 0x11A00E02: link_program (shaderapi.c:1203)
==17019==    by 0x11A00E02: link_program_error (shaderapi.c:1281)

Does this relate to driver issue?
Comment 1 Jiancong 2018-02-28 06:22:20 UTC
Created attachment 137683 [details]
The report of memory leak.

The report of memory leak in our test case.
Comment 2 Danylo 2018-06-29 08:18:51 UTC
Hello,
I believe most leaks were fixed, there was a bug https://bugs.freedesktop.org/show_bug.cgi?id=104884 which looks similar to this and changes were made to fix it around the time your bug was created.
Comment 3 Dylan Baker 2018-08-15 21:13:50 UTC
I'm going to mark this as fixed since there was no response to the last request for confirmation. Please re-open if you can reproduce with either the current release or current git.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.