Skip to content

crash if PAPI unavailable #37

Description

@loveshack

If PAPI isn't available (e.g. in VMs), apart from the error messages at startup, you get a SEGV writing the report at finalization. I fixed that with this change.

--- IPM-2.0.6/src/report_xml.c~	2016-07-17 00:15:01.000000000 +0100
+++ IPM-2.0.6/src/report_xml.c	2019-04-12 15:37:22.087631803 +0100
@@ -293,7 +293,7 @@
 
   nmod=0;
   for( i=0; i<MAXNUM_MODULES; i++ ) {
-    if( !(modules[i].name) || !(modules[i].xml) ) 
+    if( (modules[i].state == STATE_ERROR) || !(modules[i].name) || !(modules[i].xml) ) 
       continue;
 
     nmod++;
@@ -304,7 +304,7 @@
   /* print the contribution to the task-wide <modules> entry
      or the region-specific <modules> entry for each module */
   for( i=0; i<MAXNUM_MODULES; i++ ) {
-    if( !(modules[i].name) || !(modules[i].xml) ) 
+    if( (modules[i].state == STATE_ERROR) || !(modules[i].name) || !(modules[i].xml) ) 
       continue;
 
     res+=modules[i].xml(&(modules[i]), ptr, reg); 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions