Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash if PAPI unavailable #37

Open
loveshack opened this issue Apr 15, 2019 · 0 comments
Open

crash if PAPI unavailable #37

loveshack opened this issue Apr 15, 2019 · 0 comments

Comments

@loveshack
Copy link

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); 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant