Dear PAPI Developers,
I am observing a segmentation fault in my program, which queries for all the PAPI event values (preset and native).
The program has the following loop:
For every event, the following steps are performed:
1). PAPI_library_init
2). If event is native, the event is added using PAPI_add_named_event and PAPI_start
3). If event is not native, PAPI_num_counters and PAPI_start_counters are called
4). My routine (simple matrix-matrix multiplication) is executed
5). If event is native, PAPI_stop is called before the event value is read
6). If event is not native, PAPI_read_counters is called to read the event value
7). If event is native, PAPI_shutdown is called
8). If event is not native, PAPI_stop_counters and PAPI_shutdown are called
Please let me know if this is the correct approach to get all the event values.
The program is executed on a Intel Ivybridge Processor (lscpu output shown below):
[b]shell$ lscpu[/b]
[code]Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 2
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 45
Stepping: 7
CPU MHz: 3601.000
BogoMIPS: 7183.28
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 10240K
NUMA node0 CPU(s): 0-7[/code]
Unfortunately I am not able to attach the file containing the valgrind errors. So, they are printed below for your study:
[code]...
<===MPEC===> (INFO) Native event UOPS_ISSUED retrieved
<===MPEC===> (INFO) Native event UOPS_RETIRED retrieved
<===MPEC===> (INFO) Native event CYCLE_ACTIVITY retrieved
<===MPEC===> (INFO) Native ev==5650== Invalid read of size 8
==5650== at 0x4C2F79E: memcpy@@GLIBC_2.14 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5650== by 0x4CB756: perf_table_clone (pfmlib_perf_event_pmu.c:233)
==5650== by 0x4CB9D1: gen_tracepoint_table (pfmlib_perf_event_pmu.c:338)
==5650== by 0x4CBF21: pfm_perf_init (pfmlib_perf_event_pmu.c:490)
==5650== by 0x4C85BB: pfmlib_pmu_activate (pfmlib_common.c:602)
==5650== by 0x4C8922: pfmlib_init_pmus (pfmlib_common.c:708)
==5650== by 0x4C8AB7: pfm_initialize (pfmlib_common.c:771)
==5650== by 0x4D597C: _papi_libpfm4_init (papi_libpfm4_events.c:105)
==5650== by 0x4C095F: _pe_init_component (perf_event.c:1688)
==5650== by 0x4B63F5: _papi_hwi_init_global (papi_internal.c:1907)
==5650== by 0x4B3EFC: PAPI_library_init (papi.c:615)
==5650== by 0x45C9B7: Mpec::CPUEvent::subscribe(unsigned int) (cpuevent.cpp:242)
==5650== Address 0x825000 is not stack'd, malloc'd or (recently) free'd
==5650==
==5650==
==5650== Process terminating with default action of signal 11 (SIGSEGV)
==5650== Access not within mapped region at address 0x825000
==5650== at 0x4C2F79E: memcpy@@GLIBC_2.14 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5650== by 0x4CB756: perf_table_clone (pfmlib_perf_event_pmu.c:233)
==5650== by 0x4CB9D1: gen_tracepoint_table (pfmlib_perf_event_pmu.c:338)
==5650== by 0x4CBF21: pfm_perf_init (pfmlib_perf_event_pmu.c:490)
==5650== by 0x4C85BB: pfmlib_pmu_activate (pfmlib_common.c:602)
==5650== by 0x4C8922: pfmlib_init_pmus (pfmlib_common.c:708)
==5650== by 0x4C8AB7: pfm_initialize (pfmlib_common.c:771)
==5650== by 0x4D597C: _papi_libpfm4_init (papi_libpfm4_events.c:105)
==5650== by 0x4C095F: _pe_init_component (perf_event.c:1688)
==5650== by 0x4B63F5: _papi_hwi_init_global (papi_internal.c:1907)
==5650== by 0x4B3EFC: PAPI_library_init (papi.c:615)
==5650== by 0x45C9B7: Mpec::CPUEvent::subscribe(unsigned int) (cpuevent.cpp:242)
==5650== If you believe this happened as a result of a stack
==5650== overflow in your program's main thread (unlikely but
==5650== possible), you can try to increase the size of the
==5650== main thread stack using the --main-stacksize= flag.
==5650== The main thread stack size used in this run was 8388608.
ent OFFCORE_RESPONSE_0 retrieved
<===MPEC===> (INFO) Native event OFFCORE_RESPONSE_1 retrieved
...[/code]
Please let me know if you need further information. Thank you for your help.
Best Regards
Manumachu
