WIP: quick hack demo of gotcha (do not merge) #701
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Just opening this PR to track the example. DO NOT MERGE.
This commit is a quick and dirty hack to illustrate how gotcha might be used for Darshan instrumentation. It disables the existing H5Fcreate() wrapper and replaces it with a hardcoded wrapper in darshan-core.c loaded using gotcha from within the darshan initialization function. The hardcoded wrapper just prints a "hello world" message. The purpose is to illustrate the potential for wrapping symbols that appear after the darshan library in the runtime link order.
A quick and dirty example of running it with the ph5example test program is included in the darshan-runtime/gotcha-demo-test-case directory.
This example does not work. The gotcha wrapper loading appears to work ok, but then subsequent calls with the existing wrappers (specifically wrappers for printf() ) produce a segfault with the pc set to the zero page.
Possibly a bug, or possibly a bad interaction between gotcha and the dlsym calls made by existing Darshan wrappers.