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

Extrae_define_event_type does not honor value range of extrae_value_t #110

Open
valentin-seitz opened this issue Jun 20, 2024 · 0 comments

Comments

@valentin-seitz
Copy link

According to the extrae_types.h the extrae_value_t is defined as: typedef unsigned long long extrae_value_t;

Executing a code similar to:

#include <extrae.h>
#include <limits.h>
#include <stdio.h>
int main(){
        Extrae_init();
        extrae_value_t value = ULLONG_MAX -1; // ULLONG_MAX -1 = 18446744073709551614
        extrae_type_t type=1000;
        printf("Extrae Value: %llu", value);
        Extrae_event(type,value);
        
        extrae_value_t values[2]={0,value};
        char * descriptions[2] = {"zero","max_value-1"};
        unsigned nValues=2;
        Extrae_define_event_type (&type,"ownEventType",&nValues, values, descriptions);
}

I would expect the output in the corresponding .pcf file to contain:

EVENT_TYPE
0    1000    ownEventType
VALUES
0      zero
18446744073709551614     max_value-1

But using the current version of Extrae (v.4.1.7) I get the following output:

EVENT_TYPE
0    1000    ownEventType
VALUES
0      zero
-1      max_value-1

Where the extrae_value_t seems to overflow, probably because of a cast happening in the merger, as the .sym files still shows the correct entry.

This issue was also reported via email, but I will put here as well as other users might also encounter a similar problem down the line.

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