Bug 93626 - Several memory leaks for utest_run
Summary: Several memory leaks for utest_run
Status: RESOLVED MOVED
Alias: None
Product: Beignet
Classification: Unclassified
Component: Beignet (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Xiuli Pan
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-07 12:39 UTC by Frank Dittrich
Modified: 2018-10-12 21:26 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Frank Dittrich 2016-01-07 12:39:19 UTC
This is with latest beignet (commit fc410ee2d6138bac821fe20a0d35c3b283244071) and the patch mentioned in https://bugs.freedesktop.org/show_bug.cgi?id=93625.

I built beignet with adddress sanitizer support (-fsanitize=address) and then in the utests/ directory ran

$ . setenv.sh
$ ./utest_run

At the end of that test, several memory leaks (direct and indirect) are reported.

Here are some examples of beignet memory leaks:

=================================================================
==12727==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 262144 byte(s) in 1 object(s) allocated from:
    #0 0x7f68854b196a in malloc (/lib64/libasan.so.2+0x9896a)
    #1 0x7f688502191c in image_1D_buffer() /home/fd/git/beignet/utests/image_1D_buffer.cpp:7

Direct leak of 119280 byte(s) in 2485 object(s) allocated from:
    #0 0x7f68854b2872 in operator new(unsigned long) (/lib64/libasan.so.2+0x99872)
    #1 0x7f687c0aca8a in gbe::PrintfParser::runOnFunction(llvm::Function&) /home/fd/git/beignet/backend/src/llvm/llvm_printf_parser.cpp:543
    #2 0x7f687d0c38d1 in llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/fd/git/beignet/build/backend/src/libgbe.so+0x15958d1)

Direct leak of 8192 byte(s) in 1 object(s) allocated from:
    #0 0x7f68854b196a in malloc (/lib64/libasan.so.2+0x9896a)
    #1 0x7f6885024314 in compare_image_2d_and_1d_array /home/fd/git/beignet/utests/compare_image_2d_and_1d_array.cpp:20

Direct leak of 8192 byte(s) in 1 object(s) allocated from:
    #0 0x7f68854b196a in malloc (/lib64/libasan.so.2+0x9896a)
    #1 0x7f6885024323 in compare_image_2d_and_1d_array /home/fd/git/beignet/utests/compare_image_2d_and_1d_array.cpp:21

Direct leak of 7952 byte(s) in 36 object(s) allocated from:
    #0 0x7f68854b1b09 in __interceptor_calloc (/lib64/libasan.so.2+0x98b09)
    #1 0x7f68848fa245 in cl_calloc /home/fd/git/beignet/src/cl_alloc.c:54

Direct leak of 2737 byte(s) in 1 object(s) allocated from:
    #0 0x7f68854b196a in malloc (/lib64/libasan.so.2+0x9896a)
    #1 0x7f6884fb8238 in runtime_compile_link() /home/fd/git/beignet/utests/runtime_compile_link.cpp:82
    #2 0x7f68850e489f  (/home/fd/git/beignet/build/utests/libutests.so+0x54f89f)

Direct leak of 2048 byte(s) in 1 object(s) allocated from:
    #0 0x7f68854b1b09 in __interceptor_calloc (/lib64/libasan.so.2+0x98b09)
    #1 0x7f68850256b0 in compiler_fill_image_1d_array /home/fd/git/beignet/utests/compiler_fill_image_1d_array.cpp:34
    #2 0x7fff5ce299af  (<unknown module>)

Direct leak of 732 byte(s) in 1 object(s) allocated from:
    #0 0x7f68854b196a in malloc (/lib64/libasan.so.2+0x9896a)
    #1 0x7f6884cca8cf in enqueue_built_in_kernels() /home/fd/git/beignet/utests/enqueue_built_in_kernels.cpp:12
    #2 0x7f6885047617  (/home/fd/git/beignet/build/utests/libutests.so+0x4b2617)
Comment 1 rongyang 2016-04-29 02:41:23 UTC
Hi, Xiuli,
    Please help to check it.
Comment 2 Xiuli Pan 2016-05-05 06:44:16 UTC
Hi Frank,

I have fixed all memleak in utest with a stand alone build utest:
https://lists.freedesktop.org/archives/beignet/2016-May/007502.html

Thanks
Xiuli
Comment 3 GitLab Migration User 2018-10-12 21:26:15 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/beignet/beignet/issues/57.


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.