- edited description
SDE: Problem when using shutdown for multiple libs
Maybe I am misusing the sde
in which case I will change how we use it in our code.
Context:
In our code (Ginkgo), we consider that every new logger object the user instantiates should be a separate namespace/library, because that would mean the user wants to count different things or in a different way (otherwise, they could just use one logger for everything). For most users, there would be only one logger object and thus only one sde:::ginkgo
namespace. We differentiate namespaces by adding an extra unique number to it.
Problem:
In the case where there are multiple logger objects, thus multiple library namespaces registered under the sde
, then we need to calling multiple times papi_sde_init
and papi_sde_shutdown
(at the construction/destruction of the Ginkgo logger, essentially). In this precise case, I found that the global control structure is not kept consistent: the lib_handle
is freed but the global control structure still points to the freed objects, this makes any subsequent call to any sde
function fail after calling papi_sde_shutdown
once.
Fix:
For more details, see the following commit which fixes the problem. It’s most likely not entirely correct, but it makes our use case (examples and tests) pass: https://bitbucket.org/terry_cojean/papi/commits/77cdd0ba8db98d86c1459dd5f55013aba242d5d5
Comments (8)
-
Account Deactivated reporter -
Account Deactivated reporter - edited description
-
Account Deactivated reporter - edited description
-
Terry, your solution seems good to me. Can you post it as a PR to our repo?
thanks,
Anthony
-
Account Deactivated reporter It seems I do not have the right to open a PR. I would be happy to afterwards. Otherwise, feel free to steal this small commit that’s fine with me as well.
-
I don't understand why you are facing issues with creating a PR. We have external people submitting PRs all the time. Can you check the steps under "Contributing", in this wiki page: https://bitbucket.org/icl/papi/wiki/Home to see if you are missing something?
Anthony
-
Account Deactivated reporter Thanks Anthony, I misunderstood how Bitbucket works, the link was helpful!
-
Account Deactivated reporter - changed status to resolved
PR #469 was merged
- Log in to comment