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

memray attach with lldb can trigger an abort due to stack smashing detection #471

Open
godlygeek opened this issue Sep 27, 2023 · 0 comments

Comments

@godlygeek
Copy link
Contributor

I'm not 100% sure yet what's causing this, and so far I've only been able to reproduce it with lldb, not gdb. But this tiny one-line change to our test suite:

diff --git a/tests/integration/test_attach.py b/tests/integration/test_attach.py
index f321087..52876ca 100644
--- a/tests/integration/test_attach.py
+++ b/tests/integration/test_attach.py
@@ -91,6 +91,7 @@ def run_process(cmd):
     # WHEN
     try:
         subprocess.check_output(cmd, stderr=subprocess.STDOUT, text=True)
+        subprocess.check_output(cmd, stderr=subprocess.STDOUT, text=True)
     except subprocess.CalledProcessError as exc:
         if "Couldn't write extended state status" in exc.output:
             # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=898048

Is enough to fairly reliably provoke this failure:

tests/integration/test_attach.py::test_basic_attach[lldb] *** stack smashing detected ***: /home/mwoznisk/.pyenv/versions/memray-3.11/bin/python terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x7f51f340c7a7]
/lib64/libc.so.6(+0x118762)[0x7f51f340c762]
/home/mwoznisk/repos/memray-pr/src/memray/_memray.cpython-311-x86_64-linux-gnu.so(+0x84eeb)[0x7f51f2e61eeb]
/home/mwoznisk/repos/memray-pr/src/memray/_test_utils.cpython-311-x86_64-linux-gnu.so(+0x149e0)[0x7f51f2a689e0]
...
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