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

[python] importing requests module may lead to crash #2622

Open
doegox opened this issue Nov 7, 2024 · 3 comments
Open

[python] importing requests module may lead to crash #2622

doegox opened this issue Nov 7, 2024 · 3 comments

Comments

@doegox
Copy link
Contributor

doegox commented Nov 7, 2024

Just to track it down as it's probably not an easy fix...

Work fine in Bookworm docker but fails in Trixie docker:

$ cd docker/debian-13-trixie
$ ./docker_build.sh
$ ./docker_run.sh
rrg@f8e5d5626aab:~/proxmark3$ sudo apt install python3-requests
rrg@f8e5d5626aab:~/proxmark3$ make clean; make client -j
rrg@f8e5d5626aab:~/proxmark3$ echo import requests > test.py
rrg@f8e5d5626aab:~/proxmark3$ client/proxmark3 -c "script run test; script run test"
[offline|script] pm3 --> script run test
[+] executing python test.py
[+] args ''

[+] finished test

[offline|script] pm3 --> script run test
[+] executing python test.py
[+] args ''
double free or corruption (out)
Aborted
@doegox
Copy link
Contributor Author

doegox commented Nov 12, 2024

No success so far even by running scripts in some Py_NewInterpreter.
The only way it doesn't crash is by not calling Py_Finalize. Which BTW opens other perspectives as it would allow to preserve variables between script calls...

@xianglin1998
Copy link
Contributor

It is worth mentioning that the stack size of the Alpine image in Docker is only 80-128KB, but PM3 clients will allocate more stack space than this size at startup, leading to crashes.

https://ariadne.space/2021/06/25/understanding-thread-stack-sizes-and-how-alpine-is-different/

So I am always very sensitive to Docker and client crashes.

@doegox
Copy link
Contributor Author

doegox commented Dec 19, 2024

It crashes on my host too (Trixie), the Docker example was just to get an easily reproducible setup.

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

2 participants