public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/61604] New: missing line numbers in a sanitizer backtrace from an OMP region
@ 2014-06-25 11:24 Joost.VandeVondele at mat dot ethz.ch
  2014-06-26  7:42 ` [Bug sanitizer/61604] " Joost.VandeVondele at mat dot ethz.ch
  2014-12-06  9:06 ` Joost.VandeVondele at mat dot ethz.ch
  0 siblings, 2 replies; 3+ messages in thread
From: Joost.VandeVondele at mat dot ethz.ch @ 2014-06-25 11:24 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61604
           Summary: missing line numbers in a sanitizer backtrace from an
                    OMP region
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Joost.VandeVondele at mat dot ethz.ch
                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

as an example, the following program with leak:

> cat test.f90
SUBROUTINE S1()
  INTEGER, POINTER, DIMENSION(:) :: a
!$OMP PARALLEL DEFAULT(PRIVATE)
  ALLOCATE(a(100))
!$OMP END PARALLEL
END SUBROUTINE

PROGRAM TEST
 CALL S1()
END PROGRAM TEST

yields:
> gfortran -O1 -g3 -fno-omit-frame-pointer -fsanitize=leak -fopenmp test.f90 ; export OMP_NUM_THREADS=2 ; ./a.out

=================================================================
==22952==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 400 byte(s) in 1 object(s) allocated from:
    #0 0x7f3b6d8ce1bc in __interceptor_malloc
../../../../gcc/libsanitizer/lsan/lsan_interceptors.cc:66
    #1 0x400865 in s1_._omp_fn.0 (/data/vjoost/gnu/bugs/a.out+0x400865)
    #2 0x7f3b6e52463e in GOMP_parallel ../../../gcc/libgomp/parallel.c:167

Direct leak of 400 byte(s) in 1 object(s) allocated from:
    #0 0x7f3b6d8ce1bc in __interceptor_malloc
../../../../gcc/libsanitizer/lsan/lsan_interceptors.cc:66
    #1 0x400865 in s1_._omp_fn.0 (/data/vjoost/gnu/bugs/a.out+0x400865)
    #2 0x7f3b6e52776d in gomp_thread_start ../../../gcc/libgomp/team.c:117

SUMMARY: LeakSanitizer: 800 byte(s) leaked in 2 allocation(s).

unfortunately, there are no line numbers but only
 #1 0x400865 in s1_._omp_fn.0 (/data/vjoost/gnu/bugs/a.out+0x400865)
making it hard to find the location of the allocate, in complex code.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug sanitizer/61604] missing line numbers in a sanitizer backtrace from an OMP region
  2014-06-25 11:24 [Bug sanitizer/61604] New: missing line numbers in a sanitizer backtrace from an OMP region Joost.VandeVondele at mat dot ethz.ch
@ 2014-06-26  7:42 ` Joost.VandeVondele at mat dot ethz.ch
  2014-12-06  9:06 ` Joost.VandeVondele at mat dot ethz.ch
  1 sibling, 0 replies; 3+ messages in thread
From: Joost.VandeVondele at mat dot ethz.ch @ 2014-06-26  7:42 UTC (permalink / raw)
  To: gcc-bugs

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

Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Joost.VandeVondele at mat dot ethz
                   |                            |.ch

--- Comment #1 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> ---
for reference, valgrind yields a better trace, suggesting that the debug info
is at least available:

==5301== 400 bytes in 1 blocks are definitely lost in loss record 5 of 7
==5301==    at 0x4A0534D: malloc (vg_replace_malloc.c:291)
==5301==    by 0x400795: s1_._omp_fn.0 (PR61604.f90:4)
==5301==    by 0x4D5D76D: gomp_thread_start (team.c:117)
==5301==    by 0x3F924079D0: start_thread (in /lib64/libpthread-2.12.so)
==5301==    by 0x3F918E8B6C: clone (in /lib64/libc-2.12.so)
==5301== 
==5301== 400 bytes in 1 blocks are definitely lost in loss record 6 of 7
==5301==    at 0x4A0534D: malloc (vg_replace_malloc.c:291)
==5301==    by 0x400795: s1_._omp_fn.0 (PR61604.f90:4)
==5301==    by 0x4D5A63E: GOMP_parallel (parallel.c:167)
==5301==    by 0x4007C3: s1_ (PR61604.f90:1)
==5301==    by 0x4007E2: main (PR61604.f90:9)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug sanitizer/61604] missing line numbers in a sanitizer backtrace from an OMP region
  2014-06-25 11:24 [Bug sanitizer/61604] New: missing line numbers in a sanitizer backtrace from an OMP region Joost.VandeVondele at mat dot ethz.ch
  2014-06-26  7:42 ` [Bug sanitizer/61604] " Joost.VandeVondele at mat dot ethz.ch
@ 2014-12-06  9:06 ` Joost.VandeVondele at mat dot ethz.ch
  1 sibling, 0 replies; 3+ messages in thread
From: Joost.VandeVondele at mat dot ethz.ch @ 2014-12-06  9:06 UTC (permalink / raw)
  To: gcc-bugs

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

Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
      Known to work|                            |4.9.2, 5.0
         Resolution|---                         |FIXED

--- Comment #2 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> ---
This seems now fixed.

> gfortran -O1 -g3 -fno-omit-frame-pointer -fsanitize=leak -fopenmp PR61604.f90 ; export OMP_NUM_THREADS=2 ; ./a.out

=================================================================
==30967==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 400 byte(s) in 1 object(s) allocated from:
    #0 0x7fbcd1bfac06 in __interceptor_malloc
../../../../gcc/libsanitizer/lsan/lsan_interceptors.cc:51
    #1 0x400865 in s1_._omp_fn.0 /data/vjoost/gnu/bugs/PR61604.f90:4
    #2 0x7fbcd1a9b4ed in gomp_thread_start ../../../gcc/libgomp/team.c:117

Direct leak of 400 byte(s) in 1 object(s) allocated from:
    #0 0x7fbcd1bfac06 in __interceptor_malloc
../../../../gcc/libsanitizer/lsan/lsan_interceptors.cc:51
    #1 0x400865 in s1_._omp_fn.0 /data/vjoost/gnu/bugs/PR61604.f90:4
    #2 0x7fbcd1a9756e in GOMP_parallel ../../../gcc/libgomp/parallel.c:167

SUMMARY: LeakSanitizer: 800 byte(s) leaked in 2 allocation(s).


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-06  9:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-25 11:24 [Bug sanitizer/61604] New: missing line numbers in a sanitizer backtrace from an OMP region Joost.VandeVondele at mat dot ethz.ch
2014-06-26  7:42 ` [Bug sanitizer/61604] " Joost.VandeVondele at mat dot ethz.ch
2014-12-06  9:06 ` Joost.VandeVondele at mat dot ethz.ch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).