-
Notifications
You must be signed in to change notification settings - Fork 25
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
Pytest-memray segfaults where memray does not #138
Comments
Have you tried the last version of memray? We have fixed some issues related to the greenlet support |
In particular bloomberg/memray#700 which was released in version 1.15.0 |
Ah I forgot to put the versions in the original bug report or update to the latest version to see if had been patched. Unfortunatly the segfault is still present in the most recent version, and also still only occues in pytest-memray versus memray. I installed versions: memray = "1.15.0" And the old versions were memray = "1.13.4" |
The stack trace looks like indeed there is some problem related to greenlet and looks oddly similar to the one we fixed but without having a way to reproduce it on our side we won't be able to help here unfortunately. I am afraid I must ask you to try to rip enough code from your codebase that can reproduce the problem but you are also comfortable sharing. |
I went ahead and tried to execute the tests suites of Gevent test suite
Greenlet test suite
|
I assume the above was with pytest-memray? Will do my best to try come up with a reproduction for the segfault. |
No, just memray (they don't use pytest). But pytest memray is not doing anything by itself tricky, the problem likely is that pytest is just adding ton of extra behaviour that somehow makes the problem more common but the problem is likely there anyway. |
Hello, I am currently getting a segfault on a private codebase when using
pytest-memray
, but I am NOT getting the same segfault when using onlymemray
without the pytest extension to profile python/pytest, i.e. runningpytest --memray ...
causes a segfault butmemray run -m pytest ...
does not.I initially suspected pytest-memray was not activating greenlet support correctly compared to core memray, as we use the async engine in sqlalchemy and other users have reported segfaults without this support: bloomberg/memray#166. However, I have confirmed via logged warnings that greenlet support is active on both pytest-memray and memray core when running pytest for my codebase. Additionally, the stack trace from the coredump looks a bit related to segfaulting when trying to trace a malloc call than tracing a function like in the linked bug:
Obviously we don't expect a segfault when running memray, but also it's strange that it only happens with pytest-memray and not when using memray core.
Given I've confirmed greenlet is activated in both cases, I'm not sure how to proceed with further debugging the cause of this segfault.
The text was updated successfully, but these errors were encountered: