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

            Bug ID: 70337
           Summary: Invalid write of size 8 in HSA plugin
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: hsa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: jamborm at gcc dot gnu.org
  Target Milestone: ---

As HSA plugin uses a shadow argument in kernel dispatch mechanism, we forget to
allocate space for the argument:

==25053== For counts of detected and suppressed errors, rerun with: -v
==25053== ERROR SUMMARY: 44 errors from 44 contexts (suppressed: 0 from 0)
==24996== Invalid write of size 8
==24996==    at 0x767AB84: GOMP_OFFLOAD_run (plugin-hsa.c:1258)
==24996==    by 0x5391205: GOMP_target_ext (target.c:1581)
==24996==    by 0x400BAA: main (in
/home/marxin/Programming/testhsa/run_tests/008-func_call_sequence/CallSequence2)
==24996==  Address 0xa7df758 is 0 bytes after a block of size 8 alloc'd
==24996==    at 0x4C2A16F: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==24996==    by 0x4EFC68D: core::CPUMemoryRegion::Allocate(unsigned long,
void**) const (cpu_memory_region.h:69)
==24996==    by 0x4F16C1C: core::Runtime::AllocateMemory(core::MemoryRegion
const*, unsigned long, void**) (runtime.cpp:287)
==24996==    by 0x4F09984: HSA::hsa_memory_allocate(hsa_region_s, unsigned
long, void**) (hsa.cpp:730)
==24996==    by 0x4F21049: hsa_memory_allocate (hsa_table_interface.cpp:236)
==24996==    by 0x76796A9: create_single_kernel_dispatch (plugin-hsa.c:888)
==24996==    by 0x767A9D8: create_kernel_dispatch (plugin-hsa.c:1051)
==24996==    by 0x767A9D8: GOMP_OFFLOAD_run (plugin-hsa.c:1214)
==24996==    by 0x5391205: GOMP_target_ext (target.c:1581)
==24996==    by 0x400BAA: main (in
/home/marxin/Programming/testhsa/run_tests/008-func_call_sequence/CallSequence2)

Martin

Reply via email to