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

__malloc_hook issue #1336

Closed
igor-ivanov opened this issue Feb 1, 2016 · 3 comments
Closed

__malloc_hook issue #1336

igor-ivanov opened this issue Feb 1, 2016 · 3 comments
Assignees
Labels

Comments

@igor-ivanov
Copy link
Member

This issue came from UCX:
btl openib sets __malloc_hook to handle alignment (added in this commit cd17fee)

when it’s closed (component_close), for example because another component has higher priority, it restores the original handler.

The problem is that the __malloc_hook may have been changed since then by other component (e.g UCX), and restoring the original handler overrides this other component setting (UCX).

As a result, when UCX is running, it installs __malloc_hook, but btl openib changes it “under its feet”

I think this should be fixed by checking that the currentl __malloc_hook still points to btl_openib’s replacement, before restoring the original.

@igor-ivanov igor-ivanov self-assigned this Feb 1, 2016
@ggouaillardet
Copy link
Contributor

if you do that, when ucx is closed, it might restore the openib malloc hook.
and if the openib btl was unmmap'ed, very bad things will happen.

I am afraid we need something more complex
for example a "stack" of hooks, and the possibility to remove a hook in the middle of the stack

@jsquyres
Copy link
Member

jsquyres commented Feb 6, 2016

I agree with @ggouaillardet -- sounds like some OPAL-level infrastructure to track the malloc hook is required.

@yosefe
Copy link
Contributor

yosefe commented Feb 8, 2016

@igor-ivanov maybe at least we can install malloc hook for btl_openib, only if it's really used, and not if it is not eventually selected?

igor-ivanov added a commit to igor-ivanov/ompi that referenced this issue Feb 10, 2016
These changes fix issue open-mpi#1336

opal/memory/linux component should be single place that opeartes with
Memory Allocation Hooks. It is safe because it is linked statically.
igor-ivanov added a commit to igor-ivanov/ompi that referenced this issue Feb 10, 2016
These changes fix issue open-mpi#1336

opal/memory/linux component should be single place that opeartes with
Memory Allocation Hooks. It is safe because it is linked statically.
@hppritcha hppritcha added the bug label Feb 10, 2016
igor-ivanov added a commit to igor-ivanov/ompi that referenced this issue Feb 10, 2016
These changes fix issue open-mpi#1336

opal/memory/linux component should be single place that opeartes with
Memory Allocation Hooks. It is safe because it is linked statically.
igor-ivanov added a commit to igor-ivanov/ompi that referenced this issue Feb 11, 2016
These changes fix issue open-mpi#1336

- improve abstractions: opal/memory/linux component should be single place that opeartes with
Memory Allocation Hooks.
- avoid collisions in case dynamic component open/close: it is safe because it is linked statically.
- does not change original behaivour.
igor-ivanov added a commit to igor-ivanov/ompi that referenced this issue Feb 11, 2016
These changes fix issue open-mpi#1336

- improve abstractions: opal/memory/linux component should be single place that opeartes with
Memory Allocation Hooks.
- avoid collisions in case dynamic component open/close: it is safe because it is linked statically.
- does not change original behaivour.
igor-ivanov added a commit to igor-ivanov/ompi that referenced this issue Feb 11, 2016
These changes fix issue open-mpi#1336

- improve abstractions: opal/memory/linux component should be single place that opeartes with
Memory Allocation Hooks.
- avoid collisions in case dynamic component open/close: it is safe because it is linked statically.
- does not change original behaivour.
igor-ivanov added a commit to igor-ivanov/ompi-release that referenced this issue Feb 15, 2016
These changes fix issue open-mpi/ompi#1336

- improve abstractions: opal/memory/linux component should be single place that opeartes with
Memory Allocation Hooks.
- avoid collisions in case dynamic component open/close: it is safe because it is linked statically.
- does not change original behaivour.
igor-ivanov added a commit to igor-ivanov/ompi-release that referenced this issue Feb 16, 2016
These changes fix issue open-mpi/ompi#1336

- improve abstractions: opal/memory/linux component should be single place that opeartes with
Memory Allocation Hooks.
- avoid collisions in case dynamic component open/close: it is safe because it is linked statically.
- does not change original behaivour.
igor-ivanov added a commit to igor-ivanov/ompi-release that referenced this issue Feb 29, 2016
These changes fix issue open-mpi/ompi#1336

- improve abstractions: opal/memory/linux component should be single place that opeartes with
Memory Allocation Hooks.
- avoid collisions in case dynamic component open/close: it is safe because it is linked statically.
- does not change original behaivour.
igor-ivanov added a commit to igor-ivanov/ompi-release that referenced this issue Feb 29, 2016
These changes fix issue open-mpi/ompi#1336

- improve abstractions: opal/memory/linux component should be single place that opeartes with
Memory Allocation Hooks.
- avoid collisions in case dynamic component open/close: it is safe because it is linked statically.
- does not change original behaivour.
igor-ivanov added a commit to igor-ivanov/ompi-release that referenced this issue Mar 4, 2016
These changes fix issue open-mpi/ompi#1336

- improve abstractions: opal/memory/linux component should be single place that opeartes with
Memory Allocation Hooks.
- avoid collisions in case dynamic component open/close: it is safe because it is linked statically.
- does not change original behaivour.
@jsquyres jsquyres modified the milestone: v2.0.1 Mar 22, 2016
bosilca pushed a commit to bosilca/ompi that referenced this issue Oct 3, 2016
These changes fix issue open-mpi#1336

- improve abstractions: opal/memory/linux component should be single place that opeartes with
Memory Allocation Hooks.
- avoid collisions in case dynamic component open/close: it is safe because it is linked statically.
- does not change original behaivour.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants