File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -126,3 +126,24 @@ memray detach
126126 :path: detach
127127 :prog: memray
128128 :nodefaultconst:
129+
130+ Attaching to processes running inside containers
131+ ------------------------------------------------
132+
133+ When attaching to a process that runs inside a container from the host,
134+ memray's GDB-based injector relies on being able to load the memray helper
135+ library and access the target process's Python symbols inside the target
136+ PID namespace. If memray (and its extension module) is not installed inside
137+ the container, GDB's injection may fail and the target process can crash
138+ (see: https://github.com/bloomberg/memray/issues/846).
139+
140+ To avoid this issue:
141+
142+ Install memray inside the container as well as on the host:
143+ ``pip install memray `` (or your preferred installation method) in the
144+ container environment so the injector can find the correct _inject.abi3.so
145+ and interpreter symbols.
146+
147+ Alternatively, run memray directly inside the container (preferred when
148+ possible), e.g. ``docker exec -it <container> memray run ... `` or attach
149+ from within the container.
You can’t perform that action at this time.
0 commit comments