This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug sanitizer/77963] New: inconsistent (false?) leaks detection.


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77963

            Bug ID: 77963
           Summary: inconsistent (false?) leaks detection.
           Product: gcc
           Version: 6.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pawel_sikora at zoho dot com
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
  Target Milestone: ---

Created attachment 39800
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39800&action=edit
testcase

hi,

i've observed that running application under gdb/ltrace/strace reports strange
memory leaks, e.g:

% make
g++ -Wall -g2 s.cpp -fsanitize=address -Og -shared -fPIC -o s.so -lboost_thread
g++ -Wall -g2 m.cpp -fsanitize=address -Og -o m ./s.so -ldl

[pawels@pawels]~/ssd/leaks% ./m; echo $?
0

[pawels@pawels]~/ssd/leaks% ltrace ./m  
__asan_init(1, 0x7ffddcdce888, 0x7ffddcdce898, 0x7f833ad36540)                 
                                                  = 0
__libc_start_main([ "./m" ] <unfinished ...>
__asan_init(1, 0x7ffddcdce888, 0x7ffddcdce898, 0) = 0
__asan_version_mismatch_check_v6(1, 0x7ffddcdce888, 0x7ffddcdce898, 0) = 0
__asan_register_globals(0x601080, 2, 0x7ffddcdce898, 0) = 0
dlopen("./s.so", 1) = 0x7f833cbabb18
dlsym(0x7f833cbabb18, "foo") = 0x7f833b7e4d20
dlclose(0x7f833cbabb18) = 0
__asan_unregister_globals(0x601080, 2, 0, 1) = 0x80078140

=================================================================
==4777==ERROR: LeakSanitizer: detected memory leaks

Indirect leak of 440 byte(s) in 1 object(s) allocated from:
    #0 0x7f833baaeea0 in operator new(unsigned long)
(/lib64/libasan.so.3+0xc7ea0)
    #1 0x7f833a33a83d in boost::detail::make_external_thread_data()
(/lib64/libboost_thread.so.1.60.0+0x1283d)

Indirect leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7f833baaeea0 in operator new(unsigned long)
(/lib64/libasan.so.3+0xc7ea0)
    #1 0x7f833a33a9e9 in boost::detail::make_external_thread_data()
(/lib64/libboost_thread.so.1.60.0+0x129e9)

SUMMARY: AddressSanitizer: 464 byte(s) leaked in 2 allocation(s).
+++ exited (status 1) +++

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]